diff --git a/wmifs/wmgeneral/list.c b/wmifs/wmgeneral/list.c index d9f7329..9675233 100644 --- a/wmifs/wmgeneral/list.c +++ b/wmifs/wmgeneral/list.c @@ -38,132 +38,117 @@ Boston, MA 02111-1307, USA. */ /* Return a cons cell produced from (head . tail) */ -INLINE LinkedList* -list_cons(void* head, LinkedList* tail) +INLINE LinkedList *list_cons(void *head, LinkedList *tail) { - LinkedList* cell; + LinkedList *cell; - cell = (LinkedList*)malloc(sizeof(LinkedList)); - cell->head = head; - cell->tail = tail; - return cell; + cell = (LinkedList *)malloc(sizeof(LinkedList)); + cell->head = head; + cell->tail = tail; + return cell; } /* Return the length of a list, list_length(NULL) returns zero */ -INLINE int -list_length(LinkedList* list) +INLINE int list_length(LinkedList *list) { - int i = 0; - while(list) - { - i += 1; - list = list->tail; - } - return i; + int i = 0; + while (list) { + i += 1; + list = list->tail; + } + return i; } /* Return the Nth element of LIST, where N count from zero. If N larger than the list length, NULL is returned */ -INLINE void* -list_nth(int index, LinkedList* list) +INLINE void *list_nth(int index, LinkedList *list) { - while(index-- != 0) - { - if(list->tail) - list = list->tail; - else - return 0; - } - return list->head; + while (index-- != 0) { + if (list->tail) + list = list->tail; + else + return 0; + } + return list->head; } /* Remove the element at the head by replacing it by its successor */ -INLINE void -list_remove_head(LinkedList** list) +INLINE void list_remove_head(LinkedList **list) { - if (!*list) return; - if ((*list)->tail) - { - LinkedList* tail = (*list)->tail; /* fetch next */ - *(*list) = *tail; /* copy next to list head */ - free(tail); /* free next */ - } - else /* only one element in list */ - { - free(*list); - (*list) = 0; - } + if (!*list) + return; + if ((*list)->tail) { + LinkedList *tail = (*list)->tail; /* fetch next */ + *(*list) = *tail; /* copy next to list head */ + free(tail); /* free next */ + } else { /* only one element in list */ + free(*list); + (*list) = 0; + } } /* Remove the element with `car' set to ELEMENT */ /* -INLINE void -list_remove_elem(LinkedList** list, void* elem) -{ + INLINE void + list_remove_elem(LinkedList** list, void* elem) + { while (*list) - { - if ((*list)->head == elem) - list_remove_head(list); - *list = (*list ? (*list)->tail : NULL); - } -}*/ + { + if ((*list)->head == elem) + list_remove_head(list); + *list = (*list ? (*list)->tail : NULL); + } + }*/ -INLINE LinkedList * -list_remove_elem(LinkedList* list, void* elem) +INLINE LinkedList *list_remove_elem(LinkedList *list, void *elem) { - LinkedList *tmp; + LinkedList *tmp; - if (list) { - if (list->head == elem) { - tmp = list->tail; - free(list); - return tmp; + if (list) { + if (list->head == elem) { + tmp = list->tail; + free(list); + return tmp; + } + list->tail = list_remove_elem(list->tail, elem); + return list; } - list->tail = list_remove_elem(list->tail, elem); - return list; - } - return NULL; + return NULL; } /* Return element that has ELEM as car */ -INLINE LinkedList* -list_find(LinkedList* list, void* elem) +INLINE LinkedList *list_find(LinkedList *list, void *elem) { - while(list) - { - if (list->head == elem) - return list; - list = list->tail; - } - return NULL; + while (list) { + if (list->head == elem) + return list; + list = list->tail; + } + return NULL; } /* Free list (backwards recursive) */ -INLINE void -list_free(LinkedList* list) +INLINE void list_free(LinkedList *list) { - if(list) - { - list_free(list->tail); - free(list); - } + if (list) { + list_free(list->tail); + free(list); + } } /* Map FUNCTION over all elements in LIST */ -INLINE void -list_mapcar(LinkedList* list, void(*function)(void*)) +INLINE void list_mapcar(LinkedList *list, void(*function)(void *)) { - while(list) - { - (*function)(list->head); - list = list->tail; - } + while (list) { + (*function)(list->head); + list = list->tail; + } } diff --git a/wmifs/wmgeneral/list.h b/wmifs/wmgeneral/list.h index be101ef..5a6f02a 100644 --- a/wmifs/wmgeneral/list.h +++ b/wmifs/wmgeneral/list.h @@ -36,24 +36,24 @@ Boston, MA 02111-1307, USA. */ #endif typedef struct LinkedList { - void *head; - struct LinkedList *tail; + void *head; + struct LinkedList *tail; } LinkedList; -INLINE LinkedList* list_cons(void* head, LinkedList* tail); +INLINE LinkedList *list_cons(void *head, LinkedList *tail); -INLINE int list_length(LinkedList* list); +INLINE int list_length(LinkedList *list); -INLINE void* list_nth(int index, LinkedList* list); +INLINE void *list_nth(int index, LinkedList *list); -INLINE void list_remove_head(LinkedList** list); +INLINE void list_remove_head(LinkedList **list); -INLINE LinkedList *list_remove_elem(LinkedList* list, void* elem); +INLINE LinkedList *list_remove_elem(LinkedList *list, void *elem); -INLINE void list_mapcar(LinkedList* list, void(*function)(void*)); +INLINE void list_mapcar(LinkedList *list, void(*function)(void *)); -INLINE LinkedList*list_find(LinkedList* list, void* elem); +INLINE LinkedList *list_find(LinkedList *list, void *elem); -INLINE void list_free(LinkedList* list); +INLINE void list_free(LinkedList *list); #endif diff --git a/wmifs/wmgeneral/misc.c b/wmifs/wmgeneral/misc.c index c36cdb4..950d7ac 100644 --- a/wmifs/wmgeneral/misc.c +++ b/wmifs/wmgeneral/misc.c @@ -27,7 +27,7 @@ /* *---------------------------------------------------------------------- * parse_command-- - * Divides a command line into a argv/argc pair. + * Divides a command line into a argv/argc pair. *---------------------------------------------------------------------- */ #define PRC_ALPHA 0 @@ -38,127 +38,124 @@ #define PRC_SQUOTE 5 typedef struct { - short nstate; - short output; + short nstate; + short output; } DFA; static DFA mtable[9][6] = { - {{3,1},{0,0},{4,0},{1,0},{8,0},{6,0}}, - {{1,1},{1,1},{2,0},{3,0},{5,0},{1,1}}, - {{1,1},{1,1},{1,1},{1,1},{5,0},{1,1}}, - {{3,1},{5,0},{4,0},{1,0},{5,0},{6,0}}, - {{3,1},{3,1},{3,1},{3,1},{5,0},{3,1}}, - {{-1,-1},{0,0},{0,0},{0,0},{0,0},{0,0}}, /* final state */ - {{6,1},{6,1},{7,0},{6,1},{5,0},{3,0}}, - {{6,1},{6,1},{6,1},{6,1},{5,0},{6,1}}, - {{-1,-1},{0,0},{0,0},{0,0},{0,0},{0,0}}, /* final state */ + {{3, 1}, {0, 0}, {4, 0}, {1, 0}, {8, 0}, {6, 0} }, + {{1, 1}, {1, 1}, {2, 0}, {3, 0}, {5, 0}, {1, 1} }, + {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {5, 0}, {1, 1} }, + {{3, 1}, {5, 0}, {4, 0}, {1, 0}, {5, 0}, {6, 0} }, + {{3, 1}, {3, 1}, {3, 1}, {3, 1}, {5, 0}, {3, 1} }, + {{-1, -1}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0} }, /* final state */ + {{6, 1}, {6, 1}, {7, 0}, {6, 1}, {5, 0}, {3, 0} }, + {{6, 1}, {6, 1}, {6, 1}, {6, 1}, {5, 0}, {6, 1} }, + {{-1, -1}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0} } /* final state */ }; char* next_token(char *word, char **next) { - char *ptr; - char *ret, *t; - int state, ctype; + char *ptr; + char *ret, *t; + int state, ctype; - t = ret = malloc(strlen(word)+1); - ptr = word; + t = ret = malloc(strlen(word)+1); + ptr = word; - state = 0; - *t = 0; - while (1) { - if (*ptr==0) - ctype = PRC_EOS; - else if (*ptr=='\\') - ctype = PRC_ESCAPE; - else if (*ptr=='"') - ctype = PRC_DQUOTE; - else if (*ptr=='\'') - ctype = PRC_SQUOTE; - else if (*ptr==' ' || *ptr=='\t') - ctype = PRC_BLANK; + state = 0; + *t = 0; + while (1) { + if (*ptr == 0) + ctype = PRC_EOS; + else if (*ptr == '\\') + ctype = PRC_ESCAPE; + else if (*ptr == '"') + ctype = PRC_DQUOTE; + else if (*ptr == '\'') + ctype = PRC_SQUOTE; + else if (*ptr == ' ' || *ptr == '\t') + ctype = PRC_BLANK; + else + ctype = PRC_ALPHA; + + if (mtable[state][ctype].output) { + *t = *ptr; t++; + *t = 0; + } + state = mtable[state][ctype].nstate; + ptr++; + if (mtable[state][0].output < 0) + break; + } + + if (*ret == 0) + t = NULL; else - ctype = PRC_ALPHA; + t = strdup(ret); - if (mtable[state][ctype].output) { - *t = *ptr; t++; - *t = 0; - } - state = mtable[state][ctype].nstate; - ptr++; - if (mtable[state][0].output<0) { - break; - } - } + free(ret); - if (*ret==0) - t = NULL; - else - t = strdup(ret); + if (ctype == PRC_EOS) + *next = NULL; + else + *next = ptr; - free(ret); - - if (ctype==PRC_EOS) - *next = NULL; - else - *next = ptr; - - return t; + return t; } extern void parse_command(char *command, char ***argv, int *argc) { - LinkedList *list = NULL; - char *token, *line; - int count, i; + LinkedList *list = NULL; + char *token, *line; + int count, i; - line = command; - do { - token = next_token(line, &line); - if (token) { - list = list_cons(token, list); + line = command; + do { + token = next_token(line, &line); + if (token) + list = list_cons(token, list); + } while (token != NULL && line != NULL); + + count = list_length(list); + *argv = malloc(sizeof(char *)*count); + i = count; + while (list != NULL) { + (*argv)[--i] = list->head; + list_remove_head(&list); } - } while (token!=NULL && line!=NULL); - - count = list_length(list); - *argv = malloc(sizeof(char*)*count); - i = count; - while (list!=NULL) { - (*argv)[--i] = list->head; - list_remove_head(&list); - } - *argc = count; + *argc = count; } extern pid_t execCommand(char *command) { - pid_t pid; - char **argv; - int argc; + pid_t pid; + char **argv; + int argc; - parse_command(command, &argv, &argc); + parse_command(command, &argv, &argc); - if (argv==NULL) { - return 0; - } + if (argv == NULL) + return 0; - if ((pid=fork())==0) { - char **args; - int i; + pid = fork(); + if (pid == 0) { + char **args; + int i; - args = malloc(sizeof(char*)*(argc+1)); - if (!args) - exit(10); - for (i=0; i= 0 && keys[key].label) { - if ((p = strstr(temp, keys[key].label))) { + p = strstr(temp, keys[key].label); + if (p) { p += strlen(keys[key].label); p += strspn(p, tokens); - if ((i = strcspn(p, "#\n"))) p[i] = 0; + i = strcspn(p, "#\n"); + if (i) + p[i] = 0; free(*keys[key].var); *keys[key].var = strdup(p); key = -1; - } else key++; + } else + key++; } } fclose(fp); @@ -112,7 +117,8 @@ void parse_rcfile(const char *filename, rckeys *keys) { |* GetXPM *| \*******************************************************************************/ -static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) { +static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) +{ XWindowAttributes attributes; int err; @@ -135,7 +141,8 @@ static void GetXPM(XpmIcon *wmgen, char *pixmap_bytes[]) { |* GetColor *| \*******************************************************************************/ -static Pixel GetColor(char *name) { +static Pixel GetColor(char *name) +{ XColor color; XWindowAttributes attributes; @@ -143,11 +150,10 @@ static Pixel GetColor(char *name) { XGetWindowAttributes(display, Root, &attributes); color.pixel = 0; - if (!XParseColor(display, attributes.colormap, name, &color)) { + if (!XParseColor(display, attributes.colormap, name, &color)) fprintf(stderr, "wm.app: can't parse %s.\n", name); - } else if (!XAllocColor(display, attributes.colormap, &color)) { + else if (!XAllocColor(display, attributes.colormap, &color)) fprintf(stderr, "wm.app: can't allocate %s.\n", name); - } return color.pixel; } @@ -155,10 +161,11 @@ static Pixel GetColor(char *name) { |* flush_expose *| \*******************************************************************************/ -static int flush_expose(Window w) { +static int flush_expose(Window w) +{ - XEvent dummy; - int i=0; + XEvent dummy; + int i = 0; while (XCheckTypedWindowEvent(display, w, Expose, &dummy)) i++; @@ -170,35 +177,38 @@ static int flush_expose(Window w) { |* RedrawWindow *| \*******************************************************************************/ -void RedrawWindow(void) { +void RedrawWindow(void) +{ flush_expose(iconwin); XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, - 0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0); + 0, 0, wmgen.attributes.width, wmgen.attributes.height, 0, 0); flush_expose(win); XCopyArea(display, wmgen.pixmap, win, NormalGC, - 0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0); + 0, 0, wmgen.attributes.width, wmgen.attributes.height, 0, 0); } /*******************************************************************************\ |* RedrawWindowXY *| \*******************************************************************************/ -void RedrawWindowXY(int x, int y) { +void RedrawWindowXY(int x, int y) +{ flush_expose(iconwin); XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, - x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0); + x, y, wmgen.attributes.width, wmgen.attributes.height, 0, 0); flush_expose(win); XCopyArea(display, wmgen.pixmap, win, NormalGC, - x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0); + x, y, wmgen.attributes.width, wmgen.attributes.height, 0, 0); } /*******************************************************************************\ |* AddMouseRegion *| \*******************************************************************************/ -void AddMouseRegion(int index, int left, int top, int right, int bottom) { +void AddMouseRegion(int index, int left, int top, int right, int bottom) +{ if (index < MAX_MOUSE_REGION) { mouse_region[index].enable = 1; @@ -213,14 +223,15 @@ void AddMouseRegion(int index, int left, int top, int right, int bottom) { |* CheckMouseRegion *| \*******************************************************************************/ -int CheckMouseRegion(int x, int y) { +int CheckMouseRegion(int x, int y) +{ int i; int found; found = 0; - for (i=0; i= mouse_region[i].left && @@ -228,7 +239,8 @@ int CheckMouseRegion(int x, int y) { y >= mouse_region[i].top) found = 1; } - if (!found) return -1; + if (!found) + return -1; return (i-1); } @@ -236,7 +248,8 @@ int CheckMouseRegion(int x, int y) { |* copyXPMArea *| \*******************************************************************************/ -void copyXPMArea(int x, int y, int sx, int sy, int dx, int dy) { +void copyXPMArea(int x, int y, int sx, int sy, int dx, int dy) +{ XCopyArea(display, wmgen.pixmap, wmgen.pixmap, NormalGC, x, y, sx, sy, dx, dy); @@ -246,7 +259,8 @@ void copyXPMArea(int x, int y, int sx, int sy, int dx, int dy) { |* copyXBMArea *| \*******************************************************************************/ -void copyXBMArea(int x, int y, int sx, int sy, int dx, int dy) { +void copyXBMArea(int x, int y, int sx, int sy, int dx, int dy) +{ XCopyArea(display, wmgen.mask, wmgen.pixmap, NormalGC, x, y, sx, sy, dx, dy); } @@ -256,7 +270,8 @@ void copyXBMArea(int x, int y, int sx, int sy, int dx, int dy) { |* setMaskXY *| \*******************************************************************************/ -void setMaskXY(int x, int y) { +void setMaskXY(int x, int y) +{ XShapeCombineMask(display, win, ShapeBounding, x, y, pixmask, ShapeSet); XShapeCombineMask(display, iconwin, ShapeBounding, x, y, pixmask, ShapeSet); @@ -265,7 +280,9 @@ void setMaskXY(int x, int y) { /*******************************************************************************\ |* openXwindow *| \*******************************************************************************/ -void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bits, int pixmask_width, int pixmask_height) { +void openXwindow(int argc, char *argv[], char *pixmap_bytes[], + char *pixmask_bits, int pixmask_width, int pixmask_height) +{ unsigned int borderwidth = 1; XClassHint classHint; @@ -277,15 +294,16 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit unsigned long gcm; - int dummy=0; + int dummy = 0; int i; - for (i=1; argv[i]; i++) { + for (i = 1; argv[i]; i++) { if (!strcmp(argv[i], "-display")) display_name = argv[i+1]; } - if (!(display = XOpenDisplay(display_name))) { + display = XOpenDisplay(display_name); + if (!display) { fprintf(stderr, "%s: can't open display %s\n", wname, XDisplayName(display_name)); exit(1); @@ -307,7 +325,7 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit fore_pix = GetColor("black"); XWMGeometry(display, screen, Geometry, NULL, borderwidth, &mysizehints, - &mysizehints.x, &mysizehints.y,&mysizehints.width,&mysizehints.height, &dummy); + &mysizehints.x, &mysizehints.y, &mysizehints.width, &mysizehints.height, &dummy); mysizehints.width = 64; mysizehints.height = 64; @@ -324,8 +342,10 @@ void openXwindow(int argc, char *argv[], char *pixmap_bytes[], char *pixmask_bit classHint.res_class = wname; XSetClassHint(display, win, &classHint); - XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask); - XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask); + XSelectInput(display, win, + ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask); + XSelectInput(display, iconwin, + ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask); if (XStringListToTextProperty(&wname, 1, &name) == 0) { fprintf(stderr, "%s: can't allocate window name\n", wname); diff --git a/wmifs/wmifs/wmifs.c b/wmifs/wmifs/wmifs.c index cf7ee4d..a0abaff 100644 --- a/wmifs/wmifs/wmifs.c +++ b/wmifs/wmifs/wmifs.c @@ -249,9 +249,9 @@ extern char **environ; /********************/ char *active_interface = NULL; -int TimerDivisor=60; -int WaveForm=0; -int LockMode=0; +int TimerDivisor = 60; +int WaveForm = 0; +int LockMode = 0; int SampleInt = DEFAULT_SAMPLE_INTERVAL; int ScrollSpeed = CHECK_INTERFACE_INTERVAL; @@ -259,7 +259,7 @@ int ScrollSpeed = CHECK_INTERFACE_INTERVAL; /* PPP variables */ /*****************/ -#define PPP_UNIT 0 +#define PPP_UNIT 0 int ppp_h = -1; #define PPP_STATS_HIS 54 @@ -290,44 +290,45 @@ void get_ppp_stats(struct ppp_stats *cur); /* Main */ /********/ -int main(int argc, char *argv[]) { +int main(int argc, char *argv[]) +{ int i; /* Parse Command Line */ - for (i=1; i= nexttime) { - nexttime=curtime+ScrollSpeed; + nexttime = curtime + ScrollSpeed; DrawStats(&stat_devices[stat_current].his[0][0], 54, 40, 5, 58); - for (i=0; i= 0) { switch (but_stat) { - case 0 : + case 0: /* re-read the table */ strcpy(temp, stat_devices[stat_current].name); stat_online = checknetdevs(); stat_current = 0; - for (i=0; i 5) - { - for (i=len-5; i='0' && name[i]<='9'); i++) ; - for (; i<=len; i++) /* '=' to get the '\0' character moved too \*/ + if (len > 5) { + for (i = len-5; i < len && !(name[i] >= '0' && name[i] <= '9'); i++) + ; + for (; i <= len; i++) /* '=' to get the '\0' character moved too \*/ name[i-(len-5)] = name[i]; } k = 5; - for (i=0; name[i]; i++) { - if (i == strlen(name)-1 && strlen(name) <= 4 && name[strlen(name)-1] >= '0' && name[strlen(name)-1] <= '9') { + for (i = 0; name[i]; i++) { + if (i == strlen(name)-1 && strlen(name) <= 4 && name[strlen(name)-1] >= '0' && + name[strlen(name)-1] <= '9') { copyXPMArea(61, 64, 4, 9, k, 5); - k+=4; + k += 4; } c = toupper(name[i]); if (c >= 'A' && c <= 'Z') { @@ -619,7 +625,8 @@ void DrawActiveIFS(char *real_name) { |* get_statistics *| \*******************************************************************************/ -int get_statistics(char *devname, long *ip, long *op, long *is, long *os) { +int get_statistics(char *devname, long *ip, long *op, long *is, long *os) +{ FILE *fp; char temp[BUFFER_SIZE]; @@ -629,14 +636,15 @@ int get_statistics(char *devname, long *ip, long *op, long *is, long *os) { int i; int found; struct ppp_stats ppp_cur, ppp_old; - static int ppp_opened = 0; + static int ppp_opened; if (!strncmp(devname, "ppp", 3)) { if (!ppp_opened) { /* Open the ppp device. */ memset(&ppp_cur, 0, sizeof(ppp_cur)); - if ((ppp_h = socket(AF_INET, SOCK_DGRAM, 0)) < 0) + ppp_h = socket(AF_INET, SOCK_DGRAM, 0); + if (ppp_h < 0) return -1; get_ppp_stats(&ppp_cur); ppp_old = ppp_cur; @@ -667,8 +675,10 @@ int get_statistics(char *devname, long *ip, long *op, long *is, long *os) { p = strtok(temp, tokens); do { if (!(strcmp(p, "packets"))) { - if (input == -1) input = i; - else output = i; + if (input == -1) + input = i; + else + output = i; } i++; p = strtok(NULL, tokens); @@ -702,7 +712,8 @@ int get_statistics(char *devname, long *ip, long *op, long *is, long *os) { |* stillonline *| \*******************************************************************************/ -int stillonline(char *ifs) { +int stillonline(char *ifs) +{ FILE *fp; char temp[BUFFER_SIZE]; @@ -726,20 +737,20 @@ int stillonline(char *ifs) { |* checknetdevs *| \*******************************************************************************/ -int checknetdevs(void) { +int checknetdevs(void) +{ FILE *fd; char temp[BUFFER_SIZE]; char *p; - int i=0,j; + int i = 0, j; int k; - int devsfound=0; + int devsfound = 0; char *tokens = " :\t\n"; char foundbuffer[MAX_STAT_DEVICES][8]; - for (i=0; i pixels_per_byte) pixels_per_byte = p[0] + p[1]; p += 2; @@ -855,7 +867,7 @@ void DrawStats(int *his, int num, int size, int x_left, int y_bottom) { pixels_per_byte /= size; p = his; - for (k=0; k\n"); fprintf(stderr, "\t-h\tthis help screen\n"); @@ -913,7 +926,8 @@ void usage(void) { |* printversion *| \*******************************************************************************/ -void printversion(void) { +void printversion(void) +{ fprintf(stderr, "%s\n", WMIFS_VERSION); } @@ -922,7 +936,8 @@ void printversion(void) { |* get_ppp_stats *| \*******************************************************************************/ -void get_ppp_stats(struct ppp_stats *cur) { +void get_ppp_stats(struct ppp_stats *cur) +{ struct ifpppstatsreq req; @@ -932,9 +947,8 @@ void get_ppp_stats(struct ppp_stats *cur) { sprintf(req.ifr__name, "ppp%d", PPP_UNIT); - if (ioctl(ppp_h, SIOCGPPPSTATS, &req) < 0) { -/* fprintf(stderr, "heyho!\n"); */ - } + if (ioctl(ppp_h, SIOCGPPPSTATS, &req) < 0) + /* fprintf(stderr, "heyho!\n") */; *cur = req.stats; } @@ -963,9 +977,10 @@ void get_ppp_stats(struct ppp_stats *cur) { #define LED_SW_Y (14) /*******************************************************************************\ -|* SetOnLED *| +|* SetOnLED *| \*******************************************************************************/ -void SetOnLED(int led) { +void SetOnLED(int led) +{ switch (led) { @@ -982,9 +997,10 @@ void SetOnLED(int led) { } /*******************************************************************************\ -|* SetOffLED *| +|* SetOffLED *| \*******************************************************************************/ -void SetOffLED(int led) { +void SetOffLED(int led) +{ switch (led) { @@ -1001,9 +1017,10 @@ void SetOffLED(int led) { } /*******************************************************************************\ -|* SetErrLED *| +|* SetErrLED *| \*******************************************************************************/ -void SetErrLED(int led) { +void SetErrLED(int led) +{ switch (led) { case LED_NET_POWER: