diff --git a/modules/FvwmBacker/FvwmBacker.c b/modules/FvwmBacker/FvwmBacker.c index 4e003f6ba..8367355a3 100644 --- a/modules/FvwmBacker/FvwmBacker.c +++ b/modules/FvwmBacker/FvwmBacker.c @@ -146,9 +146,9 @@ int main(int argc, char **argv) if ((argc != 6) && (argc != 7)) { - fvwm_debug(__func__, - "%s Version %s should only be executed by fvwm!\n", - Module, VERSION); + fprintf(stderr, + "%s Version %s should only be executed by fvwm!\n", + Module, VERSION); exit(1); } @@ -160,7 +160,7 @@ int main(int argc, char **argv) dpy = XOpenDisplay(displayName); if (!dpy) { - fvwm_debug(__func__, "%s: unable to open display '%s'\n", + fprintf(stderr, "%s: unable to open display '%s'\n", Module, XDisplayName (displayName)); exit (2); } @@ -302,8 +302,9 @@ void SetDeskPageBackground(const Command *c) dpy2 = XOpenDisplay(displayName); if (!dpy2) { - fvwm_debug(__func__, - "Fail to create a forking dpy, Exit!"); + fvwm_debug(Module, + "%s: Fail to create a forking dpy, Exit!", + __func__); exit(2); } screen2 = DefaultScreen(dpy2); @@ -321,19 +322,19 @@ void SetDeskPageBackground(const Command *c) /* Process a colorset */ if (CSET_IS_TRANSPARENT(c->colorset)) { - fvwm_debug(__func__, "You cannot " + fvwm_debug(Module, "%s: You cannot " "use a transparent colorset as " - "background!"); + "background!", __func__); XUngrabServer(dpy2); XCloseDisplay(dpy2); return; } else if (Pdepth != DefaultDepth(dpy2, screen2)) { - fvwm_debug(__func__, "You cannot " + fvwm_debug(Module, "%s: You cannot " "use a colorset background if\n" "the fvwm depth is not equal " - "to the root depth!"); + "to the root depth!", __func__); XUngrabServer(dpy2); XCloseDisplay(dpy2); return; @@ -527,10 +528,12 @@ int ParseConfigLine(char *line) { AddCommand(line + cpl); } - } - else if (strncasecmp(line, "colorset", 8) == 0) - { + } else if (strncasecmp(line, "colorset", 8) == 0) { return LoadColorset(line + 8); + } else if (strncasecmp(line, "LoggingFD", 9) == 0) { + int fd = -1; + sscanf((line + 10), "%d", &fd); + log_set_fd(fd); } } return -1; @@ -585,8 +588,9 @@ Bool ParseNewCommand( { if (GetNextToken(option_val, &value) == NULL) { - fvwm_debug(__func__, - "Desk option requires a value"); + fvwm_debug(Module, + "%s: Desk option requires a value", + __func__); return 1; } if (!StrEquals(value, "*")) @@ -602,8 +606,9 @@ Bool ParseNewCommand( if ((option_val = GetNextToken( option_val,&value)) == NULL) { - fvwm_debug(__func__, - "Page option requires 2 values"); + fvwm_debug(Module, + "%s: Page option requires 2 values", + __func__); return 1; } if (!StrEquals(value, "*")) @@ -611,8 +616,9 @@ Bool ParseNewCommand( free(value); if (GetNextToken(option_val, &value) == NULL) { - fvwm_debug(__func__, - "Desk option requires 2 values"); + fvwm_debug(Module, + "%s: Desk option requires 2 values", + __func__); return 1; } if (!StrEquals(value, "*")) @@ -679,8 +685,9 @@ void AddCommand(char *line) line, &parens, ")", NULL, NULL, NULL); if (line == NULL) { - fvwm_debug(__func__, - "Syntax error: no closing brace"); + fvwm_debug(Module, + "%s: Syntax error: no closing brace", + __func__); free(this); return; } @@ -697,7 +704,7 @@ void AddCommand(char *line) } else { - fvwm_debug(__func__, "Unknown directive: %s", line); + fvwm_debug(Module, "%s: Unknown directive: %s", __func__, line); return; } this->flags.do_ignore_desk = do_ignore_desk; diff --git a/modules/FvwmBacker/root_bits.c b/modules/FvwmBacker/root_bits.c index a67ad4d3a..1f77e50dc 100644 --- a/modules/FvwmBacker/root_bits.c +++ b/modules/FvwmBacker/root_bits.c @@ -29,13 +29,13 @@ unsigned long BackerGetColor(char *name) color.pixel = 0; if (!XParseColor (dpy, DefaultColormap(dpy,screen), name, &color)) { - fvwm_debug(__func__, "%s: unknown color \"%s\"\n",Module,name); + fvwm_debug(Module, "%s: unknown color \"%s\"\n",__func__,name); exit(1); } else if(!XAllocColor (dpy, DefaultColormap(dpy,screen), &color)) { - fvwm_debug(__func__, "%s: unable to allocate color for \"%s\"\n", - Module, name); + fvwm_debug(Module, "%s: unable to allocate color for \"%s\"\n", + __func__, name); exit(1); } diff --git a/modules/FvwmButtons/FvwmButtons.c b/modules/FvwmButtons/FvwmButtons.c index 8be16df41..ef4905127 100644 --- a/modules/FvwmButtons/FvwmButtons.c +++ b/modules/FvwmButtons/FvwmButtons.c @@ -255,9 +255,9 @@ static void DeadPipeCleanup(void) if ((buttonSwallowCount(b) == 3) && swin) { #ifdef DEBUG_HANGON - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Button 0x%06x window 0x%x (\"%s\") is ", - MyName, (ushort)b, (ushort)swin, b->hangon); + __func__, (ushort)b, (ushort)swin, b->hangon); #endif if (!IsThereADestroyEvent(b)) { /* Has someone destroyed it? */ @@ -267,7 +267,7 @@ static void DeadPipeCleanup(void) { XKillClient(Dpy, swin); #ifdef DEBUG_HANGON - fvwm_debug(__func__, + fvwm_debug(MyName, "now killed\n"); #endif } @@ -278,7 +278,7 @@ static void DeadPipeCleanup(void) _XA_WM_DEL_WIN, CurrentTime); #ifdef DEBUG_HANGON - fvwm_debug(__func__, + fvwm_debug(MyName, "now deleted\n"); #endif } @@ -286,7 +286,7 @@ static void DeadPipeCleanup(void) else { #ifdef DEBUG_HANGON - fvwm_debug(__func__, + fvwm_debug(MyName, "now unswallowed\n"); #endif if (b->swallow & b_FvwmModule) @@ -314,7 +314,7 @@ static void DeadPipeCleanup(void) #ifdef DEBUG_HANGON else { - fvwm_debug(__func__, "already handled\n"); + fvwm_debug(MyName, "already handled\n"); } #endif } @@ -358,16 +358,16 @@ void SetButtonSize(button_info *ub, int w, int h) if (!ub || !(ub->flags.b_Container)) { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: BUG: Tried to set size of noncontainer\n", - MyName); + __func__); exit(2); } if (ub->c->num_rows == 0 || ub->c->num_columns == 0) { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: BUG: Set size when rows/cols was unset\n", - MyName); + __func__); exit(2); } @@ -412,8 +412,8 @@ void AddButtonAction(button_info *b, int n, char *action) if (!b || n < 0 || n > NUMBER_OF_EXTENDED_MOUSE_BUTTONS || !action) { - fvwm_debug(__func__, "%s: BUG: AddButtonAction failed\n", - MyName); + fvwm_debug(MyName, "%s: BUG: AddButtonAction failed\n", + __func__); exit(2); } if (b->flags.b_Action) @@ -623,9 +623,9 @@ int main(int argc, char **argv) if (argc<6 || argc>10) { - fvwm_debug(__func__, - "%s version %s should only be executed by fvwm!\n", - MyName, VERSION); + fprintf(stderr, + "%s version %s should only be executed by fvwm!\n", + MyName, VERSION); exit(1); } @@ -676,8 +676,8 @@ int main(int argc, char **argv) fd[1] = atoi(argv[2]); if (!(Dpy = XOpenDisplay(NULL))) { - fvwm_debug(__func__, - "%s: Can't open display %s", MyName, + fvwm_debug(MyName, + "%s: Can't open display %s", __func__, XDisplayName(NULL)); exit (1); } @@ -690,7 +690,7 @@ int main(int argc, char **argv) Root = RootWindow(Dpy, screen); if (Root == None) { - fvwm_debug(__func__, "%s: Screen %d is not valid\n", MyName, + fvwm_debug(MyName, "%s: Screen %d is not valid\n", __func__, screen); exit(1); } @@ -707,7 +707,7 @@ int main(int argc, char **argv) dph = DisplayHeight(Dpy, screen); #ifdef DEBUG_INIT - fvwm_debug(__func__, "%s: Parsing...", MyName); + fvwm_debug(MyName, "%s: Parsing...", __func__); #endif UberButton->title = MyName; @@ -728,10 +728,10 @@ int main(int argc, char **argv) { if (b->flags.b_ActiveIcon || b->flags.b_ActiveTitle) { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Must specify ActiveColorset when " "using ActiveIcon or ActiveTitle with " - "\"Pixmap none\".\n", MyName); + "\"Pixmap none\".\n", __func__); exit(0); } } @@ -748,20 +748,20 @@ int main(int argc, char **argv) /* Don't quit if only a subpanel is empty */ if (UberButton->c->num_buttons == 0) { - fvwm_debug(__func__, "%s: No buttons defined. Quitting\n", - MyName); + fvwm_debug(MyName, "%s: No buttons defined. Quitting\n", + __func__); exit(0); } #ifdef DEBUG_INIT - fvwm_debug(__func__, "OK\n%s: Shuffling...", MyName); + fvwm_debug(MyName, "OK\n%s: Shuffling...", __func__); #endif ShuffleButtons(UberButton); NumberButtons(UberButton); #ifdef DEBUG_INIT - fvwm_debug(__func__, "OK\n%s: Creating Main Window ...", MyName); + fvwm_debug(MyName, "OK\n%s: Creating Main Window ...", __func__); #endif xswa.colormap = Pcmap; @@ -772,7 +772,7 @@ int main(int argc, char **argv) CWColormap | CWBackPixmap | CWBorderPixel, &xswa); #ifdef DEBUG_INIT - fvwm_debug(__func__, "OK\n%s: Loading data...\n", MyName); + fvwm_debug(MyName, "OK\n%s: Loading data...\n", __func__); #endif /* Load fonts and icons, calculate max buttonsize */ @@ -789,7 +789,7 @@ int main(int argc, char **argv) } #ifdef DEBUG_INIT - fvwm_debug(__func__, "%s: Configuring main window...", MyName); + fvwm_debug(MyName, "%s: Configuring main window...", __func__); #endif CreateUberButtonWindow(UberButton, maxx, maxy); @@ -798,8 +798,8 @@ int main(int argc, char **argv) Dpy, MyWindow, &root, &x, &y, (unsigned int *)&Width, (unsigned int *)&Height, (unsigned int *)&border_width, &depth)) { - fvwm_debug(__func__, "%s: Failed to get window geometry\n", - MyName); + fvwm_debug(MyName, "%s: Failed to get window geometry\n", + __func__); exit(0); } SetButtonSize(UberButton, Width, Height); @@ -822,7 +822,7 @@ int main(int argc, char **argv) } #ifdef DEBUG_INIT - fvwm_debug(__func__, "OK\n%s: Mapping windows...", MyName); + fvwm_debug(MyName, "OK\n%s: Mapping windows...", __func__); #endif XMapSubwindows(Dpy, MyWindow); @@ -845,7 +845,7 @@ int main(int argc, char **argv) } #ifdef DEBUG_INIT - fvwm_debug(__func__, "OK\n%s: Startup complete\n", MyName); + fvwm_debug(MyName, "OK\n%s: Startup complete\n", __func__); #endif /* @@ -1440,9 +1440,9 @@ void Loop(void) if ((buttonSwallowCount(b) == 3) && Event.xdestroywindow.window == swin) { #ifdef DEBUG_HANGON - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Button 0x%06x lost its window 0x%x (\"%s\")", - MyName, (ushort)b, (ushort)swin, b->hangon); + __func__, (ushort)b, (ushort)swin, b->hangon); #endif b->swallow &= ~b_Count; if (b->flags.b_Panel) @@ -1454,7 +1454,7 @@ void Loop(void) char *p; #ifdef DEBUG_HANGON - fvwm_debug(__func__, ", respawning\n"); + fvwm_debug(MyName, ", respawning\n"); #endif if (b->newflags.is_panel && is_transient) { @@ -1491,7 +1491,7 @@ void Loop(void) !b->newflags.is_panel) { #ifdef DEBUG_HANGON - fvwm_debug(__func__, ", waiting for respawned window\n"); + fvwm_debug(MyName, ", waiting for respawned window\n"); #endif b->swallow |= 1; b->flags.b_Swallow = 1; @@ -1508,7 +1508,7 @@ void Loop(void) b->flags.b_Panel = 0; RedrawButton(b, DRAW_FORCE, NULL); #ifdef DEBUG_HANGON - fvwm_debug(__func__, "\n"); + fvwm_debug(MyName, "\n"); #endif } break; @@ -1520,9 +1520,9 @@ void Loop(void) default: #ifdef DEBUG_EVENTS - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Event fell through unhandled\n", - MyName); + __func__); #endif break; } /* switch */ @@ -1607,7 +1607,7 @@ void RecursiveLoadData(button_info *b, int *maxx, int *maxy) return; #ifdef DEBUG_LOADDATA - fvwm_debug(__func__, "%s: Loading: Button 0x%06x: colors", MyName, + fvwm_debug(MyName, "%s: Loading: Button 0x%06x: colors", __func__, (ushort)b); #endif @@ -1686,7 +1686,7 @@ void RecursiveLoadData(button_info *b, int *maxx, int *maxy) { b->c->colorset = -1; #ifdef DEBUG_LOADDATA - fvwm_debug(__func__, ", colors2"); + fvwm_debug(MyName, ", colors2"); #endif if (b->c->flags.b_Fore) b->c->fc = GetColor(b->c->fore); @@ -1710,7 +1710,7 @@ void RecursiveLoadData(button_info *b, int *maxx, int *maxy) if (b->flags.b_Font) { #ifdef DEBUG_LOADDATA - fvwm_debug(__func__, ", font \"%s\"", b->font_string); + fvwm_debug(MyName, ", font \"%s\"", b->font_string); #endif if (strncasecmp(b->font_string, "none", 4) == 0) @@ -1726,7 +1726,7 @@ void RecursiveLoadData(button_info *b, int *maxx, int *maxy) if (b->flags.b_Container && b->c->flags.b_Font) { #ifdef DEBUG_LOADDATA - fvwm_debug(__func__, ", font2 \"%s\"", b->c->font_string); + fvwm_debug(MyName, ", font2 \"%s\"", b->c->font_string); #endif if (strncasecmp(b->c->font_string, "none", 4) == 0) { @@ -1742,7 +1742,7 @@ void RecursiveLoadData(button_info *b, int *maxx, int *maxy) if (b->flags.b_Container && b->c->num_buttons) { #ifdef DEBUG_LOADDATA - fvwm_debug(__func__, ", entering container\n"); + fvwm_debug(MyName, ", entering container\n"); #endif for (i = 0; i < b->c->num_buttons; i++) if (b->c->buttons[i]) @@ -1754,7 +1754,7 @@ void RecursiveLoadData(button_info *b, int *maxx, int *maxy) y = b->c->miny; } #ifdef DEBUG_LOADDATA - fvwm_debug(__func__, "%s: Loading: Back to container 0x%06x", MyName, + fvwm_debug(MyName, "%s: Loading: Back to container 0x%06x", __func__, (ushort)b); #endif @@ -1781,7 +1781,7 @@ void RecursiveLoadData(button_info *b, int *maxx, int *maxy) LoadIconFile(b->icon_file, &b->icon, buttonColorset(b))) { #ifdef DEBUG_LOADDATA - fvwm_debug(__func__, ", icon \"%s\"", b->icon_file); + fvwm_debug(MyName, ", icon \"%s\"", b->icon_file); #endif ix = b->icon->width; iy = b->icon->height; @@ -1794,7 +1794,7 @@ void RecursiveLoadData(button_info *b, int *maxx, int *maxy) LoadIconFile(b->active_icon_file, &b->activeicon, buttonColorset(b))) { #ifdef DEBUG_LOADDATA - fvwm_debug(__func__, ", active icon \"%s\"", b->active_icon_file); + fvwm_debug(MyName, ", active icon \"%s\"", b->active_icon_file); #endif hix = b->activeicon->width; @@ -1812,7 +1812,7 @@ void RecursiveLoadData(button_info *b, int *maxx, int *maxy) LoadIconFile(b->press_icon_file, &b->pressicon, buttonColorset(b))) { #ifdef DEBUG_LOADDATA - fvwm_debug(__func__, ", press icon \"%s\"", b->press_icon_file); + fvwm_debug(MyName, ", press icon \"%s\"", b->press_icon_file); #endif pix = b->pressicon->width; @@ -1829,7 +1829,7 @@ void RecursiveLoadData(button_info *b, int *maxx, int *maxy) if (b->flags.b_Title && (Ffont = buttonFont(b))) { #ifdef DEBUG_LOADDATA - fvwm_debug(__func__, ", title \"%s\"", b->title); + fvwm_debug(MyName, ", title \"%s\"", b->title); #endif if (buttonJustify(b)&b_Horizontal) { @@ -1847,7 +1847,7 @@ void RecursiveLoadData(button_info *b, int *maxx, int *maxy) if (b->flags.b_ActiveTitle && (Ffont = buttonFont(b))) { #ifdef DEBUG_LOADDATA - fvwm_debug(__func__, ", title \"%s\"", b->title); + fvwm_debug(MyName, ", title \"%s\"", b->title); #endif if (buttonJustify(b) & b_Horizontal) { @@ -1871,7 +1871,7 @@ void RecursiveLoadData(button_info *b, int *maxx, int *maxy) if (b->flags.b_PressTitle && (Ffont = buttonFont(b))) { #ifdef DEBUG_LOADDATA - fvwm_debug(__func__, ", title \"%s\"", b->title); + fvwm_debug(MyName, ", title \"%s\"", b->title); #endif if (buttonJustify(b) & b_Horizontal) { @@ -1909,7 +1909,7 @@ void RecursiveLoadData(button_info *b, int *maxx, int *maxy) *maxx = max(x, *maxx); *maxy = max(y, *maxy); #ifdef DEBUG_LOADDATA - fvwm_debug(__func__, ", size %ux%u, done\n", x, y); + fvwm_debug(MyName, ", size %ux%u, done\n", x, y); #endif } @@ -2117,13 +2117,13 @@ void CreateUberButtonWindow(button_info *ub, int maxx, int maxy) } #ifdef DEBUG_INIT - fvwm_debug(__func__, "making atoms..."); + fvwm_debug(MyName, "making atoms..."); #endif _XA_WM_DEL_WIN = XInternAtom(Dpy, "WM_DELETE_WINDOW", 0); #ifdef DEBUG_INIT - fvwm_debug(__func__, "sizing..."); + fvwm_debug(MyName, "sizing..."); #endif mysizehints.flags = PWinGravity | PBaseSize; @@ -2135,7 +2135,7 @@ void CreateUberButtonWindow(button_info *ub, int maxx, int maxy) if (w>-1) /* from geometry */ { #ifdef DEBUG_INIT - fvwm_debug(__func__, "constraining (w=%i)...", w); + fvwm_debug(MyName, "constraining (w=%i)...", w); #endif ConstrainSize(&mysizehints, &w, &h); mysizehints.width = w; @@ -2144,7 +2144,7 @@ void CreateUberButtonWindow(button_info *ub, int maxx, int maxy) } #ifdef DEBUG_INIT - fvwm_debug(__func__, "gravity..."); + fvwm_debug(MyName, "gravity..."); #endif wx = 0; wy = 0; @@ -2183,14 +2183,14 @@ void CreateUberButtonWindow(button_info *ub, int maxx, int maxy) #ifdef DEBUG_INIT if (mysizehints.flags&USPosition) { - fvwm_debug(__func__, + fvwm_debug(MyName, "create(%i,%i,%u,%u,1,%u,%u)...", wx, wy, mysizehints.width, mysizehints.height, (ushort)fore_pix, (ushort)back_pix); } else { - fvwm_debug(__func__, + fvwm_debug(MyName, "create(-,-,%u,%u,1,%u,%u)...", mysizehints.width, mysizehints.height, (ushort)fore_pix, (ushort)back_pix); @@ -2208,7 +2208,7 @@ void CreateUberButtonWindow(button_info *ub, int maxx, int maxy) } #ifdef DEBUG_INIT - fvwm_debug(__func__, "colors..."); + fvwm_debug(MyName, "colors..."); #endif if (Pdepth < 2) { @@ -2227,7 +2227,7 @@ void CreateUberButtonWindow(button_info *ub, int maxx, int maxy) #ifdef DEBUG_INIT - fvwm_debug(__func__, "properties..."); + fvwm_debug(MyName, "properties..."); #endif XSetWMProtocols(Dpy, MyWindow, &_XA_WM_DEL_WIN, 1); @@ -2240,9 +2240,9 @@ void CreateUberButtonWindow(button_info *ub, int maxx, int maxy) list[0] = MyName; if (!XStringListToTextProperty(list, 1, &mynametext)) { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Failed to convert name to XText\n", - MyName); + __func__); exit(1); } XSetWMProperties( @@ -2254,7 +2254,7 @@ void CreateUberButtonWindow(button_info *ub, int maxx, int maxy) XSelectInput(Dpy, MyWindow, MW_EVENTS); #ifdef DEBUG_INIT - fvwm_debug(__func__, "GC..."); + fvwm_debug(MyName, "GC..."); #endif gcm = GCForeground|GCBackground; gcv.foreground = fore_pix; @@ -2332,8 +2332,8 @@ void DebugEvents(XEvent *event) "ClientMessage", "MappingNotify" }; - fvwm_debug(__func__, "%s: Received %s event from window 0x%x\n", - MyName, event_names[event->type], + fvwm_debug(MyName, "%s: Received %s event from window 0x%x\n", + __func__, event_names[event->type], (ushort)event->xany.window); } #endif @@ -2445,10 +2445,10 @@ void SpawnSome(void) if (b->spawn) { #ifdef DEBUG_HANGON - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Button 0x%06x did not find a " "\"%s\" window, %s", - MyName, (ushort)b, b->hangon, + __func__, (ushort)b, b->hangon, "spawning own\n"); #endif p = module_expand_action( @@ -2863,9 +2863,9 @@ void CheckForHangon(unsigned long *body) &b->bw, &d); #ifdef DEBUG_HANGON - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Button 0x%06x %s 0x%lx \"%s\", " - "parent 0x%lx\n", MyName, + "parent 0x%lx\n", __func__, (ushort)b, "will swallow window", body[0], cbody, diff --git a/modules/FvwmButtons/button.c b/modules/FvwmButtons/button.c index 051c96467..6fe17b815 100644 --- a/modules/FvwmButtons/button.c +++ b/modules/FvwmButtons/button.c @@ -152,7 +152,7 @@ int buttonFrameSigned(button_info *b) if(b->c->flags.b_Frame) return b->c->framew; #ifdef DEBUG - fvwm_debug(__func__, "%s: BUG: No relief width definition?\n",MyName); + fvwm_debug(MyName, "%s: BUG: No relief width definition?\n", __func__); #endif return 0; } @@ -171,7 +171,7 @@ int buttonXPad(button_info *b) if(b->c->flags.b_Padding) return b->c->xpad; #ifdef DEBUG - fvwm_debug(__func__, "%s: BUG: No padding definition?\n",MyName); + fvwm_debug(MyName, "%s: BUG: No padding definition?\n", __func__); #endif return 0; } @@ -190,7 +190,7 @@ int buttonYPad(button_info *b) if(b->c->flags.b_Padding) return b->c->ypad; #ifdef DEBUG - fvwm_debug(__func__, "%s: BUG: No padding definition?\n",MyName); + fvwm_debug(MyName, "%s: BUG: No padding definition?\n", __func__); #endif return 0; } @@ -207,7 +207,7 @@ FlocaleFont *buttonFont(button_info *b) if(b->c->flags.b_Font) return b->c->Ffont; #ifdef DEBUG - fvwm_debug(__func__, "%s: BUG: No font definition?\n",MyName); + fvwm_debug(MyName, "%s: BUG: No font definition?\n", __func__); #endif return None; } @@ -226,7 +226,7 @@ Pixel buttonFore(const button_info *b) return b->c->fc; } #ifdef DEBUG - fvwm_debug(__func__, "%s: BUG: No foreground definition?\n",MyName); + fvwm_debug(MyName, "%s: BUG: No foreground definition?\n", __func__); #endif return None; } @@ -245,7 +245,7 @@ Pixel buttonBack(const button_info *b) return b->c->bc; } #ifdef DEBUG - fvwm_debug(__func__, "%s: BUG: No background definition?\n",MyName); + fvwm_debug(MyName, "%s: BUG: No background definition?\n", __func__); #endif return None; } @@ -264,7 +264,7 @@ Pixel buttonHilite(button_info *b) return b->c->hc; } #ifdef DEBUG - fvwm_debug(__func__, "%s: BUG: No background definition?\n",MyName); + fvwm_debug(MyName, "%s: BUG: No background definition?\n", __func__); #endif return None; } @@ -283,7 +283,7 @@ Pixel buttonShadow(button_info *b) return b->c->sc; } #ifdef DEBUG - fvwm_debug(__func__, "%s: BUG: No background definition?\n",MyName); + fvwm_debug(MyName, "%s: BUG: No background definition?\n", __func__); #endif return None; } @@ -487,7 +487,7 @@ void alloc_buttonlist(button_info *ub,int num) old=ub->c->allocated_buttons; if(num(old+32)) /* test for numc->allocated_buttons<=num) @@ -516,8 +516,8 @@ button_info *alloc_button(button_info *ub,int num) alloc_buttonlist(ub,num); if(ub->c->buttons[num]) { - fvwm_debug(__func__, "%s: Allocated button twice, report bug twice\n", - MyName); + fvwm_debug(MyName, "%s: Allocated button twice, report bug twice\n", + __func__); exit(2); } @@ -614,9 +614,9 @@ char PlaceAndExpandButton(int x, int y, button_info *b, button_info *ub) i = x+y*c->num_columns; if (x>=c->num_columns || x<0) { - fvwm_debug(__func__, "%s: Button out of horizontal range. Quitting.\n", - MyName); - fvwm_debug(__func__, "Button=%d num_columns=%d BPosX=%d\n", + fvwm_debug(MyName, "%s: Button out of horizontal range. Quitting.\n", + __func__); + fvwm_debug(MyName, "Button=%d num_columns=%d BPosX=%d\n", i,c->num_columns,b->BPosX); exit(1); } @@ -624,9 +624,9 @@ char PlaceAndExpandButton(int x, int y, button_info *b, button_info *ub) { if (b->flags.b_PosFixed || !ub->c->flags.b_SizeSmart || y<0) { - fvwm_debug(__func__, "%s: Button out of vertical range. Quitting.\n", - MyName); - fvwm_debug(__func__, "Button=%d num_rows=%d BPosY=%d\n", + fvwm_debug(MyName, "%s: Button out of vertical range. Quitting.\n", + __func__); + fvwm_debug(MyName, "Button=%d num_rows=%d BPosY=%d\n", i,c->num_rows,b->BPosY); exit(1); } @@ -636,8 +636,8 @@ char PlaceAndExpandButton(int x, int y, button_info *b, button_info *ub) } if(x+b->BWidth>c->num_columns) { - fvwm_debug(__func__, "%s: Button too wide. giving up\n",MyName); - fvwm_debug(__func__, "Button=%d num_columns=%d bwidth=%d w=%d\n", + fvwm_debug(MyName, "%s: Button too wide. giving up\n", __func__); + fvwm_debug(MyName, "Button=%d num_columns=%d bwidth=%d w=%d\n", i,c->num_columns,b->BWidth,x); b->BWidth = c->num_columns-x; } @@ -651,8 +651,8 @@ char PlaceAndExpandButton(int x, int y, button_info *b, button_info *ub) } else { - fvwm_debug(__func__, "%s: Button too tall. Giving up\n",MyName); - fvwm_debug(__func__, "Button=%d num_rows=%d bheight=%d h=%d\n", + fvwm_debug(MyName, "%s: Button too tall. Giving up\n", __func__); + fvwm_debug(MyName, "Button=%d num_rows=%d bheight=%d h=%d\n", i,c->num_rows,b->BHeight,y); b->BHeight = c->num_rows-y; } @@ -682,7 +682,7 @@ void ShrinkButton(button_info *b, container_info *c) if (!b) { - fvwm_debug(__func__, "error: shrink1: button is empty but shouldn't\n"); + fvwm_debug(MyName, "error: shrink1: button is empty but shouldn't\n"); exit(1); } i = b->BPosX+b->BPosY*c->num_columns; @@ -696,7 +696,7 @@ void ShrinkButton(button_info *b, container_info *c) l = i+j+k*c->num_columns; if (c->buttons[l] != b) { - fvwm_debug(__func__, "error: shrink2: button was stolen\n"); + fvwm_debug(MyName, "error: shrink2: button was stolen\n"); exit(1); } c->buttons[l] = NULL; @@ -796,9 +796,9 @@ void ShuffleButtons(button_info *ub) /* Move button if position given by user */ if (PlaceAndExpandButton(b->BPosX,b->BPosY,b,ub)) { - fvwm_debug(__func__, "%s: Overlapping fixed buttons. Quitting.\n", - MyName); - fvwm_debug(__func__, "Button=%d, x=%d, y=%d\n", i,b->BPosX,b->BPosY); + fvwm_debug(MyName, "%s: Overlapping fixed buttons. Quitting.\n", + __func__); + fvwm_debug(MyName, "Button=%d, x=%d, y=%d\n", i,b->BPosX,b->BPosY); exit(1); } } @@ -826,7 +826,7 @@ void ShuffleButtons(button_info *ub) if (next_button_y>=c->num_rows) { /* could not place button */ - fvwm_debug(__func__, "%s: Button confusion! Quitting\n", MyName); + fvwm_debug(MyName, "%s: Button confusion! Quitting\n", __func__); exit(1); } } @@ -869,7 +869,7 @@ button_info *NextButton(button_info **ub,button_info **b,int *i,int all) *i=(*b)->n; if((*i)>=(*ub)->c->num_buttons) { - fvwm_debug(__func__, "%s: BUG: Couldn't return to uberbutton\n",MyName); + fvwm_debug(MyName, "%s: BUG: Couldn't return to uberbutton\n", __func__); exit(2); } NextButton(ub,b,i,all); diff --git a/modules/FvwmButtons/draw.c b/modules/FvwmButtons/draw.c index d3c940e53..eec8d9a86 100644 --- a/modules/FvwmButtons/draw.c +++ b/modules/FvwmButtons/draw.c @@ -102,13 +102,13 @@ void MakeButton(button_info *b) if(!b) { - fvwm_debug(__func__, "%s: BUG: MakeButton called with NULL pointer\n", - MyName); + fvwm_debug(MyName, "%s: BUG: MakeButton called with NULL pointer\n", + __func__); exit(2); } if(b->flags.b_Container) { - fvwm_debug(__func__, "%s: BUG: MakeButton called with container\n",MyName); + fvwm_debug(MyName, "%s: BUG: MakeButton called with container\n", __func__); exit(2); } @@ -139,8 +139,8 @@ void MakeButton(button_info *b) long supplied; if(!b->IconWin) { - fvwm_debug(__func__, "%s: BUG: Swallowed window has no IconWin\n", - MyName); + fvwm_debug(MyName, "%s: BUG: Swallowed window has no IconWin\n", + __func__); exit(2); } diff --git a/modules/FvwmButtons/output.c b/modules/FvwmButtons/output.c index dfb645e8a..38f51e66a 100644 --- a/modules/FvwmButtons/output.c +++ b/modules/FvwmButtons/output.c @@ -37,41 +37,41 @@ void DumpButtons(button_info *b) { if (!b) { - fvwm_debug(__func__, "NULL\n"); + fvwm_debug(MyName, "NULL\n"); return; } if (b != UberButton) { int button = buttonNum(b); - fvwm_debug(__func__, + fvwm_debug(MyName, "0x%lx(%ix%i@(%i,%i)): ", (unsigned long)b, b->BWidth, b->BHeight, buttonXPos(b, button), buttonYPos(b, button)); } else { - fvwm_debug(__func__, + fvwm_debug(MyName, "0x%lx(%ix%i@): ", (unsigned long)b, b->BWidth, b->BHeight); } if (b->flags.b_Font) - fvwm_debug(__func__, + fvwm_debug(MyName, "Font(%s,0x%lx) ", b->font_string, (unsigned long)b->Ffont); if (b->flags.b_Padding) - fvwm_debug(__func__, "Padding(%i,%i) ", b->xpad, b->ypad); + fvwm_debug(MyName, "Padding(%i,%i) ", b->xpad, b->ypad); if (b->flags.b_Frame) - fvwm_debug(__func__, "Framew(%i) ", b->framew); + fvwm_debug(MyName, "Framew(%i) ", b->framew); if (b->flags.b_Title) - fvwm_debug(__func__, "Title(%s) ", b->title); + fvwm_debug(MyName, "Title(%s) ", b->title); if (b->flags.b_Icon) - fvwm_debug(__func__, "Icon(%s,%i) ", b->icon_file, + fvwm_debug(MyName, "Icon(%s,%i) ", b->icon_file, (int)b->IconWin); if (b->flags.b_Icon) - fvwm_debug(__func__, "Panelw(%i) ", (int)b->PanelWin); + fvwm_debug(MyName, "Panelw(%i) ", (int)b->PanelWin); if (b->flags.b_Action) - fvwm_debug(__func__, + fvwm_debug(MyName, "\n Action(%s,%s,%s,%s) ", b->action[0] ? b->action[0] : "", b->action[1] ? b->action[1] : "", @@ -79,27 +79,27 @@ void DumpButtons(button_info *b) b->action[3] ? b->action[3] : ""); if (b->flags.b_Swallow) { - fvwm_debug(__func__, "Swallow(0x%02x) ", b->swallow); + fvwm_debug(MyName, "Swallow(0x%02x) ", b->swallow); if (b->swallow & b_Respawn) - fvwm_debug(__func__, "\n Respawn(%s) ", b->spawn); + fvwm_debug(MyName, "\n Respawn(%s) ", b->spawn); if (b->newflags.do_swallow_new) - fvwm_debug(__func__, "\n SwallowNew(%s) ", b->spawn); + fvwm_debug(MyName, "\n SwallowNew(%s) ", b->spawn); } if (b->flags.b_Panel) { - fvwm_debug(__func__, "Panel(0x%02x) ", b->swallow); + fvwm_debug(MyName, "Panel(0x%02x) ", b->swallow); if (b->swallow & b_Respawn) - fvwm_debug(__func__, "\n Respawn(%s) ", b->spawn); + fvwm_debug(MyName, "\n Respawn(%s) ", b->spawn); if (b->newflags.do_swallow_new) - fvwm_debug(__func__, "\n SwallowNew(%s) ", b->spawn); + fvwm_debug(MyName, "\n SwallowNew(%s) ", b->spawn); } if (b->flags.b_Hangon) - fvwm_debug(__func__, "Hangon(%s) ", b->hangon); - fvwm_debug(__func__, "\n"); + fvwm_debug(MyName, "Hangon(%s) ", b->hangon); + fvwm_debug(MyName, "\n"); if (b->flags.b_Container) { int i = 0; - fvwm_debug(__func__, + fvwm_debug(MyName, " Container(%ix%i=%i buttons (alloc %i)," " size %ix%i, pos %i,%i)\n{ ", b->c->num_columns, b->c->num_rows, @@ -113,11 +113,11 @@ void DumpButtons(button_info *b) */ while (ic->num_buttons) { - fvwm_debug(__func__, + fvwm_debug(MyName, "0x%lx ", (unsigned long)b->c->buttons[i++]); } - fvwm_debug(__func__, "}\n"); + fvwm_debug(MyName, "}\n"); i = 0; while (i < b->c->num_buttons) { @@ -133,116 +133,116 @@ void SaveButtons(button_info *b) if (!b) return; if (b->BWidth>1 || b->BHeight > 1) - fvwm_debug(__func__, "%ix%i ", b->BWidth, b->BHeight); + fvwm_debug(MyName, "%ix%i ", b->BWidth, b->BHeight); if (b->flags.b_Font) - fvwm_debug(__func__, "Font %s ", b->font_string); + fvwm_debug(MyName, "Font %s ", b->font_string); if (b->flags.b_Fore) - fvwm_debug(__func__, "Fore %s ", b->fore); + fvwm_debug(MyName, "Fore %s ", b->fore); if (b->flags.b_Back) - fvwm_debug(__func__, "Back %s ", b->back); + fvwm_debug(MyName, "Back %s ", b->back); if (b->flags.b_Frame) - fvwm_debug(__func__, "Frame %i ", b->framew); + fvwm_debug(MyName, "Frame %i ", b->framew); if (b->flags.b_Padding) - fvwm_debug(__func__, "Padding %i %i ", b->xpad, b->ypad); + fvwm_debug(MyName, "Padding %i %i ", b->xpad, b->ypad); if (b->flags.b_Title) { - fvwm_debug(__func__, "Title "); + fvwm_debug(MyName, "Title "); if (b->flags.b_Justify) { - fvwm_debug(__func__, "("); + fvwm_debug(MyName, "("); switch (b->justify & b_TitleHoriz) { case 0: - fvwm_debug(__func__, "Left"); + fvwm_debug(MyName, "Left"); break; case 1: - fvwm_debug(__func__, "Center"); + fvwm_debug(MyName, "Center"); break; case 2: - fvwm_debug(__func__, "Right"); + fvwm_debug(MyName, "Right"); break; } if (b->justify & b_Horizontal) { - fvwm_debug(__func__, ", Side"); + fvwm_debug(MyName, ", Side"); } - fvwm_debug(__func__, ") "); + fvwm_debug(MyName, ") "); } - fvwm_debug(__func__, "\"%s\" ", b->title); + fvwm_debug(MyName, "\"%s\" ", b->title); } if (b->flags.b_Icon) { - fvwm_debug(__func__, "Icon \"%s\" ", b->icon_file); + fvwm_debug(MyName, "Icon \"%s\" ", b->icon_file); } if (b->flags.b_Swallow || b->flags.b_Panel) { if (b->flags.b_Swallow) - fvwm_debug(__func__, "Swallow "); + fvwm_debug(MyName, "Swallow "); else - fvwm_debug(__func__, "Panel "); + fvwm_debug(MyName, "Panel "); if (b->swallow_mask) { - fvwm_debug(__func__, "("); + fvwm_debug(MyName, "("); if (b->swallow_mask & b_NoHints) { if (b->swallow & b_NoHints) - fvwm_debug(__func__, "NoHints "); + fvwm_debug(MyName, "NoHints "); else - fvwm_debug(__func__, "Hints "); + fvwm_debug(MyName, "Hints "); } if (b->swallow_mask & b_Kill) { if (b->swallow & b_Kill) - fvwm_debug(__func__, "Kill "); + fvwm_debug(MyName, "Kill "); else - fvwm_debug(__func__, "NoKill "); + fvwm_debug(MyName, "NoKill "); } if (b->swallow_mask & b_NoClose) { if (b->swallow & b_NoClose) - fvwm_debug(__func__, "NoClose "); + fvwm_debug(MyName, "NoClose "); else - fvwm_debug(__func__, "Close "); + fvwm_debug(MyName, "Close "); } if (b->swallow_mask & b_Respawn) { if (b->swallow & b_Respawn) - fvwm_debug(__func__, "Respawn "); + fvwm_debug(MyName, "Respawn "); else - fvwm_debug(__func__, "NoRespawn "); + fvwm_debug(MyName, "NoRespawn "); } if (b->swallow_mask & b_UseOld) { if (b->swallow & b_UseOld) - fvwm_debug(__func__, "UseOld "); + fvwm_debug(MyName, "UseOld "); else - fvwm_debug(__func__, "NoOld "); + fvwm_debug(MyName, "NoOld "); } if (b->swallow_mask & b_UseTitle) { if (b->swallow & b_UseTitle) - fvwm_debug(__func__, "UseTitle "); + fvwm_debug(MyName, "UseTitle "); else - fvwm_debug(__func__, "NoTitle "); + fvwm_debug(MyName, "NoTitle "); } - fvwm_debug(__func__, ") "); + fvwm_debug(MyName, ") "); } - fvwm_debug(__func__, "\"%s\" \"%s\" ", b->hangon, b->spawn); + fvwm_debug(MyName, "\"%s\" \"%s\" ", b->hangon, b->spawn); } if (b->flags.b_Action) { if (b->action[0]) - fvwm_debug(__func__, "Action `%s` ", b->action[0]); + fvwm_debug(MyName, "Action `%s` ", b->action[0]); for (i = 1; i < 4; i++) { if (b->action[i]) - fvwm_debug(__func__, + fvwm_debug(MyName, "Action (Mouse %i) `%s` ", i, b->action[i]); } @@ -251,110 +251,110 @@ void SaveButtons(button_info *b) if (b->flags.b_Container) { - fvwm_debug(__func__, + fvwm_debug(MyName, "Container (Columns %i Rows %i ", b->c->num_columns, b->c->num_rows); if (b->c->flags.b_Font) - fvwm_debug(__func__, "Font %s ", + fvwm_debug(MyName, "Font %s ", b->c->font_string); if (b->c->flags.b_Fore) - fvwm_debug(__func__, "Fore %s ", b->c->fore); + fvwm_debug(MyName, "Fore %s ", b->c->fore); if (b->c->flags.b_Back) - fvwm_debug(__func__, "Back %s ", b->c->back); + fvwm_debug(MyName, "Back %s ", b->c->back); if (b->c->flags.b_Frame) - fvwm_debug(__func__, "Frame %i ", + fvwm_debug(MyName, "Frame %i ", b->c->framew); if (b->c->flags.b_Padding) - fvwm_debug(__func__, + fvwm_debug(MyName, "Padding %i %i ", b->c->xpad, b->c->ypad); if (b->c->flags.b_Justify) { - fvwm_debug(__func__, "Title ("); + fvwm_debug(MyName, "Title ("); switch (b->c->justify & b_TitleHoriz) { case 0: - fvwm_debug(__func__, "Left"); + fvwm_debug(MyName, "Left"); break; case 1: - fvwm_debug(__func__, "Center"); + fvwm_debug(MyName, "Center"); break; case 2: - fvwm_debug(__func__, "Right"); + fvwm_debug(MyName, "Right"); break; } if (b->c->justify & b_Horizontal) { - fvwm_debug(__func__, ", Side"); + fvwm_debug(MyName, ", Side"); } - fvwm_debug(__func__, ") "); + fvwm_debug(MyName, ") "); } if (b->c->swallow_mask) { - fvwm_debug(__func__, "Swallow ("); + fvwm_debug(MyName, "Swallow ("); if (b->c->swallow_mask & b_NoHints) { if (b->c->swallow & b_NoHints) - fvwm_debug(__func__, + fvwm_debug(MyName, "NoHints "); else - fvwm_debug(__func__, "Hints "); + fvwm_debug(MyName, "Hints "); } if (b->c->swallow_mask & b_Kill) { if (b->c->swallow & b_Kill) - fvwm_debug(__func__, "Kill "); + fvwm_debug(MyName, "Kill "); else - fvwm_debug(__func__, + fvwm_debug(MyName, "NoKill "); } if (b->c->swallow_mask & b_NoClose) { if (b->c->swallow & b_NoClose) - fvwm_debug(__func__, + fvwm_debug(MyName, "NoClose "); else - fvwm_debug(__func__, "Close "); + fvwm_debug(MyName, "Close "); } if (b->c->swallow_mask & b_Respawn) { if (b->c->swallow & b_Respawn) - fvwm_debug(__func__, + fvwm_debug(MyName, "Respawn "); else - fvwm_debug(__func__, + fvwm_debug(MyName, "NoRespawn "); } if (b->c->swallow_mask & b_UseOld) { if (b->c->swallow & b_UseOld) - fvwm_debug(__func__, + fvwm_debug(MyName, "UseOld "); else - fvwm_debug(__func__, "NoOld "); + fvwm_debug(MyName, "NoOld "); } if (b->c->swallow_mask & b_UseTitle) { if (b->c->swallow & b_UseTitle) - fvwm_debug(__func__, + fvwm_debug(MyName, "UseTitle "); else - fvwm_debug(__func__, + fvwm_debug(MyName, "NoTitle "); } - fvwm_debug(__func__, ") "); + fvwm_debug(MyName, ") "); } - fvwm_debug(__func__, ")"); + fvwm_debug(MyName, ")"); } - fvwm_debug(__func__, "\n"); + fvwm_debug(MyName, "\n"); if (b->flags.b_Container) { @@ -363,6 +363,6 @@ void SaveButtons(button_info *b) { SaveButtons(b->c->buttons[i++]); } - fvwm_debug(__func__, "End\n"); + fvwm_debug(MyName, "End\n"); } } diff --git a/modules/FvwmButtons/parse.c b/modules/FvwmButtons/parse.c index d1cffe0dd..59d5de476 100644 --- a/modules/FvwmButtons/parse.c +++ b/modules/FvwmButtons/parse.c @@ -135,15 +135,15 @@ static int ParseBack(char **ss) { case 0: /* Icon */ r = 1; - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Back(Icon) not supported yet\n", - MyName); + __func__); break; default: t = seekright(&s); - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Illegal back option \"%s\"\n", - MyName, (t) ? t : ""); + __func__, (t) ? t : ""); if (t) { free(t); @@ -197,9 +197,9 @@ static void ParseBoxSize(char **ss, flags_type *flags) default: flags->b_SizeFixed = 0; flags->b_SizeSmart = 0; - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Illegal boxsize option \"%s\"\n", - MyName, s); + __func__, s); break; } return; @@ -256,9 +256,9 @@ static void ParseTitle(char **ss, byte *flags, byte *mask) break; default: t = seekright(&s); - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Illegal title option \"%s\"\n", - MyName, (t) ? t : ""); + __func__, (t) ? t : ""); if (t) { free(t); @@ -369,9 +369,9 @@ static void ParseSwallow( break; default: t = seekright(&s); - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Illegal Swallow option \"%s\"\n", - MyName, + __func__, (t) ? t : ""); if (t) { @@ -620,10 +620,10 @@ static void ParsePanel( s--; if (t) { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Illegal Panel " "position option %s\n", - MyName, + __func__, (t) ? t : ""); free(t); } @@ -632,9 +632,9 @@ static void ParsePanel( break; default: t = seekright(&s); - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Illegal Panel option \"%s\"\n", - MyName, + __func__, (t) ? t : ""); if (t) { @@ -748,7 +748,7 @@ static void ParseContainer(char **ss,button_info *b) b->c->flags.b_Padding = 1; } else - fvwm_debug(__func__, "%s: Illegal padding argument\n",MyName); + fvwm_debug(MyName, "%s: Illegal padding argument\n", __func__); break; case 7: /* Title - flags */ s = trimleft(s); @@ -765,9 +765,9 @@ static void ParseContainer(char **ss,button_info *b) else { char *temp; - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Illegal title in container options\n", - MyName); + __func__); temp = seekright(&s); if (temp) { @@ -782,8 +782,8 @@ static void ParseContainer(char **ss,button_info *b) s = trimleft(s); if (b->c->flags.b_Swallow || b->c->flags.b_Panel) { - fvwm_debug(__func__, "%s: Multiple Swallow or Panel options are not" - " allowed in a single button", MyName); + fvwm_debug(MyName, "%s: Multiple Swallow or Panel options are not" + " allowed in a single button", __func__); failed = True; } else if (*s == '(' && s++) @@ -798,9 +798,9 @@ static void ParseContainer(char **ss,button_info *b) } else { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Illegal swallow or panel in container options\n", - MyName); + __func__); failed = True; } if (failed) @@ -828,7 +828,7 @@ static void ParseContainer(char **ss,button_info *b) s = o; } else - fvwm_debug(__func__, "%s: Illegal size arguments\n",MyName); + fvwm_debug(MyName, "%s: Illegal size arguments\n", __func__); break; case 11: /* BoxSize */ @@ -852,7 +852,7 @@ static void ParseContainer(char **ss,button_info *b) default: t = seekright(&s); - fvwm_debug(__func__, "%s: Illegal container option \"%s\"\n",MyName, + fvwm_debug(MyName, "%s: Illegal container option \"%s\"\n", __func__, (t)?t:""); free(t); } @@ -1032,7 +1032,7 @@ static void ParseButton(button_info **uberb, char *s) } b->title = t; #ifdef DEBUG_PARSER - fvwm_debug(__func__, + fvwm_debug(MyName, "PARSE: Title \"%s\"\n", b->title); #endif @@ -1040,9 +1040,9 @@ static void ParseButton(button_info **uberb, char *s) } else { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Missing title argument\n", - MyName); + __func__); if (t) { free(t); @@ -1058,13 +1058,13 @@ static void ParseButton(button_info **uberb, char *s) { if (b->flags.b_Swallow) { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: a button can not " "have an icon and a " "swallowed window at " "the same time. " "Ignoring icon\n", - MyName); + __func__); } else { @@ -1078,9 +1078,9 @@ static void ParseButton(button_info **uberb, char *s) } else { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Missing Icon argument\n", - MyName); + __func__); if (t) { free(t); @@ -1100,9 +1100,9 @@ static void ParseButton(button_info **uberb, char *s) } else { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Illegal frame argument\n", - MyName); + __func__); } break; @@ -1124,9 +1124,9 @@ static void ParseButton(button_info **uberb, char *s) } else { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Illegal padding " - "argument\n", MyName); + "argument\n", __func__); } break; @@ -1195,13 +1195,13 @@ static void ParseButton(button_info **uberb, char *s) { if (b->flags.b_Icon) { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: a button can not " "have an icon and a " "swallowed window at " "the same time. " "Ignoring icon\n", - MyName); + __func__); b->flags.b_Icon = 0; } @@ -1250,9 +1250,9 @@ static void ParseButton(button_info **uberb, char *s) } else { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Missing swallow " - "argument\n", MyName); + "argument\n", __func__); if (t) { free(t); @@ -1310,9 +1310,9 @@ static void ParseButton(button_info **uberb, char *s) free(b); if (!ub->parent) { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Unmatched END in config file\n", - MyName); + __func__); exit(1); } if (ub->parent->c->flags.b_Colorset || @@ -1343,9 +1343,9 @@ static void ParseButton(button_info **uberb, char *s) } else { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Illegal size arguments\n", - MyName); + __func__); } break; @@ -1389,9 +1389,9 @@ static void ParseButton(button_info **uberb, char *s) s++; if (strncasecmp(s, "mouse", 5) != 0) { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Couldn't parse " - "action\n", MyName); + "action\n", __func__); } s += 5; i = strtol(s, &t, 10); @@ -1433,9 +1433,9 @@ static void ParseButton(button_info **uberb, char *s) } else { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Missing action argument\n", - MyName); + __func__); } break; @@ -1463,18 +1463,18 @@ static void ParseButton(button_info **uberb, char *s) } else { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Incorrect id '%s' " "ignored\n", - MyName, t); + __func__, t); } free(t); } else { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Missing id argument\n", - MyName); + __func__); } break; @@ -1485,13 +1485,13 @@ static void ParseButton(button_info **uberb, char *s) { if (b->flags.b_Swallow) { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: a button can not " "have a ActiveIcon and " "a swallowed window at " "the same time. " "Ignoring ActiveIcon.\n", - MyName); + __func__); } else { @@ -1505,9 +1505,9 @@ static void ParseButton(button_info **uberb, char *s) } else { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Missing ActiveIcon " - "argument\n", MyName); + "argument\n", __func__); if (t) { free(t); @@ -1520,10 +1520,10 @@ static void ParseButton(button_info **uberb, char *s) s = trimleft(s); if (*s == '(') { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: justification not allowed " "for ActiveTitle.\n", - MyName); + __func__); } t = seekright(&s); if (t && *t && (t[0] != '-' || t[1] != 0)) @@ -1534,7 +1534,7 @@ static void ParseButton(button_info **uberb, char *s) } b->activeTitle = t; #ifdef DEBUG_PARSER - fvwm_debug(__func__, + fvwm_debug(MyName, "PARSE: ActiveTitle \"%s\"\n", b->activeTitle); #endif @@ -1542,9 +1542,9 @@ static void ParseButton(button_info **uberb, char *s) } else { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Missing ActiveTitle " - "argument\n", MyName); + "argument\n", __func__); if (t) { free(t); @@ -1559,13 +1559,13 @@ static void ParseButton(button_info **uberb, char *s) { if (b->flags.b_Swallow) { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: a button can not " "have a PressIcon and " "a swallowed window at " "the same time. " "Ignoring PressIcon.\n", - MyName); + __func__); } else { @@ -1579,9 +1579,9 @@ static void ParseButton(button_info **uberb, char *s) } else { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Missing PressIcon " - "argument\n", MyName); + "argument\n", __func__); if (t) { free(t); @@ -1594,10 +1594,10 @@ static void ParseButton(button_info **uberb, char *s) s = trimleft(s); if (*s == '(') { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: justification not allowed " "for PressTitle.\n", - MyName); + __func__); } t = seekright(&s); if (t && *t && (t[0] != '-' || t[1] != 0)) @@ -1608,7 +1608,7 @@ static void ParseButton(button_info **uberb, char *s) } b->pressTitle = t; #ifdef DEBUG_PARSER - fvwm_debug(__func__, + fvwm_debug(MyName, "PARSE: PressTitle \"%s\"\n", b->pressTitle); #endif @@ -1616,9 +1616,9 @@ static void ParseButton(button_info **uberb, char *s) } else { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Missing PressTitle " - "argument\n", MyName); + "argument\n", __func__); if (t) { free(t); @@ -1664,9 +1664,9 @@ static void ParseButton(button_info **uberb, char *s) /* --------------- --------------- */ default: t = seekright(&s); - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Illegal button option \"%s\"\n", - MyName, (t) ? t : ""); + __func__, (t) ? t : ""); if (t) { free(t); @@ -1736,9 +1736,9 @@ static void ParseButton(button_info **uberb, char *s) { if (b->flags.b_Swallow || b->flags.b_Panel) { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: Illegal with both old and new swallow!\n", - MyName); + __func__); exit(1); } s += 7; @@ -1981,6 +1981,15 @@ static void ParseConfigLine(button_info **ubb, char *s) default: s = trimleft(s); + if (strncasecmp(s, "LoggingFD", 9) == 0) { + int fd = -1; + sscanf((s + 10), "%d", &fd); + log_set_fd(fd); + + fvwm_debug(MyName, "I AM RUNNING!!!"); + + break; + } ParseButton(ubb, s); break; } @@ -1997,8 +2006,8 @@ static void ParseConfigFile(button_info *ub) int l; if (!f) { - fvwm_debug(__func__, - "%s: Couldn't open config file %s\n", MyName, + fvwm_debug(MyName, + "%s: Couldn't open config file %s\n", __func__, config_file); return; } @@ -2112,8 +2121,18 @@ void ParseConfiguration(button_info *ub) /* send config lines with MyName */ InitGetConfigLine(fd, items[0]); GetConfigLine(fd, &s); + while (s && s[0]) { + if (strncasecmp(s, "LoggingFD", 9) == 0) { + int fdl = -1; + sscanf((s + 10), "%d", &fdl); + log_set_fd(fdl); + + GetConfigLine(fd,&s); + continue; + } + char *rest; switch (GetTokenIndex(s,items,-1,&rest)) { diff --git a/modules/FvwmConsole/FvwmConsole.c b/modules/FvwmConsole/FvwmConsole.c index 96aa87151..190a905be 100644 --- a/modules/FvwmConsole/FvwmConsole.c +++ b/modules/FvwmConsole/FvwmConsole.c @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) module = ParseModuleArgs(argc, argv, 0); /* we don't use an alias */ if (module == NULL) { - fvwm_debug(__func__, + fvwm_debug(Name, "FvwmConsole version "VERSION" should only be" " executed by fvwm!\n"); exit(1); @@ -319,7 +319,7 @@ void server(void) */ void ErrMsg(char *msg) { - fvwm_debug(__func__, "%s server error in %s, errno %d: %s\n", Name, + fvwm_debug(Name, "%s server error in %s, errno %d: %s\n", __func__, msg, errno, strerror(errno)); clean_up(); diff --git a/modules/FvwmConsole/FvwmConsoleC.c b/modules/FvwmConsole/FvwmConsoleC.c index 725465060..4d8a981fd 100644 --- a/modules/FvwmConsole/FvwmConsoleC.c +++ b/modules/FvwmConsole/FvwmConsoleC.c @@ -54,7 +54,7 @@ RETSIGTYPE ReapChildren(int sig) */ void ErrMsg(char *msg) { - fvwm_debug(__func__, "%s error in %s: %s\n", name , msg, + fvwm_debug(name, "%s error in %s: %s\n", __func__ , msg, strerror(errno)); if (sp != NULL) { diff --git a/modules/FvwmIconMan/FvwmIconMan.c b/modules/FvwmIconMan/FvwmIconMan.c index ac6677de3..1b575ddf4 100644 --- a/modules/FvwmIconMan/FvwmIconMan.c +++ b/modules/FvwmIconMan/FvwmIconMan.c @@ -78,14 +78,14 @@ void Free(void *p) head--; if (head->magic != MALLOC_MAGIC) { - fvwm_debug(__func__, + fvwm_debug(MyName, "Corrupted memory found in Free\n"); abort(); return; } if (head->len > MemUsed) { - fvwm_debug(__func__, "Free block too big\n"); + fvwm_debug(MyName, "Free block too big\n"); return; } MemUsed -= head->len; @@ -240,9 +240,9 @@ main(int argc, char **argv) if (argc < 6) { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s version %s should only be executed by fvwm!\n", - MyName, VERSION); + __func__, VERSION); ShutMeDown(1); } fvwm_fd[0] = atoi(argv[1]); diff --git a/modules/FvwmIconMan/debug.c b/modules/FvwmIconMan/debug.c index 602a97162..45dcf1154 100644 --- a/modules/FvwmIconMan/debug.c +++ b/modules/FvwmIconMan/debug.c @@ -65,7 +65,7 @@ OpenConsole(const char *filenm) } else if ((console = fopen(filenm, "w")) == NULL) { - fvwm_debug(__func__, "%s: cannot open %s\n", MyName, filenm); + fvwm_debug(MyName, "%s: cannot open %s\n", __func__, filenm); return 0; } diff --git a/modules/FvwmIconMan/x.c b/modules/FvwmIconMan/x.c index 8af4feccf..6252b185b 100644 --- a/modules/FvwmIconMan/x.c +++ b/modules/FvwmIconMan/x.c @@ -157,8 +157,8 @@ Window find_frame_window (Window win, int *off_x, int *off_y) { if (!XQueryTree (theDisplay, win, &root, &parent, &junkw, &junki)) { - fvwm_debug(__func__, "%s: find_frame_window: XQueryTree failed.\n", - MyName); + fvwm_debug(MyName, "%s: find_frame_window: XQueryTree failed.\n", + __func__); return win; } if (junkw) @@ -167,9 +167,9 @@ Window find_frame_window (Window win, int *off_x, int *off_y) break; if (!XGetWindowAttributes (theDisplay, win, &attr)) { - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: find_frame_window: XGetWindowAttrigutes failed.\n", - MyName); + __func__); return win; } ConsoleDebug (X11, "Adding (%d, %d) += (%d, %d)\n", diff --git a/modules/FvwmIconMan/xmanager.c b/modules/FvwmIconMan/xmanager.c index 15a7f2b02..7f8a5f887 100644 --- a/modules/FvwmIconMan/xmanager.c +++ b/modules/FvwmIconMan/xmanager.c @@ -340,9 +340,9 @@ static ManGeometry *query_geometry(WinManager *man) { g.x = off_x; g.y = off_y; - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: query_geometry: failed to get frame attributes.\n", - MyName); + __func__); } if (XGetWindowAttributes(theDisplay, man->theWindow, &win_attr)) { @@ -353,9 +353,9 @@ static ManGeometry *query_geometry(WinManager *man) { g.width = 1; g.height = 1; - fvwm_debug(__func__, + fvwm_debug(MyName, "%s: query_geometry: failed to get window attributes.\n", - MyName); + __func__); } return &g; diff --git a/modules/FvwmIdent/FvwmIdent.c b/modules/FvwmIdent/FvwmIdent.c index f60ef65da..f0b9f36d3 100644 --- a/modules/FvwmIdent/FvwmIdent.c +++ b/modules/FvwmIdent/FvwmIdent.c @@ -131,7 +131,7 @@ int main(int argc, char **argv) module = ParseModuleArgs(argc,argv,0); /* no alias */ if (module == NULL) { - fvwm_debug(__func__, + fvwm_debug("FvwmIdent", "FvwmIdent Version %s should only be executed" " by fvwm!\n", VERSION); exit(1); @@ -191,8 +191,8 @@ int main(int argc, char **argv) /* Open the Display */ if (!(dpy = XOpenDisplay(display_name))) { - fvwm_debug(__func__, "%s: can't open display %s", - module->name, + fvwm_debug(module->name, "%s: can't open display %s", + __func__, XDisplayName(display_name)); exit (1); } @@ -268,6 +268,11 @@ int main(int argc, char **argv) { LoadColorset(&tline[8]); } + else if (strncasecmp(tline, "LoggingFD", 9) == 0) { + int fd = -1; + sscanf((tline + 10), "%d", &fd); + log_set_fd(fd); + } GetConfigLine(fd, &tline); } @@ -749,8 +754,8 @@ void list_end(void) if ((Ffont = FlocaleLoadFont(dpy, font_string, module->name)) == NULL) { - fvwm_debug(__func__, "%s: cannot load font, exiting\n", - module->name); + fvwm_debug(module->name, "%s: cannot load font, exiting\n", + __func__); exit(1); } @@ -1034,8 +1039,8 @@ void change_window_name(char *str) if (XStringListToTextProperty(&str,1,&name) == 0) { - fvwm_debug(__func__, "%s: cannot allocate window name", - module->name); + fvwm_debug(module->name, "%s: cannot allocate window name", + __func__); return; } XSetWMName(dpy,main_win,&name);