Fix include. Add empty lines between include layers.

This commit is contained in:
John Chen 2017-01-30 10:42:24 +08:00
parent 50fd0fae9b
commit 7037afb2bc
17 changed files with 103 additions and 115 deletions

View File

@ -1,15 +1,16 @@
/* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */ /* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */
#include <stdlib.h>
#include <stdio.h>
#include <glib.h>
#include <string.h>
#include <gio/gio.h>
#include "dunst.h"
#include "dbus.h" #include "dbus.h"
#include <gio/gio.h>
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dunst.h"
#include "notification.h" #include "notification.h"
#include "utils.h"
#include "settings.h" #include "settings.h"
#include "utils.h"
GDBusConnection *dbus_conn; GDBusConnection *dbus_conn;

View File

@ -3,8 +3,6 @@
#ifndef DUNST_DBUS_H #ifndef DUNST_DBUS_H
#define DUNST_DBUS_H #define DUNST_DBUS_H
#include <dbus/dbus.h>
#include "notification.h" #include "notification.h"
int initdbus(void); int initdbus(void);

View File

@ -3,41 +3,24 @@
#define _GNU_SOURCE #define _GNU_SOURCE
#define XLIB_ILLEGAL_ACCESS #define XLIB_ILLEGAL_ACCESS
#include <assert.h>
#include <unistd.h>
#include <time.h>
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <fnmatch.h>
#include <sys/time.h>
#include <math.h>
#include <errno.h>
#include <signal.h>
#include <sys/wait.h>
#include <glib.h>
#include <glib-unix.h>
#include <X11/Xlib.h>
#include <X11/XKBlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
#ifdef XINERAMA
#include <X11/extensions/Xinerama.h>
#endif
#include <X11/extensions/scrnsaver.h>
#include "dunst.h" #include "dunst.h"
#include "x.h"
#include "dbus.h"
#include "utils.h"
#include "rules.h"
#include "notification.h"
#include "menu.h"
#include <X11/Xlib.h>
#include <glib-unix.h>
#include <glib.h>
#include <signal.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "dbus.h"
#include "menu.h"
#include "notification.h"
#include "option_parser.h" #include "option_parser.h"
#include "settings.h" #include "settings.h"
#include "x.h"
#define LENGTH(X) (sizeof X / sizeof X[0]) #define LENGTH(X) (sizeof X / sizeof X[0])

View File

@ -7,7 +7,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdbool.h> #include <stdbool.h>
#include "x.h"
#include "notification.h" #include "notification.h"
#define ERR(msg) printf("%s : %d\n", (msg), __LINE__) #define ERR(msg) printf("%s : %d\n", (msg), __LINE__)

View File

@ -1,20 +1,23 @@
/* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */ /* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */
#define _GNU_SOURCE #define _GNU_SOURCE
#include <stdlib.h> #include "menu.h"
#include <stdbool.h>
#include <regex.h> #include <errno.h>
#include <stdio.h> #include <glib.h>
#include <string.h> #include <regex.h>
#include <unistd.h> #include <stdbool.h>
#include <errno.h> #include <stdio.h>
#include <sys/wait.h> #include <stdlib.h>
#include <glib.h> #include <string.h>
#include <sys/wait.h>
#include <unistd.h>
#include "dunst.h"
#include "utils.h"
#include "settings.h"
#include "dbus.h" #include "dbus.h"
#include "dunst.h"
#include "settings.h"
#include "notification.h"
#include "utils.h"
static bool is_initialized = false; static bool is_initialized = false;
static regex_t cregex; static regex_t cregex;

View File

@ -2,9 +2,6 @@
#ifndef DUNST_MENU_H #ifndef DUNST_MENU_H
#define DUNST_MENU_H #define DUNST_MENU_H
#include "dunst.h"
#include <regex.h>
char *extract_urls(const char *to_match); char *extract_urls(const char *to_match);
void open_browser(const char *url); void open_browser(const char *url);
void invoke_action(const char *action); void invoke_action(const char *action);

View File

@ -1,24 +1,26 @@
/* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */ /* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */
#define _GNU_SOURCE #define _GNU_SOURCE
#include <stdlib.h> #include "notification.h"
#include <time.h>
#include <glib.h>
#include <errno.h>
#include <string.h>
#include <stdbool.h>
#include <unistd.h>
#include <sys/wait.h>
#include <assert.h> #include <assert.h>
#include <errno.h>
#include <glib.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
#include "dbus.h" #include "dbus.h"
#include "x.h"
#include "notification.h"
#include "dunst.h" #include "dunst.h"
#include "utils.h"
#include "settings.h"
#include "rules.h"
#include "menu.h" #include "menu.h"
#include "rules.h"
#include "settings.h"
#include "utils.h"
#include "x.h"
int next_notification_id = 1; int next_notification_id = 1;

View File

@ -2,7 +2,10 @@
#ifndef DUNST_NOTIFICATION_H #ifndef DUNST_NOTIFICATION_H
#define DUNST_NOTIFICATION_H #define DUNST_NOTIFICATION_H
#include "x.h" #include <glib.h>
#include <stdbool.h>
#include <time.h>
#include "settings.h" #include "settings.h"
#define LOW 0 #define LOW 0

View File

@ -1,15 +1,14 @@
/* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */ /* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */
#define _GNU_SOURCE #define _GNU_SOURCE
#include "option_parser.h"
#include <string.h> #include <glib.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <glib.h> #include <stdlib.h>
#include <string.h>
#include "option_parser.h"
#include "utils.h" #include "utils.h"
typedef struct _entry_t { typedef struct _entry_t {

View File

@ -2,6 +2,7 @@
#ifndef DUNST_OPTION_PARSER_H #ifndef DUNST_OPTION_PARSER_H
#define DUNST_OPTION_PARSER_H #define DUNST_OPTION_PARSER_H
#include <stdbool.h>
#include <stdio.h> #include <stdio.h>
int load_ini_file(FILE *); int load_ini_file(FILE *);

View File

@ -1,10 +1,11 @@
/* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */ /* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */
#include <glib.h> #include "rules.h"
#include <fnmatch.h> #include <fnmatch.h>
#include <glib.h>
#include "dunst.h" #include "dunst.h"
#include "rules.h"
/* /*
* Apply rule to notification. * Apply rule to notification.

View File

@ -3,8 +3,8 @@
#define DUNST_RULES_H #define DUNST_RULES_H
#include <glib.h> #include <glib.h>
#include <stdbool.h>
#include "dunst.h"
#include "notification.h" #include "notification.h"
#include "settings.h" #include "settings.h"

View File

@ -1,19 +1,21 @@
/* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */ /* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */
#include "settings.h"
#include <glib.h> #include <glib.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifndef STATIC_CONFIG #ifndef STATIC_CONFIG
#include <basedir.h> #include <basedir.h>
#include <basedir_fs.h> #include <basedir_fs.h>
#endif #endif
#include "dunst.h" #include "rules.h" // put before config.h to fix missing include
#include "rules.h"
#include "option_parser.h"
#include "settings.h"
#include "config.h" #include "config.h"
#include "dunst.h"
#include "notification.h"
#include "option_parser.h"
#include "utils.h" #include "utils.h"
settings_t settings; settings_t settings;

View File

@ -2,6 +2,10 @@
#ifndef DUNST_SETTINGS_H #ifndef DUNST_SETTINGS_H
#define DUNST_SETTINGS_H #define DUNST_SETTINGS_H
#include <stdbool.h>
#include "x.h"
enum alignment { left, center, right }; enum alignment { left, center, right };
enum icon_position_t { icons_left, icons_right, icons_off }; enum icon_position_t { icons_left, icons_right, icons_off };
enum separator_color { FOREGROUND, AUTO, FRAME, CUSTOM }; enum separator_color { FOREGROUND, AUTO, FRAME, CUSTOM };

View File

@ -1,14 +1,11 @@
/* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */ /* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */
#define _GNU_SOURCE #define _GNU_SOURCE
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
#include <glib.h>
#include "utils.h" #include "utils.h"
#include "dunst.h"
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char *string_replace_char(char needle, char replacement, char *haystack) { char *string_replace_char(char needle, char replacement, char *haystack) {
char *current = haystack; char *current = haystack;

34
src/x.c
View File

@ -1,26 +1,30 @@
/* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */ /* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */
#include <math.h> #include "x.h"
#include <sys/time.h>
#include <ctype.h>
#include <assert.h>
#include <locale.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/X.h> #include <X11/X.h>
#include <X11/XKBlib.h>
#include <X11/Xatom.h> #include <X11/Xatom.h>
#include <pango/pangocairo.h> #include <X11/Xlib.h>
#include <X11/Xutil.h>
#ifdef XINERAMA
#include <X11/extensions/Xinerama.h>
#include <assert.h>
#endif
#include <cairo-xlib.h> #include <cairo-xlib.h>
#include <gdk/gdk.h> #include <gdk/gdk.h>
#include <locale.h>
#include <math.h>
#include <pango/pangocairo.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "x.h"
#include "utils.h"
#include "dunst.h" #include "dunst.h"
#include "settings.h"
#include "notification.h" #include "notification.h"
#include "settings.h"
#include "utils.h"
#define WIDTH 400 #define WIDTH 400
#define HEIGHT 400 #define HEIGHT 400

10
src/x.h
View File

@ -2,16 +2,10 @@
#ifndef DUNST_X_H #ifndef DUNST_X_H
#define DUNST_X_H #define DUNST_X_H
#include <stdbool.h>
#include "glib.h"
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/XKBlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
#ifdef XINERAMA
#include <X11/extensions/Xinerama.h>
#endif
#include <X11/extensions/scrnsaver.h> #include <X11/extensions/scrnsaver.h>
#include <glib.h>
#include <stdbool.h>
#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask) #define BUTTONMASK (ButtonPressMask|ButtonReleaseMask)
#define FONT_HEIGHT_BORDER 2 #define FONT_HEIGHT_BORDER 2