aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib/libtinytac/lconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libtinytac/lconf.c')
-rw-r--r--lib/libtinytac/lconf.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/lib/libtinytac/lconf.c b/lib/libtinytac/lconf.c
index 0957127..b41590c 100644
--- a/lib/libtinytac/lconf.c
+++ b/lib/libtinytac/lconf.c
@@ -218,19 +218,19 @@ tinytac_conf(
218 tinytac_conf_file(SYSCONFDIR "/tinytac.conf"); 218 tinytac_conf_file(SYSCONFDIR "/tinytac.conf");
219 219
220 // process "~/tinytacrc" 220 // process "~/tinytacrc"
221 tinytacb_strlcpy(path, home, sizeof(path)); 221 bindle_strlcpy(path, home, sizeof(path));
222 tinytacb_strlcat(path, "/tinytacrc", sizeof(path)); 222 bindle_strlcat(path, "/tinytacrc", sizeof(path));
223 if (tinytac_conf_file(path) == TTAC_ESTOPINIT) 223 if (tinytac_conf_file(path) == TTAC_ESTOPINIT)
224 return(TTAC_SUCCESS); 224 return(TTAC_SUCCESS);
225 225
226 // process "~/.tinytacrc" 226 // process "~/.tinytacrc"
227 tinytacb_strlcpy(path, home, sizeof(path)); 227 bindle_strlcpy(path, home, sizeof(path));
228 tinytacb_strlcat(path, "/.tinytacrc", sizeof(path)); 228 bindle_strlcat(path, "/.tinytacrc", sizeof(path));
229 if (tinytac_conf_file(path) == TTAC_ESTOPINIT) 229 if (tinytac_conf_file(path) == TTAC_ESTOPINIT)
230 return(TTAC_SUCCESS); 230 return(TTAC_SUCCESS);
231 231
232 // process "./tinytacrc" 232 // process "./tinytacrc"
233 tinytacb_strlcpy(path, "./tinytacrc", sizeof(path)); 233 bindle_strlcpy(path, "./tinytacrc", sizeof(path));
234 if (tinytac_conf_file(path) == TTAC_ESTOPINIT) 234 if (tinytac_conf_file(path) == TTAC_ESTOPINIT)
235 return(TTAC_SUCCESS); 235 return(TTAC_SUCCESS);
236 236
@@ -243,22 +243,22 @@ tinytac_conf(
243 if ((tintacrc = getenv("TINYTACRC")) != NULL) 243 if ((tintacrc = getenv("TINYTACRC")) != NULL)
244 { 244 {
245 // process "~/${TINYTACRC}" 245 // process "~/${TINYTACRC}"
246 tinytacb_strlcpy(path, home, sizeof(path)); 246 bindle_strlcpy(path, home, sizeof(path));
247 tinytacb_strlcat(path, "/", sizeof(path)); 247 bindle_strlcat(path, "/", sizeof(path));
248 tinytacb_strlcat(path, tintacrc, sizeof(path)); 248 bindle_strlcat(path, tintacrc, sizeof(path));
249 if (tinytac_conf_file(path) == TTAC_ESTOPINIT) 249 if (tinytac_conf_file(path) == TTAC_ESTOPINIT)
250 return(TTAC_SUCCESS); 250 return(TTAC_SUCCESS);
251 251
252 // process "~/.{$TINYTACRC}" 252 // process "~/.{$TINYTACRC}"
253 tinytacb_strlcpy(path, home, sizeof(path)); 253 bindle_strlcpy(path, home, sizeof(path));
254 tinytacb_strlcat(path, "/.", sizeof(path)); 254 bindle_strlcat(path, "/.", sizeof(path));
255 tinytacb_strlcat(path, tintacrc, sizeof(path)); 255 bindle_strlcat(path, tintacrc, sizeof(path));
256 if (tinytac_conf_file(path) == TTAC_ESTOPINIT) 256 if (tinytac_conf_file(path) == TTAC_ESTOPINIT)
257 return(TTAC_SUCCESS); 257 return(TTAC_SUCCESS);
258 258
259 // process "./${TINYTACRC}" 259 // process "./${TINYTACRC}"
260 tinytacb_strlcpy(path, "./", sizeof(path)); 260 bindle_strlcpy(path, "./", sizeof(path));
261 tinytacb_strlcat(path, tintacrc, sizeof(path)); 261 bindle_strlcat(path, tintacrc, sizeof(path));
262 if (tinytac_conf_file(path) == TTAC_ESTOPINIT) 262 if (tinytac_conf_file(path) == TTAC_ESTOPINIT)
263 return(TTAC_SUCCESS); 263 return(TTAC_SUCCESS);
264 }; 264 };
@@ -287,8 +287,8 @@ tinytac_conf_environment(
287 opt = &tinytac_conf_options[pos]; 287 opt = &tinytac_conf_options[pos];
288 if (opt->opt_id == TTAC_OPT_STOPINIT) 288 if (opt->opt_id == TTAC_OPT_STOPINIT)
289 continue; 289 continue;
290 tinytacb_strlcpy(varname, "TINYTAC_", sizeof(varname)); 290 bindle_strlcpy(varname, "TINYTAC_", sizeof(varname));
291 tinytacb_strlcat(varname, opt->opt_name, sizeof(varname)); 291 bindle_strlcat(varname, opt->opt_name, sizeof(varname));
292 if ((value = getenv(varname)) != NULL) 292 if ((value = getenv(varname)) != NULL)
293 tinytac_conf_opt(opt, value); 293 tinytac_conf_opt(opt, value);
294 }; 294 };
@@ -326,36 +326,36 @@ tinytac_conf_file(
326 326
327 while( ((len)) && (rc == TTAC_SUCCESS) ) 327 while( ((len)) && (rc == TTAC_SUCCESS) )
328 { 328 {
329 if ((len = tinytacb_readline(fd, buff, sizeof(buff))) == -1) 329 if ((len = bindle_readline(fd, buff, sizeof(buff))) == -1)
330 { 330 {
331 close(fd); 331 close(fd);
332 return(TTAC_EUNKNOWN); 332 return(TTAC_EUNKNOWN);
333 }; 333 };
334 if (!(len)) 334 if (!(len))
335 continue; 335 continue;
336 if (tinytacb_strtoargs(buff, &argv, &argc) != TTAC_SUCCESS) 336 if (bindle_strtoargs(buff, &argv, &argc) != TTAC_SUCCESS)
337 { 337 {
338 close(fd); 338 close(fd);
339 return(TTAC_ESYNTAX); 339 return(TTAC_ESYNTAX);
340 }; 340 };
341 if ( (argc < 1) || (argc > 2) ) 341 if ( (argc < 1) || (argc > 2) )
342 { 342 {
343 tinytacb_strsfree(argv); 343 bindle_strsfree(argv);
344 continue; 344 continue;
345 }; 345 };
346 if ((opt = tinytac_opt_lookup_name(argv[0])) == NULL) 346 if ((opt = tinytac_opt_lookup_name(argv[0])) == NULL)
347 { 347 {
348 tinytacb_strsfree(argv); 348 bindle_strsfree(argv);
349 continue; 349 continue;
350 }; 350 };
351 val = tinytacb_strexpand(value, argv[1], sizeof(value), TTAC_NO); 351 val = bindle_strexpand(value, argv[1], sizeof(value), TTAC_NO);
352 switch(tinytac_conf_opt(opt, val)) 352 switch(tinytac_conf_opt(opt, val))
353 { 353 {
354 case TTAC_ESTOPINIT: rc = TTAC_ESTOPINIT; break; 354 case TTAC_ESTOPINIT: rc = TTAC_ESTOPINIT; break;
355 case TTAC_ENOMEM: rc = TTAC_ENOMEM; break; 355 case TTAC_ENOMEM: rc = TTAC_ENOMEM; break;
356 default: break; 356 default: break;
357 }; 357 };
358 tinytacb_strsfree(argv); 358 bindle_strsfree(argv);
359 }; 359 };
360 360
361 close(fd); 361 close(fd);
@@ -461,7 +461,7 @@ tinytac_conf_opt_flag(
461 461
462 TinyTacDebugTrace(); 462 TinyTacDebugTrace();
463 463
464 switch(i = ((value)) ? tinytacb_strtobool(value) : TTAC_YES) 464 switch(i = ((value)) ? bindle_strtobool(value) : TTAC_YES)
465 { 465 {
466 case TTAC_NO: return(tinytac_set_option(NULL, (int)opt->opt_id, &i)); 466 case TTAC_NO: return(tinytac_set_option(NULL, (int)opt->opt_id, &i));
467 case TTAC_YES: return(tinytac_set_option(NULL, (int)opt->opt_id, &i)); 467 case TTAC_YES: return(tinytac_set_option(NULL, (int)opt->opt_id, &i));