X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcfgparse.y;h=99367adbd0126d081e5d25fce8042cea0a54a5f0;hb=93600ce0fdad72f4820c673498e4cc4d3dc330f2;hp=e2b034126c1ae8902e68cad5a9dca5e4733befef;hpb=a542515f9efa4c0211c24baf5f17edc0badd98eb;p=i3%2Fi3 diff --git a/src/cfgparse.y b/src/cfgparse.y index e2b03412..99367adb 100644 --- a/src/cfgparse.y +++ b/src/cfgparse.y @@ -3,25 +3,12 @@ * vim:ts=8:expandtab * */ -#include -#include -#include #include #include #include #include -#include -#include - -#include "data.h" -#include "config.h" -#include "i3.h" -#include "util.h" -#include "queue.h" -#include "table.h" -#include "workspace.h" -#include "xcb.h" -#include "log.h" + +#include "all.h" typedef struct yy_buffer_state *YY_BUFFER_STATE; extern int yylex(struct context *context); @@ -70,7 +57,7 @@ void parse_file(const char *f) { if (fstat(fd, &stbuf) == -1) die("Could not fstat file: %s\n", strerror(errno)); - buf = smalloc(stbuf.st_size * sizeof(char)); + buf = scalloc((stbuf.st_size + 1) * sizeof(char)); while (read_bytes < stbuf.st_size) { if ((ret = read(fd, buf + read_bytes, (stbuf.st_size - read_bytes))) < 0) die("Could not read(): %s\n", strerror(errno)); @@ -372,6 +359,7 @@ new_container: DLOG("new containers will be in mode %d\n", $3); config.container_mode = $3; +#if 0 /* We also need to change the layout of the already existing * workspaces here. Workspaces may exist at this point because * of the other directives which are modifying workspaces @@ -388,6 +376,7 @@ new_container: ws->table[0][0], config.container_mode); } +#endif } | TOKNEWCONTAINER WHITESPACE TOKSTACKLIMIT WHITESPACE TOKSTACKLIMIT WHITESPACE NUMBER { @@ -395,6 +384,7 @@ new_container: config.container_stack_limit = $5; config.container_stack_limit_value = $7; +#if 0 /* See the comment above */ Workspace *ws; TAILQ_FOREACH(ws, workspaces, workspaces) { @@ -404,6 +394,7 @@ new_container: con->stack_limit = config.container_stack_limit; con->stack_limit_value = config.container_stack_limit_value; } +#endif } ; @@ -454,12 +445,14 @@ workspace: if (ws_num < 1) { DLOG("Invalid workspace assignment, workspace number %d out of range\n", ws_num); } else { +#if 0 Workspace *ws = workspace_get(ws_num - 1); ws->preferred_output = $7; if ($8 != NULL) { workspace_set_name(ws, $8); free($8); } +#endif } } | TOKWORKSPACE WHITESPACE NUMBER WHITESPACE workspace_name @@ -469,10 +462,12 @@ workspace: DLOG("Invalid workspace assignment, workspace number %d out of range\n", ws_num); } else { DLOG("workspace name to: %s\n", $5); +#if 0 if ($5 != NULL) { workspace_set_name(workspace_get(ws_num - 1), $5); free($5); } +#endif } } ; @@ -491,6 +486,7 @@ workspace_name: assign: TOKASSIGN WHITESPACE window_class WHITESPACE optional_arrow assign_target { +#if 0 printf("assignment of %s\n", $3); struct Assignment *new = $6; @@ -498,29 +494,36 @@ assign: printf(" floating = %d\n", new->floating); new->windowclass_title = $3; TAILQ_INSERT_TAIL(&assignments, new, assignments); +#endif } ; assign_target: NUMBER { +#if 0 struct Assignment *new = scalloc(sizeof(struct Assignment)); new->workspace = $1; new->floating = ASSIGN_FLOATING_NO; $$ = new; +#endif } | '~' { +#if 0 struct Assignment *new = scalloc(sizeof(struct Assignment)); new->floating = ASSIGN_FLOATING_ONLY; $$ = new; +#endif } | '~' NUMBER { +#if 0 struct Assignment *new = scalloc(sizeof(struct Assignment)); new->workspace = $2; new->floating = ASSIGN_FLOATING; $$ = new; +#endif } ; @@ -584,7 +587,7 @@ colorpixel: char *hex; if (asprintf(&hex, "#%s", $2) == -1) die("asprintf()"); - $$ = get_colorpixel(global_conn, hex); + $$ = get_colorpixel(hex); free(hex); } ;