From 96148386827f7aa831865dc877a06034679422cc Mon Sep 17 00:00:00 2001 From: epoch Date: Thu, 25 Jun 2020 08:31:00 -0500 Subject: anything isspace() things is space is allowed as whitespace instead of just 0x20 --- src/hackvr.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/hackvr.c') diff --git a/src/hackvr.c b/src/hackvr.c index b789dbe..6dea5b9 100644 --- a/src/hackvr.c +++ b/src/hackvr.c @@ -1,4 +1,5 @@ #define _POSIX_C_SOURCE 200809L //for fileno and strdup +#include //isspace #include #include #include @@ -92,21 +93,21 @@ char **line_splitter(char *line,int *rlen) { char **a; int len,i=0; len=1;//we're just counting how much we'll need the first loop through. - for(i=0;line[i] && line[i] == ' ';i++);//skip leading space + for(i=0;line[i] && isspace(line[i]);i++);//skip leading space for(;line[i];len++) { - for(;line[i] && line[i] != ' ';i++);//skip rest of data - for(;line[i] && line[i] == ' ';i++);//skip rest of space + for(;line[i] && !isspace(line[i]);i++);//skip rest of data + for(;line[i] && isspace(line[i]);i++);//skip rest of space } a=malloc(sizeof(char *) * len+1); a[len]=0; len=0;//reuse! - for(i=0;line[i] && line[i] == ' ';i++);//skip leading space + for(i=0;line[i] && isspace(line[i]);i++);//skip leading space a[len]=line+i; for(;;) { - for(;line[i] && line[i] != ' ';i++);//skip rest of data + for(;line[i] && !isspace(line[i]);i++);//skip rest of data if(!line[i]) break; line[i++]=0; - for(;line[i] && line[i] == ' ';i++);//skip rest of space + for(;line[i] && isspace(line[i]);i++);//skip rest of space if(!line[i]) break; a[++len]=line+i; } -- cgit v1.2.3 From d9708580e6679a9b9924856b59b0133d15fda2c2 Mon Sep 17 00:00:00 2001 From: epoch Date: Sun, 5 Jul 2020 08:18:09 -0500 Subject: subsume got multiple group globbing and actually works again --- src/hackvr.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/hackvr.c') diff --git a/src/hackvr.c b/src/hackvr.c index 6dea5b9..775564a 100644 --- a/src/hackvr.c +++ b/src/hackvr.c @@ -156,7 +156,7 @@ int hackvr_handler(char *line) { int len; int j,i,k,l; unsigned int key_count; - c3_group_rel_t *gr; + c3_group_rel_t *gr,*pgr; real tmpx,tmpy,tmpz; char **a; char **keys; @@ -447,8 +447,21 @@ int hackvr_handler(char *line) { /* ---------- */ if(helping) fprintf(stderr,"# subsume child-group\n"); if(!strcmp(command,"subsume")) { - gr=get_group_relative(a[2]);//we need the child's group relative... - gr->parent = gr->id; + if(strchr(a[2],'*')) { + for(i=0;i < global.ht_group.kl;i++) { + for(m=global.ht_group.bucket[global.ht_group.keys[i]]->ll;m;m=m->next) { + if(!glob_match(id,m->original)) { + gr=m->target; + pgr=get_group_relative(id); + gr->parent = pgr->id; + } + } + } + } else { + gr=get_group_relative(a[2]);//we need the child's group relative... + pgr=get_group_relative(id); + gr->parent = pgr->id; + } ret=0; return ret; } -- cgit v1.2.3 From 9ff0ebb74c03433bac557d693b4684c01dc20e45 Mon Sep 17 00:00:00 2001 From: epoch Date: Fri, 17 Jul 2020 03:54:35 -0500 Subject: changed to using redrawplzkthx instead of force_redraw to request a redraw. force_redraw will now request /another/ directly after a previous draw so it does what it is named now. --- src/hackvr.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/hackvr.c') diff --git a/src/hackvr.c b/src/hackvr.c index 775564a..8abc0d6 100644 --- a/src/hackvr.c +++ b/src/hackvr.c @@ -134,6 +134,7 @@ void hvr_version() { int hackvr_handler(char *line); void hackvr_handler_idc(struct shit *me,char *line) { + //fprintf(stderr,"# got a hackvr line.\n"); switch(hackvr_handler(line)) { case -1://quit fprintf(stderr,"# exiting due to EOF\n"); @@ -419,7 +420,7 @@ int hackvr_handler(char *line) { #endif return ret; } - fprintf(stderr,"# %s toggled!\n",a[2]); + fprintf(stderr,"# %s toggled.\n",a[2]); ret=1; return ret; } @@ -744,9 +745,13 @@ int export_file(FILE *fp) {//not used yet. maybe export in obj optionally? no. t #ifdef GRAPHICAL void redraw_handler(struct shit *me,char *line) {//how do we strip out extra redraws? - if(gra_global.force_redraw) { + fprintf(stderr,"# attempting to redraw\n"); + if(gra_global.redrawplzkthx) {//this is how multiple calls to redraw() don't cause a flood of draw_screen(); draw_screen(); - gra_global.force_redraw=0; + gra_global.redrawplzkthx=0; + if(gra_global.force_redraw == 1) { + redraw();//wew. + } } } #endif -- cgit v1.2.3 From 96d65fff7bcf9552edef844cba723384f0051746 Mon Sep 17 00:00:00 2001 From: epoch Date: Fri, 17 Jul 2020 05:45:46 -0500 Subject: default build error messages less often --- src/hackvr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/hackvr.c') diff --git a/src/hackvr.c b/src/hackvr.c index 8abc0d6..1a72896 100644 --- a/src/hackvr.c +++ b/src/hackvr.c @@ -745,11 +745,12 @@ int export_file(FILE *fp) {//not used yet. maybe export in obj optionally? no. t #ifdef GRAPHICAL void redraw_handler(struct shit *me,char *line) {//how do we strip out extra redraws? - fprintf(stderr,"# attempting to redraw\n"); + //fprintf(stderr,"# attempting to redraw\n"); if(gra_global.redrawplzkthx) {//this is how multiple calls to redraw() don't cause a flood of draw_screen(); draw_screen(); gra_global.redrawplzkthx=0; if(gra_global.force_redraw == 1) { + fprintf(stderr,"# warning. force redrawing.\n"); redraw();//wew. } } -- cgit v1.2.3