Exemplo n.º 1
0
int config68_init(int argc, char * argv[])
{
  config68_cat = msg68_cat("conf","config file", DEBUG_CONFIG68_O);
  option68_append(opts,sizeof(opts)/sizeof(*opts));
  argc = option68_parse(argc,argv);
  config68_use_registry = !config68_force_file && registry68_support();
  TRACE68(config68_cat,
          "conf68: will use %s\n",
          config68_use_registry?"registry":"config file");
  return argc;
}
Exemplo n.º 2
0
/* Get path from registry, converts '\' to '/' and adds missing trailing '/'.
 *
 * @return pointer to the end of string
 * @retval 0 error
 */
static char * get_reg_path(registry68_key_t key, char * kname,
                           char * buffer, int buflen)
{
  char * e = 0;

  if (registry68_support()) {
    int i = registry68_gets(key,kname,buffer,buflen);
    buffer[buflen-1] = 0;
    if (i >= 0) {
      for (e=buffer; *e; ++e) {
        if (*e == '\\') *e = '/';
      }
      if (e > buffer && e[-1] != '/') {
        *e++ = '/';
        *e = 0;
      }
    }
  }
  if (!e) buffer[0] = 0;
  return e;
}