void tokz_warn_error(const Tokenizer *tokz, int line, int e) { if(e==E_TOKZ_UNEXPECTED_EOF) line=0; if(e<0) tokz_warn(tokz, line, "%s", strerror(-e)); else tokz_warn(tokz, line, "%s", TR(errors[e])); }
static bool check_splits(const Tokenizer *tokz, int l) { if(current_split!=NULL){ if(current_split->br!=NULL){ tokz_warn(tokz, l, "A split can only contain two subsplits or frames"); return FALSE; } }else{ if(current_ws->splitree!=NULL){ tokz_warn(tokz, l, "There can only be one frame or split at " "workspace level"); return FALSE; } } return TRUE; }
static bool opt_workspace_end(Tokenizer *tokz, int n, Token *toks) { if(current_ws->splitree==NULL){ tokz_warn(tokz, tokz->line, "Workspace empty"); destroy_thing((WThing*)current_ws); } current_ws=NULL; return TRUE; }
static bool opt_split_end(Tokenizer *tokz, int n, Token *toks) { WWsSplit *split=current_split; current_split=split->parent; if(split->br!=NULL) return TRUE; tokz_warn(tokz, tokz->line, "Split not full"); remove_split(current_ws, split); return TRUE; }
static bool opt_workspace(Tokenizer *tokz, int n, Token *toks) { char *name=TOK_STRING_VAL(&(toks[1])); if(*name=='\0'){ tokz_warn(tokz, toks[1].line, "Empty name"); return FALSE; } current_ws=create_workspace(current_screen, name, FALSE); if(current_ws==NULL) return FALSE; return TRUE; }