Removed typedefs from header files where they are only used internal.
Removed none used macros and changed all macro names to upper case.
#define HtmlInputElement WebKitDOMHTMLInputElement
#define HtmlTextareaElement WebKitDOMHTMLTextAreaElement
-// style
-#define style_compare_property(style, name, value) (!strcmp(webkit_dom_css_style_declaration_get_property_value(style, name), value))
-
-typedef struct {
- gulong left;
- gulong right;
- gulong top;
- gulong bottom;
-} DomBoundingRect;
-
void dom_check_auto_insert(WebKitWebView *view);
void dom_clear_focus(WebKitWebView *view);
gboolean dom_focus_input(WebKitWebView *view);
{
FILE *f;
if ((f = fopen(file, "w"))) {
- file_lock_set(fileno(f), F_WRLCK);
+ FILE_LOCK_SET(fileno(f), F_WRLCK);
/* overwrite the history file with new unique history items */
for (GList *link = list; link; link = link->next) {
}
}
- file_lock_set(fileno(f), F_UNLCK);
+ FILE_LOCK_SET(fileno(f), F_UNLCK);
fclose(f);
}
}
#include "command.h"
#include "completion.h"
+typedef struct {
+ int mode; /* mode maks for allowed browser modes */
+ guint modkey;
+ guint modmask; /* modemask for the kayval */
+ guint keyval;
+ Command func;
+ Arg arg;
+} Keybind;
+
extern VbCore vb;
static GSList *keys;
#include <gdk/gdkkeysyms.h>
#include <gdk/gdkkeysyms-compat.h>
-typedef struct {
- int mode; /* mode maks for allowed browser modes */
- guint modkey;
- guint modmask; /* modemask for the kayval */
- guint keyval;
- Command func;
- Arg arg;
-} Keybind;
-
void keybind_init(void);
void keybind_cleanup(void);
gboolean keybind_add_from_string(char *keys, const char *command, const Mode mode);
#define PRIMARY_CLIPBOARD() gtk_clipboard_get(GDK_SELECTION_PRIMARY)
#define SECONDARY_CLIPBOARD() gtk_clipboard_get(GDK_NONE)
-#define OVERWRITE_STRING(t, s) if (t) {g_free(t); t = NULL;} t = g_strdup(s);
+#define OVERWRITE_STRING(t, s) {if (t) {g_free(t); t = NULL;} t = g_strdup(s);}
#define IS_ESCAPE_KEY(k, s) ((k == GDK_Escape && s == 0) || (k == GDK_c && s == GDK_CONTROL_MASK))
#define CLEAN_STATE_WITH_SHIFT(e) ((e)->state & (GDK_MOD1_MASK|GDK_MOD4_MASK|GDK_SHIFT_MASK|GDK_CONTROL_MASK))
#define CLEAN_STATE(e) ((e)->state & (GDK_MOD1_MASK|GDK_MOD4_MASK|GDK_CONTROL_MASK))
-#define file_lock_set(fd, cmd) \
+#define FILE_LOCK_SET(fd, cmd) \
{ \
struct flock lock = { .l_type = cmd, .l_start = 0, .l_whence = SEEK_SET, .l_len = 0}; \
fcntl(fd, F_SETLK, lock); \
#define VB_GTK_STATE_NORMAL GTK_STATE_FLAG_NORMAL
#define VB_GTK_STATE_ACTIVE GTK_STATE_FLAG_ACTIVE
#define VB_GTK_STATE_SELECTED GTK_STATE_FLAG_SELECTED
-#define VB_WIDGET_SET_STATE(w, s) gtk_widget_set_state_flags(w, s, true)
+#define VB_WIDGET_SET_STATE(w, s) (gtk_widget_set_state_flags(w, s, true))
#else
#define VB_GTK_STATE_NORMAL GTK_STATE_NORMAL
#define VB_GTK_STATE_ACTIVE GTK_STATE_ACTIVE
#define VB_GTK_STATE_SELECTED GTK_STATE_SELECTED
-#define VB_WIDGET_SET_STATE(w, s) gtk_widget_set_state(w, s)
+#define VB_WIDGET_SET_STATE(w, s) (gtk_widget_set_state(w, s))
#endif
/* enums */
FILE *f;
if ((f = fopen(file, "a+"))) {
- file_lock_set(fileno(f), F_WRLCK);
+ FILE_LOCK_SET(fileno(f), F_WRLCK);
va_start(args, format);
vfprintf(f, format, args);
va_end(args);
- file_lock_set(fileno(f), F_UNLCK);
+ FILE_LOCK_SET(fileno(f), F_UNLCK);
fclose(f);
return true;
content = util_get_file_contents(file, NULL);
if ((f = fopen(file, "w"))) {
- file_lock_set(fileno(f), F_WRLCK);
+ FILE_LOCK_SET(fileno(f), F_WRLCK);
va_start(args, format);
/* write new content to the file */
/* append previous file content */
fputs(content, f);
- file_lock_set(fileno(f), F_UNLCK);
+ FILE_LOCK_SET(fileno(f), F_UNLCK);
fclose(f);
res = true;