Whitespace cleanup
This commit is contained in:
parent
34c8e85e49
commit
cfb359736f
38
xmem.c
38
xmem.c
|
@ -136,20 +136,20 @@ int main(int argc, char **argv)
|
||||||
Arg args[1];
|
Arg args[1];
|
||||||
Pixmap icon_pixmap = None;
|
Pixmap icon_pixmap = None;
|
||||||
char *label, host[256];
|
char *label, host[256];
|
||||||
|
|
||||||
/* For security reasons, we reset our uid/gid after doing the necessary
|
/* For security reasons, we reset our uid/gid after doing the necessary
|
||||||
system initialization and before calling any X routines. */
|
system initialization and before calling any X routines. */
|
||||||
|
|
||||||
if (setgid(getgid()) == -1)
|
if (setgid(getgid()) == -1)
|
||||||
errx(1, "%s: setgid failed: %s\n", argv[0], strerror(errno));
|
errx(1, "%s: setgid failed: %s\n", argv[0], strerror(errno));
|
||||||
if (setuid(getuid()) == -1)
|
if (setuid(getuid()) == -1)
|
||||||
errx(1, "%s: setuid failed: %s\n", argv[0], strerror(errno));
|
errx(1, "%s: setuid failed: %s\n", argv[0], strerror(errno));
|
||||||
|
|
||||||
toplevel = XtAppInitialize(&app_con, "XMem", options_mem, XtNumber(options_mem),
|
toplevel = XtAppInitialize(&app_con, "XMem", options_mem, XtNumber(options_mem),
|
||||||
&argc, argv, NULL, NULL, (Cardinal) 0);
|
&argc, argv, NULL, NULL, (Cardinal) 0);
|
||||||
|
|
||||||
if (argc != 1) usage(argv[0]);
|
if (argc != 1) usage(argv[0]);
|
||||||
|
|
||||||
XtGetApplicationResources( toplevel, (XtPointer) &resources,
|
XtGetApplicationResources( toplevel, (XtPointer) &resources,
|
||||||
my_resources_mem, XtNumber(my_resources_mem),
|
my_resources_mem, XtNumber(my_resources_mem),
|
||||||
NULL, (Cardinal) 0);
|
NULL, (Cardinal) 0);
|
||||||
|
@ -160,7 +160,7 @@ int main(int argc, char **argv)
|
||||||
XtAppAddActions (app_con, xload_actions, XtNumber(xload_actions));
|
XtAppAddActions (app_con, xload_actions, XtNumber(xload_actions));
|
||||||
XtOverrideTranslations(toplevel,
|
XtOverrideTranslations(toplevel,
|
||||||
XtParseTranslationTable ("<Message>WM_PROTOCOLS: quit()"));
|
XtParseTranslationTable ("<Message>WM_PROTOCOLS: quit()"));
|
||||||
|
|
||||||
XtSetArg (args[0], XtNiconPixmap, &icon_pixmap);
|
XtSetArg (args[0], XtNiconPixmap, &icon_pixmap);
|
||||||
XtGetValues(toplevel, args, ONE);
|
XtGetValues(toplevel, args, ONE);
|
||||||
if (icon_pixmap == None) {
|
if (icon_pixmap == None) {
|
||||||
|
@ -171,33 +171,33 @@ int main(int argc, char **argv)
|
||||||
xload_width, xload_height));
|
xload_width, xload_height));
|
||||||
XtSetValues (toplevel, args, ONE);
|
XtSetValues (toplevel, args, ONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resources.show_label) {
|
if (resources.show_label) {
|
||||||
pane = XtCreateManagedWidget ("paned", panedWidgetClass,
|
pane = XtCreateManagedWidget ("paned", panedWidgetClass,
|
||||||
toplevel, NULL, ZERO);
|
toplevel, NULL, ZERO);
|
||||||
|
|
||||||
label_wid = XtCreateManagedWidget ("label", labelWidgetClass,
|
label_wid = XtCreateManagedWidget ("label", labelWidgetClass,
|
||||||
pane, NULL, ZERO);
|
pane, NULL, ZERO);
|
||||||
|
|
||||||
XtSetArg (args[0], XtNlabel, &label);
|
XtSetArg (args[0], XtNlabel, &label);
|
||||||
XtGetValues(label_wid, args, ONE);
|
XtGetValues(label_wid, args, ONE);
|
||||||
|
|
||||||
if ( strcmp("label", label) == 0 ) {
|
if ( strcmp("label", label) == 0 ) {
|
||||||
(void) XmuGetHostname (host, 255);
|
(void) XmuGetHostname (host, 255);
|
||||||
XtSetArg (args[0], XtNlabel, host);
|
XtSetArg (args[0], XtNlabel, host);
|
||||||
XtSetValues (label_wid, args, ONE);
|
XtSetValues (label_wid, args, ONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
load_parent = pane;
|
load_parent = pane;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
load_parent = toplevel;
|
load_parent = toplevel;
|
||||||
|
|
||||||
|
|
||||||
load = XtCreateManagedWidget ("mem", memStripChartWidgetClass,
|
load = XtCreateManagedWidget ("mem", memStripChartWidgetClass,
|
||||||
load_parent, NULL, ZERO);
|
load_parent, NULL, ZERO);
|
||||||
XtAddCallback(load, XtNgetValue, (void*)GetMemLoadPoint, NULL);
|
XtAddCallback(load, XtNgetValue, (void*)GetMemLoadPoint, NULL);
|
||||||
|
|
||||||
XtRealizeWidget (toplevel);
|
XtRealizeWidget (toplevel);
|
||||||
wm_delete_window = XInternAtom (XtDisplay(toplevel), "WM_DELETE_WINDOW",
|
wm_delete_window = XInternAtom (XtDisplay(toplevel), "WM_DELETE_WINDOW",
|
||||||
False);
|
False);
|
||||||
|
@ -205,12 +205,12 @@ int main(int argc, char **argv)
|
||||||
&wm_delete_window, 1);
|
&wm_delete_window, 1);
|
||||||
|
|
||||||
#if __OpenBSD__
|
#if __OpenBSD__
|
||||||
if (pledge("ps vminfo stdio", NULL) == -1)
|
if (pledge("ps vminfo stdio", NULL) == -1)
|
||||||
errx(1, "pledge failed: %s", strerror(errno));
|
errx(1, "pledge failed: %s", strerror(errno));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
XtAppMainLoop(app_con);
|
XtAppMainLoop(app_con);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue