Changeset 2463
- Timestamp:
- Jun 20, 2008, 1:42:06 PM (14 years ago)
- Location:
- neercs/trunk/src
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
neercs/trunk/src/Makefile.am
r2458 r2463 3 3 4 4 neercs_SOURCES = neercs.h mygetopt.c recurrent.c main.c screens.c term.c \ 5 grab.c effects.c wm.c screensaver.c attach.c 5 grab.c effects.c wm.c screensaver.c attach.c configuration.c 6 6 neercs_CFLAGS = @CACA_CFLAGS@ 7 7 neercs_LDADD = @CACA_LIBS@ @UTIL_LIBS@ @PAM_LIBS@ 8 -
neercs/trunk/src/main.c
r2458 r2463 77 77 int lock_offset = 0; 78 78 79 79 80 default_shell = getenv("SHELL"); 80 81 … … 113 114 return -1; 114 115 } 116 117 115 118 screen_list->count = 0; 116 119 screen_list->width = cucul_get_canvas_width(cv); … … 130 133 memset(screen_list->lockmsg, 0, 1024); 131 134 memset(screen_list->lockpass, 0, 1024); 135 136 137 if(!read_configuration_file("neercs.ini", screen_list)) 138 { 139 140 if(!read_configuration_file("~/neercs.ini", screen_list)) 141 { 142 if(!read_configuration_file("/etc/neercs.ini", screen_list)) 143 { 144 printf("Failed to read configuration file\n"); 145 } 146 } 147 } 148 132 149 133 150 recurrent_list = (struct recurrent_list*) malloc(sizeof(struct recurrent_list)); … … 449 466 450 467 free(screen_list->screen); 468 469 470 struct option *option = screen_list->config; 471 472 473 while(option) 474 { 475 struct option *kromeugnon = option; 476 option = option->next; 477 free(kromeugnon->key); 478 free(kromeugnon->value); 479 free(kromeugnon); 480 } 481 451 482 free(screen_list); 452 483 -
neercs/trunk/src/neercs.h
r2458 r2463 28 28 29 29 30 struct option 31 { 32 char *key; 33 char *value; 34 35 struct option *next; 36 }; 37 38 30 39 struct screen 31 40 { … … 83 92 int width, height; /* caca window size */ 84 93 struct screen **screen; /* Windows */ 94 95 struct option *config; 96 85 97 }; 86 98 … … 99 111 struct recurrent **recurrent; 100 112 }; 113 101 114 102 115 … … 177 190 178 191 192 193 /* Configuration file */ 194 int read_configuration_file(char *filename, struct screen_list *screen_list); 195 int parse_conf_line(char *buf, int size, struct screen_list *screen_list); 196 int get_key_value(char *line, struct option *option); 197 int fill_config(struct screen_list *screen_list); 198 179 199 #if 0 180 200 # define debug(f, z...) fprintf(stderr, f "\n", z)
Note: See TracChangeset
for help on using the changeset viewer.