/[global]/global/libutil/conf.c
ViewVC logotype

Diff of /global/libutil/conf.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.42 by shigio, Thu Apr 7 06:09:20 2005 UTC revision 1.43 by shigio, Fri Apr 8 06:49:20 2005 UTC
# Line 57  static int allowed_nest_level = 8; Line 57  static int allowed_nest_level = 8;
57  static int opened;  static int opened;
58    
59  static void trim(char *);  static void trim(char *);
60  static char *readrecord(const char *);  static const char *readrecord(const char *);
61  static void includelabel(STRBUF *, const char *, int);  static void includelabel(STRBUF *, const char *, int);
62    
63  #ifndef isblank  #ifndef isblank
# Line 112  trim(l) Line 112  trim(l)
112   * o append following line.   * o append following line.
113   * o format check.   * o format check.
114   */   */
115  static char *  static const char *
116  readrecord(label)  readrecord(label)
117          const char *label;          const char *label;
118  {  {
# Line 135  readrecord(label) Line 135  readrecord(label)
135                  }                  }
136                  trim(p);                  trim(p);
137                  for (;;) {                  for (;;) {
138                          char *candidate;                          const char *candidate;
139                          /*                          /*
140                           * pick up candidate.                           * pick up candidate.
141                           */                           */
# Line 173  readrecord(label) Line 173  readrecord(label)
173   *      i)      label   record label   *      i)      label   record label
174   *      i)      level   nest level for check   *      i)      level   nest level for check
175   */   */
176  static  void  static void
177  includelabel(sb, label, level)  includelabel(sb, label, level)
178          STRBUF  *sb;          STRBUF  *sb;
179          const char *label;          const char *label;
180          int     level;          int     level;
181  {  {
182          char *savep, *p, *q;          const char *savep, *p, *q;
183    
184          if (++level > allowed_nest_level)          if (++level > allowed_nest_level)
185                  die("nested include= (or tc=) over flow.");                  die("nested include= (or tc=) over flow.");
# Line 197  includelabel(sb, label, level) Line 197  includelabel(sb, label, level)
197                  strbuf_close(inc);                  strbuf_close(inc);
198          }          }
199          strbuf_puts(sb, p);          strbuf_puts(sb, p);
200          free(savep);          free((void *)savep);
201  }  }
202  /*  /*
203   * configpath: get path of configuration file.   * configpath: get path of configuration file.
# Line 206  static char * Line 206  static char *
206  configpath(void)  configpath(void)
207  {  {
208          STATIC_STRBUF(sb);          STATIC_STRBUF(sb);
209          char *p;          const char *p;
210    
211          strbuf_clear(sb);          strbuf_clear(sb);
212          /*          /*
# Line 244  void Line 244  void
244  openconf(void)  openconf(void)
245  {  {
246          STRBUF *sb;          STRBUF *sb;
247          char *config;          const char *config;
248          extern int vflag;          extern int vflag;
249    
250          assert(opened == 0);          assert(opened == 0);
# Line 308  openconf(void) Line 308  openconf(void)
308    
309          if (!getconfs("suffixes", NULL)) {          if (!getconfs("suffixes", NULL)) {
310                  STRBUF *tmp = strbuf_open(0);                  STRBUF *tmp = strbuf_open(0);
311                  char *langmap = NULL;                  const char *langmap = NULL;
312    
313                  /*                  /*
314                   * Variable 'suffixes' is obsoleted. But it is generated                   * Variable 'suffixes' is obsoleted. But it is generated
# Line 332  openconf(void) Line 332  openconf(void)
332           * (Otherwise, nothing to do for gtags.)           * (Otherwise, nothing to do for gtags.)
333           */           */
334          if (!getconfs("GTAGS", NULL) && !getconfs("GRTAGS", NULL) && !getconfs("GSYMS", NULL)) {          if (!getconfs("GTAGS", NULL) && !getconfs("GRTAGS", NULL) && !getconfs("GSYMS", NULL)) {
335                  char *path;                  const char *path;
336    
337                  /*                  /*
338                   * usable search in BINDIR at first.                   * usable search in BINDIR at first.
# Line 377  getconfn(name, num) Line 377  getconfn(name, num)
377          const char *name;          const char *name;
378          int *num;          int *num;
379  {  {
380          char *p;          const char *p;
381          char buf[MAXPROPLEN+1];          char buf[MAXPROPLEN+1];
382    
383          if (!opened)          if (!opened)
# Line 403  getconfs(name, sb) Line 403  getconfs(name, sb)
403          const char *name;          const char *name;
404          STRBUF *sb;          STRBUF *sb;
405  {  {
406          char *p;          const char *p;
407          char buf[MAXPROPLEN+1];          char buf[MAXPROPLEN+1];
408          int all = 0;          int all = 0;
409          int exist = 0;          int exist = 0;
# Line 464  getconfb(name) Line 464  getconfb(name)
464  /*  /*
465   * getconfline: print loaded config entry.   * getconfline: print loaded config entry.
466   */   */
467  char *  const char *
468  getconfline(void)  getconfline(void)
469  {  {
470          if (!opened)          if (!opened)

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.43

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26