2 #define I3__FILE__ "commands.c"
19 #define y(x, ...) yajl_gen_ ## x (cmd_output->json_gen, ##__VA_ARGS__)
20 #define ystr(str) yajl_gen_string(cmd_output->json_gen, (unsigned char*)str, strlen(str))
21 #define ysuccess(success) do { \
27 #define yerror(message) do { \
41 #define HANDLE_EMPTY_MATCH do { \
42 if (match_is_empty(current_match)) { \
43 owindow *ow = smalloc(sizeof(owindow)); \
45 TAILQ_INIT(&owindows); \
46 TAILQ_INSERT_TAIL(&owindows, ow, owindows); \
56 return (a - b) > ( (fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
67 if (strcasecmp(output_str,
"left") == 0)
69 else if (strcasecmp(output_str,
"right") == 0)
71 else if (strcasecmp(output_str,
"up") == 0)
73 else if (strcasecmp(output_str,
"down") == 0)
86 assert(output != NULL);
102 if (strcmp(ws->
name, name) != 0)
105 DLOG(
"This workspace is already focused.\n");
125 if (current == workspace) {
128 DLOG(
"Substituting workspace with back_and_forth, as it is focused.\n");
139 static pid_t migration_pid = -1;
146 static void nagbar_exited(EV_P_ ev_child *watcher,
int revents) {
147 ev_child_stop(EV_A_ watcher);
148 if (!WIFEXITED(watcher->rstatus)) {
149 fprintf(stderr,
"ERROR: i3-nagbar did not exit normally.\n");
153 int exitcode = WEXITSTATUS(watcher->rstatus);
154 printf(
"i3-nagbar process exited with status %d\n", exitcode);
156 fprintf(stderr,
"ERROR: i3-nagbar could not be found. Is it correctly installed on your system?\n");
165 #if EV_VERSION_MAJOR >= 4
171 static void nagbar_cleanup(EV_P_ ev_cleanup *watcher,
int revent) {
172 if (migration_pid != -1) {
173 LOG(
"Sending SIGKILL (9) to i3-nagbar with PID %d\n", migration_pid);
174 kill(migration_pid, SIGKILL);
179 void cmd_MIGRATION_start_nagbar(
void) {
180 if (migration_pid != -1) {
181 fprintf(stderr,
"i3-nagbar already running.\n");
184 fprintf(stderr,
"Starting i3-nagbar, command parsing differs from expected output.\n");
185 ELOG(
"Please report this on IRC or in the bugtracker. Make sure to include the full debug level logfile:\n");
186 ELOG(
"i3-dump-log | gzip -9c > /tmp/i3.log.gz\n");
187 ELOG(
"FYI: Your i3 version is " I3_VERSION
"\n");
188 migration_pid = fork();
189 if (migration_pid == -1) {
190 warn(
"Could not fork()");
195 if (migration_pid == 0) {
203 "You found a parsing error. Please, please, please, report it!",
214 ev_child *child =
smalloc(
sizeof(ev_child));
221 #if EV_VERSION_MAJOR >= 4
224 ev_cleanup *cleanup =
smalloc(
sizeof(ev_cleanup));
248 static owindows_head owindows;
283 DLOG(
"match specification finished, matching...\n");
286 struct owindows_head old = owindows;
295 DLOG(
"checking if con %p / %s matches\n", current->
con, current->
con->
name);
298 DLOG(
"matches container!\n");
303 DLOG(
"match by mark\n");
309 DLOG(
"matches window!\n");
312 DLOG(
"doesnt match\n");
329 DLOG(
"ctype=*%s*, cvalue=*%s*\n", ctype, cvalue);
331 if (strcmp(ctype,
"class") == 0) {
336 if (strcmp(ctype,
"instance") == 0) {
341 if (strcmp(ctype,
"window_role") == 0) {
346 if (strcmp(ctype,
"con_id") == 0) {
348 long parsed = strtol(cvalue, &end, 10);
349 if (parsed == LONG_MIN ||
350 parsed == LONG_MAX ||
352 (end && *end !=
'\0')) {
353 ELOG(
"Could not parse con id \"%s\"\n", cvalue);
361 if (strcmp(ctype,
"id") == 0) {
363 long parsed = strtol(cvalue, &end, 10);
364 if (parsed == LONG_MIN ||
365 parsed == LONG_MAX ||
367 (end && *end !=
'\0')) {
368 ELOG(
"Could not parse window id \"%s\"\n", cvalue);
376 if (strcmp(ctype,
"con_mark") == 0) {
381 if (strcmp(ctype,
"title") == 0) {
386 if (strcmp(ctype,
"urgent") == 0) {
387 if (strcasecmp(cvalue,
"latest") == 0 ||
388 strcasecmp(cvalue,
"newest") == 0 ||
389 strcasecmp(cvalue,
"recent") == 0 ||
390 strcasecmp(cvalue,
"last") == 0) {
392 }
else if (strcasecmp(cvalue,
"oldest") == 0 ||
393 strcasecmp(cvalue,
"first") == 0) {
399 ELOG(
"Unknown criterion: %s\n", ctype);
410 DLOG(
"which=%s\n", which);
426 if (strcmp(which,
"next") == 0)
428 else if (strcmp(which,
"prev") == 0)
430 else if (strcmp(which,
"next_on_output") == 0)
432 else if (strcmp(which,
"prev_on_output") == 0)
434 else if (strcmp(which,
"current") == 0)
437 ELOG(
"BUG: called with which=%s\n", which);
447 cmd_output->needs_tree_render =
true;
463 yerror(
"No workspace was previously active.");
474 cmd_output->needs_tree_render =
true;
484 if (strncasecmp(name,
"__i3_", strlen(
"__i3_")) == 0) {
485 LOG(
"You cannot switch to the i3 internal workspaces.\n");
496 ELOG(
"No windows match your criteria, cannot move.\n");
506 LOG(
"should move window to workspace %s\n", name);
519 cmd_output->needs_tree_render =
true;
541 LOG(
"should move window to workspace %s\n", which);
543 Con *output, *workspace = NULL;
546 long parsed_num = strtol(which, &endptr, 10);
547 if (parsed_num == LONG_MIN ||
548 parsed_num == LONG_MAX ||
551 LOG(
"Could not parse initial part of \"%s\" as a number.\n", which);
553 yerror(
"Could not parse number");
559 child->
num == parsed_num);
574 cmd_output->needs_tree_render =
true;
580 LOG(
"floating resize\n");
587 if (strcmp(direction,
"up") == 0 || strcmp(direction,
"down") == 0 ||
588 strcmp(direction,
"height") == 0) {
592 px = (px < focused_con->height_increment) ? focused_con->
height_increment : px;
593 }
else if (strcmp(direction,
"left") == 0 || strcmp(direction,
"right") == 0) {
597 px = (px < focused_con->width_increment) ? focused_con->
width_increment : px;
600 if (strcmp(direction,
"up") == 0) {
602 }
else if (strcmp(direction,
"down") == 0 || strcmp(direction,
"height") == 0) {
604 }
else if (strcmp(direction,
"left") == 0) {
614 if (memcmp(&old_rect, &(floating_con->
rect),
sizeof(
Rect)) == 0)
617 if (strcmp(direction,
"up") == 0) {
619 }
else if (strcmp(direction,
"left") == 0) {
629 LOG(
"tiling resize\n");
631 Con *first = current;
633 if (!strcmp(direction,
"left"))
634 search_direction =
D_LEFT;
635 else if (!strcmp(direction,
"right"))
637 else if (!strcmp(direction,
"up"))
638 search_direction =
D_UP;
640 search_direction =
D_DOWN;
644 LOG(
"No second container in this direction found.\n");
651 LOG(
"ins. %d children\n", children);
652 double percentage = 1.0 / children;
653 LOG(
"default percentage = %f\n", percentage);
656 LOG(
"second->percent = %f\n", second->
percent);
657 LOG(
"first->percent before = %f\n", first->
percent);
662 double new_first_percent = first->
percent + ((double)ppt / 100.0);
663 double new_second_percent = second->
percent - ((double)ppt / 100.0);
664 LOG(
"new_first_percent = %f\n", new_first_percent);
665 LOG(
"new_second_percent = %f\n", new_second_percent);
670 first->
percent += ((double)ppt / 100.0);
671 second->
percent -= ((double)ppt / 100.0);
672 LOG(
"first->percent after = %f\n", first->
percent);
673 LOG(
"second->percent after = %f\n", second->
percent);
675 LOG(
"Not resizing, already at minimum size\n");
682 LOG(
"width/height resize\n");
686 current = current->
parent;
690 (strcmp(direction,
"width") == 0 ?
HORIZ :
VERT);
692 while (current->
type != CT_WORKSPACE &&
693 current->
type != CT_FLOATING_CON &&
695 current = current->
parent;
699 LOG(
"ins. %d children\n", children);
700 double percentage = 1.0 / children;
701 LOG(
"default percentage = %f\n", percentage);
705 if ((orientation ==
HORIZ &&
706 strcmp(direction,
"height") == 0) ||
707 (orientation ==
VERT &&
708 strcmp(direction,
"width") == 0)) {
709 LOG(
"You cannot resize in that direction. Your focus is in a %s split container currently.\n",
710 (orientation ==
HORIZ ?
"horizontal" :
"vertical"));
716 LOG(
"This is the only container, cannot resize.\n");
724 LOG(
"child->percent = %f (child %p)\n", child->
percent, child);
729 double new_current_percent = current->
percent + ((double)ppt / 100.0);
730 double subtract_percent = ((double)ppt / 100.0) / (children - 1);
731 LOG(
"new_current_percent = %f\n", new_current_percent);
732 LOG(
"subtract_percent = %f\n", subtract_percent);
736 if (child == current)
739 LOG(
"Not resizing, already at minimum size (child %p would end up with a size of %.f\n", child, child->
percent - subtract_percent);
745 LOG(
"Not resizing, already at minimum size\n");
750 current->
percent += ((double)ppt / 100.0);
751 LOG(
"current->percent after = %f\n", current->
percent);
754 if (child == current)
756 child->
percent -= subtract_percent;
757 LOG(
"child->percent after (%p) = %f\n", child, child->
percent);
769 DLOG(
"resizing in way %s, direction %s, px %s or ppt %s\n", way, direction, resize_px, resize_ppt);
771 int px = atoi(resize_px);
772 int ppt = atoi(resize_ppt);
773 if (strcmp(way,
"shrink") == 0) {
786 if (strcmp(direction,
"width") == 0 ||
787 strcmp(direction,
"height") == 0) {
797 cmd_output->needs_tree_render =
true;
807 DLOG(
"border style should be changed to %s with border width %s\n", border_style_str, border_width);
816 int tmp_border_width = -1;
817 tmp_border_width = strtol(border_width, &end, 10);
818 if (end == border_width) {
820 tmp_border_width = -1;
822 if (strcmp(border_style_str,
"toggle") == 0) {
826 tmp_border_width = 2;
827 else if (border_style ==
BS_NONE)
828 tmp_border_width = 0;
830 tmp_border_width = 1;
832 if (strcmp(border_style_str,
"normal") == 0)
834 else if (strcmp(border_style_str,
"pixel") == 0)
836 else if (strcmp(border_style_str,
"1pixel") == 0){
838 tmp_border_width = 1;
839 }
else if (strcmp(border_style_str,
"none") == 0)
842 ELOG(
"BUG: called with border_style=%s\n", border_style_str);
850 cmd_output->needs_tree_render =
true;
860 LOG(
"-------------------------------------------------\n");
861 LOG(
" NOP: %s\n", comment);
862 LOG(
"-------------------------------------------------\n");
870 LOG(
"Appending layout \"%s\"\n", path);
873 cmd_output->needs_tree_render =
true;
885 DLOG(
"which=%s\n", which);
887 if (strcmp(which,
"next") == 0)
889 else if (strcmp(which,
"prev") == 0)
891 else if (strcmp(which,
"next_on_output") == 0)
893 else if (strcmp(which,
"prev_on_output") == 0)
896 ELOG(
"BUG: called with which=%s\n", which);
903 cmd_output->needs_tree_render =
true;
913 Con *output, *workspace = NULL;
916 long parsed_num = strtol(which, &endptr, 10);
917 if (parsed_num == LONG_MIN ||
918 parsed_num == LONG_MAX ||
921 LOG(
"Could not parse initial part of \"%s\" as a number.\n", which);
923 yerror(
"Could not parse number");
930 child->
num == parsed_num);
933 LOG(
"There is no workspace with number %ld, creating a new one.\n", parsed_num);
936 cmd_output->needs_tree_render =
true;
943 cmd_output->needs_tree_render =
true;
955 cmd_output->needs_tree_render =
true;
965 if (strncasecmp(name,
"__i3_", strlen(
"__i3_")) == 0) {
966 LOG(
"You cannot switch to the i3 internal workspaces.\n");
971 DLOG(
"should switch to workspace %s\n", name);
976 cmd_output->needs_tree_render =
true;
986 DLOG(
"Clearing all windows which have that mark first\n");
990 if (con->
mark && strcmp(con->
mark, mark) == 0)
994 DLOG(
"marking window with str %s\n", mark);
1004 cmd_output->needs_tree_render =
true;
1019 DLOG(
"removed all window marks");
1023 if (con->
mark && strcmp(con->
mark, mark) == 0)
1026 DLOG(
"removed window mark %s\n", mark);
1029 cmd_output->needs_tree_render =
true;
1039 DLOG(
"mode=%s\n", mode);
1053 DLOG(
"should move window to output %s\n", name);
1058 Output *current_output = NULL;
1065 assert(current_output != NULL);
1068 if (strcasecmp(name,
"up") == 0)
1070 else if (strcasecmp(name,
"down") == 0)
1072 else if (strcasecmp(name,
"left") == 0)
1074 else if (strcasecmp(name,
"right") == 0)
1080 LOG(
"No such output found.\n");
1098 cmd_output->needs_tree_render =
true;
1110 DLOG(
"floating_mode=%s\n", floating_mode);
1116 if (strcmp(floating_mode,
"toggle") == 0) {
1117 DLOG(
"should toggle mode\n");
1120 DLOG(
"should switch mode to %s\n", floating_mode);
1121 if (strcmp(floating_mode,
"enable") == 0) {
1129 cmd_output->needs_tree_render =
true;
1139 DLOG(
"should move workspace to output %s\n", name);
1146 if (!current_output) {
1147 ELOG(
"Cannot get current output. This is a bug in i3.\n");
1153 ELOG(
"Could not get output from string \"%s\"\n", name);
1159 LOG(
"got output %p with content %p\n", output, content);
1161 Con *previously_visible_ws =
TAILQ_FIRST(&(content->nodes_head));
1162 LOG(
"Previously visible workspace = %p / %s\n", previously_visible_ws, previously_visible_ws->
name);
1165 LOG(
"should move workspace %p / %s\n", ws, ws->
name);
1169 LOG(
"Creating a new workspace to replace \"%s\" (last on its output).\n", ws->
name);
1172 bool used_assignment =
false;
1175 if (strcmp(assignment->
output, current_output->
name) != 0)
1179 Con *workspace = NULL, *out;
1182 !strcasecmp(child->name, assignment->
name));
1183 if (workspace != NULL)
1187 LOG(
"Creating workspace from assignment %s.\n", assignment->
name);
1189 used_assignment =
true;
1195 if (!used_assignment)
1199 ipc_send_event(
"workspace", I3_IPC_EVENT_WORKSPACE,
"{\"change\":\"init\"}");
1201 DLOG(
"Detaching\n");
1206 if (workspace_was_visible) {
1210 LOG(
"workspace was visible, focusing %p / %s now\n", focus_ws, focus_ws->
name);
1217 TAILQ_FOREACH(floating_con, &(ws->floating_head), floating_windows)
1220 ipc_send_event(
"workspace", I3_IPC_EVENT_WORKSPACE,
"{\"change\":\"move\"}");
1221 if (workspace_was_visible) {
1232 if (ws != previously_visible_ws)
1238 CALL(previously_visible_ws, on_remove_child);
1243 cmd_output->needs_tree_render =
true;
1255 LOG(
"splitting in direction %c\n", direction[0]);
1265 cmd_output->needs_tree_render =
true;
1275 if (kill_mode_str == NULL)
1276 kill_mode_str =
"window";
1279 DLOG(
"kill_mode=%s\n", kill_mode_str);
1282 if (strcmp(kill_mode_str,
"window") == 0)
1284 else if (strcmp(kill_mode_str,
"client") == 0)
1287 ELOG(
"BUG: called with kill_mode=%s\n", kill_mode_str);
1302 cmd_output->needs_tree_render =
true;
1312 bool no_startup_id = (nosn != NULL);
1314 DLOG(
"should execute %s, no_startup_id = %d\n", command, no_startup_id);
1326 DLOG(
"direction = *%s*\n", direction);
1328 if (strcmp(direction,
"left") == 0)
1330 else if (strcmp(direction,
"right") == 0)
1332 else if (strcmp(direction,
"up") == 0)
1334 else if (strcmp(direction,
"down") == 0)
1337 ELOG(
"Invalid focus direction (%s)\n", direction);
1342 cmd_output->needs_tree_render =
true;
1352 DLOG(
"window_mode = %s\n", window_mode);
1357 if (strcmp(window_mode,
"mode_toggle") == 0) {
1359 if (current != NULL && current->
type == CT_FLOATING_CON)
1360 window_mode =
"tiling";
1361 else window_mode =
"floating";
1364 if ((strcmp(window_mode,
"floating") == 0 && current->
type != CT_FLOATING_CON) ||
1365 (strcmp(window_mode,
"tiling") == 0 && current->
type == CT_FLOATING_CON))
1373 cmd_output->needs_tree_render =
true;
1383 DLOG(
"level = %s\n", level);
1384 bool success =
false;
1388 if (strcmp(level,
"parent") == 0) {
1393 ELOG(
"'focus parent': Currently in fullscreen, not going up\n");
1400 cmd_output->needs_tree_render = success;
1413 ELOG(
"You have to specify which window/container should be focused.\n");
1414 ELOG(
"Example: [class=\"urxvt\" title=\"irssi\"] focus\n");
1416 yerror(
"You have to specify which window/container should be focused");
1433 LOG(
"Cannot change focus while in fullscreen mode (fullscreen rules).\n");
1439 if (ws == __i3_scratch) {
1466 LOG(
"focusing %p / %s\n", current->
con, current->
con->
name);
1472 LOG(
"WARNING: Your criteria for the focus command matches %d containers, "
1473 "while only exactly one container can be focused at a time.\n", count);
1475 cmd_output->needs_tree_render =
true;
1485 if (fullscreen_mode == NULL)
1486 fullscreen_mode =
"output";
1487 DLOG(
"toggling fullscreen, mode = %s\n", fullscreen_mode);
1497 cmd_output->needs_tree_render =
true;
1508 int px = atoi(move_px);
1511 DLOG(
"moving in direction %s, px %s\n", direction, move_px);
1513 DLOG(
"floating move with %d pixels\n", px);
1515 if (strcmp(direction,
"left") == 0) {
1517 }
else if (strcmp(direction,
"right") == 0) {
1519 }
else if (strcmp(direction,
"up") == 0) {
1521 }
else if (strcmp(direction,
"down") == 0) {
1527 (strcmp(direction,
"left") == 0 ?
D_LEFT :
1528 (strcmp(direction,
"up") == 0 ?
D_UP :
1530 cmd_output->needs_tree_render =
true;
1542 if (strcmp(layout_str,
"stacking") == 0)
1543 layout_str =
"stacked";
1547 if (strcmp(layout_str,
"default") == 0)
1549 else if (strcmp(layout_str,
"stacked") == 0)
1551 else if (strcmp(layout_str,
"tabbed") == 0)
1553 else if (strcmp(layout_str,
"splitv") == 0)
1555 else if (strcmp(layout_str,
"splith") == 0)
1558 ELOG(
"Unknown layout \"%s\", this is a mismatch between code and parser spec.\n", layout_str);
1562 DLOG(
"changing layout to %s (%d)\n", layout_str, layout);
1574 cmd_output->needs_tree_render =
true;
1586 if (toggle_mode == NULL)
1587 toggle_mode =
"default";
1589 DLOG(
"toggling layout (mode = %s)\n", toggle_mode);
1601 cmd_output->needs_tree_render =
true;
1611 LOG(
"Exiting due to user command.\n");
1612 xcb_disconnect(
conn);
1629 ipc_send_event(
"workspace", I3_IPC_EVENT_WORKSPACE,
"{\"change\":\"reload\"}");
1642 LOG(
"restarting i3\n");
1654 LOG(
"opening new container\n");
1663 y(integer, (
long int)con);
1666 cmd_output->needs_tree_render =
true;
1676 DLOG(
"name = %s\n", name);
1681 Output *current_output = NULL;
1686 assert(current_output != NULL);
1691 LOG(
"No such output found.\n");
1706 cmd_output->needs_tree_render =
true;
1721 ELOG(
"Cannot change position. The window/container is not floating\n");
1722 yerror(
"Cannot change position. The window/container is not floating.");
1726 if (strcmp(method,
"absolute") == 0) {
1730 DLOG(
"moving to absolute position %d %d\n", x, y);
1732 cmd_output->needs_tree_render =
true;
1735 if (strcmp(method,
"position") == 0) {
1738 DLOG(
"moving to position %d %d\n", x, y);
1756 ELOG(
"Cannot change position. The window/container is not floating\n");
1757 yerror(
"Cannot change position. The window/container is not floating.");
1761 if (strcmp(method,
"absolute") == 0) {
1764 DLOG(
"moving to absolute center\n");
1769 cmd_output->needs_tree_render =
true;
1772 if (strcmp(method,
"position") == 0) {
1776 DLOG(
"moving to center\n");
1792 DLOG(
"should move window to scratchpad\n");
1802 cmd_output->needs_tree_render =
true;
1812 DLOG(
"should show scratchpad window\n");
1824 cmd_output->needs_tree_render =
true;
1835 LOG(
"Renaming workspace \"%s\" to \"%s\"\n", old_name, new_name);
1837 LOG(
"Renaming current workspace to \"%s\"\n", new_name);
1844 !strcasecmp(child->name, old_name));
1853 yerror(
"Old workspace not found");
1857 Con *check_dest = NULL;
1860 !strcasecmp(child->name, new_name));
1862 if (check_dest != NULL) {
1866 yerror(
"New workspace already exists");
1873 char *endptr = NULL;
1874 long parsed_num = strtol(new_name, &endptr, 10);
1875 if (parsed_num == LONG_MIN ||
1876 parsed_num == LONG_MAX ||
1879 workspace->
num = -1;
1880 else workspace->
num = parsed_num;
1881 LOG(
"num = %d\n", workspace->
num);
1891 cmd_output->needs_tree_render =
true;
1894 ipc_send_event(
"workspace", I3_IPC_EVENT_WORKSPACE,
"{\"change\":\"rename\"}");
1903 bool toggle =
false;
1904 if (strcmp(bar_mode,
"dock") == 0)
1906 else if (strcmp(bar_mode,
"hide") == 0)
1908 else if (strcmp(bar_mode,
"invisible") == 0)
1910 else if (strcmp(bar_mode,
"toggle") == 0)
1913 ELOG(
"Unknown bar mode \"%s\", this is a mismatch between code and parser spec.\n", bar_mode);
1917 bool changed_sth =
false;
1920 if (bar_id && strcmp(current->
id, bar_id) != 0)
1924 mode = (current->
mode + 1) % 2;
1926 DLOG(
"Changing bar mode of bar_id '%s' to '%s (%d)'\n", current->
id, bar_mode, mode);
1927 current->
mode = mode;
1934 if (bar_id && !changed_sth) {
1935 DLOG(
"Changing bar mode of bar_id %s failed, bar_id not found.\n", bar_id);
1947 int hidden_state = S_SHOW;
1948 bool toggle =
false;
1949 if (strcmp(bar_hidden_state,
"hide") == 0)
1950 hidden_state = S_HIDE;
1951 else if (strcmp(bar_hidden_state,
"show") == 0)
1952 hidden_state = S_SHOW;
1953 else if (strcmp(bar_hidden_state,
"toggle") == 0)
1956 ELOG(
"Unknown bar state \"%s\", this is a mismatch between code and parser spec.\n", bar_hidden_state);
1960 bool changed_sth =
false;
1963 if (bar_id && strcmp(current->
id, bar_id) != 0)
1969 DLOG(
"Changing bar hidden_state of bar_id '%s' to '%s (%d)'\n", current->
id, bar_hidden_state, hidden_state);
1977 if (bar_id && !changed_sth) {
1978 DLOG(
"Changing bar hidden_state of bar_id %s failed, bar_id not found.\n", bar_id);
1991 if (strcmp(bar_type,
"mode") == 0)
1993 else if (strcmp(bar_type,
"hidden_state") == 0)
1996 ELOG(
"Unknown bar option type \"%s\", this is a mismatch between code and parser spec.\n", bar_type);
2012 if (!strcmp(argument,
"toggle"))
2015 else if (!strcmp(argument,
"on"))
2017 else if (!strcmp(argument,
"off"))
2023 LOG(
"Restarting shm logging...\n");
2031 LOG(
"%s shm logging\n",
shmlog_size > 0 ?
"Enabling" :
"Disabling");
2044 if (!strcmp(argument,
"toggle")) {
2045 LOG(
"%s debug logging\n", logging ?
"Disabling" :
"Enabling");
2047 }
else if (!strcmp(argument,
"on") && !logging) {
2048 LOG(
"Enabling debug logging\n");
2050 }
else if (!strcmp(argument,
"off") && logging) {
2051 LOG(
"Disabling debug logging\n");