Changeset 5810:d44ff4605fa5 in roaraudio for libroar/config.c


Ignore:
Timestamp:
01/05/13 00:56:36 (9 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added a lot paths to our path config (roar_libroar_get_path())

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/config.c

    r5791 r5810  
    439439 const char * name; 
    440440 const char * path; 
    441  const int    with_product; 
     441 const int    with_product; // 0 = no, 1 = yes, 2 = just product. 
    442442 const int    with_provider; 
    443443} __paths[] = { 
    444444 {"prefix",     ROAR_PREFIX, 0, 0}, 
    445445 {"prefix-bin", ROAR_PREFIX_BIN, 0, 0}, 
     446 {"prefix-sbin", ROAR_PREFIX_SBIN, 0, 0}, 
    446447 {"prefix-lib", ROAR_PREFIX_LIB, 0, 0}, 
    447448 {"prefix-inc", ROAR_PREFIX_INC, 0, 0}, 
    448449 {"prefix-man", ROAR_PREFIX_MAN, 0, 0}, 
    449  {"prefix-pc",  ROAR_PREFIX_PC, 0, 0}, 
    450  {"prefix-ckport",  ROAR_PREFIX_CKPORT, 0, 0}, 
    451  {"prefix-comp-libs", ROAR_PREFIX_COMP_LIBS, 0, 0}, 
    452  {"prefix-comp-bins", ROAR_PREFIX_COMP_BINS, 0, 0}, 
    453  {"prefix-plugins", ROAR_PREFIX_PLUGINS, 1, 1}, 
     450 {"prefix-man1", ROAR_PREFIX_MAN "/man1", 0, 0}, 
     451 {"prefix-man2", ROAR_PREFIX_MAN "/man2", 0, 0}, 
     452 {"prefix-man3", ROAR_PREFIX_MAN "/man3", 0, 0}, 
     453 {"prefix-man4", ROAR_PREFIX_MAN "/man4", 0, 0}, 
     454 {"prefix-man5", ROAR_PREFIX_MAN "/man5", 0, 0}, 
     455 {"prefix-man6", ROAR_PREFIX_MAN "/man6", 0, 0}, 
     456 {"prefix-man7", ROAR_PREFIX_MAN "/man7", 0, 0}, 
     457 {"prefix-man8", ROAR_PREFIX_MAN "/man8", 0, 0}, 
     458 {"prefix-man9", ROAR_PREFIX_MAN "/man9", 0, 0}, 
     459 {"prefix-pc",          ROAR_PREFIX_PC, 0, 0}, 
     460 {"prefix-ckport",      ROAR_PREFIX_CKPORT, 0, 0}, 
     461 {"prefix-sysconf",     ROAR_PREFIX_SYSCONF, 0, 0}, 
     462 {"prefix-dev",         ROAR_PREFIX_DEV, 0, 0}, 
     463 {"prefix-doc",         ROAR_PREFIX_DOC, 2, 0}, 
     464 {"prefix-tmp",         ROAR_PREFIX_TMP, 0, 0}, 
     465 {"prefix-var",         ROAR_PREFIX_VAR, 0, 0}, 
     466 {"prefix-cache",       ROAR_PREFIX_CACHE, 2, 0}, 
     467 {"prefix-data",        ROAR_PREFIX_DATA, 2, 0}, 
     468 {"prefix-lock",        ROAR_PREFIX_LOCK, 0, 0}, 
     469 {"prefix-log",         ROAR_PREFIX_LOG, 0, 0}, 
     470 {"prefix-mail",        ROAR_PREFIX_MAIL, 0, 0}, 
     471 {"prefix-run",         ROAR_PREFIX_RUN, 0, 0}, 
     472 {"prefix-spool",       ROAR_PREFIX_SPOOL, 2, 0}, 
     473 {"prefix-comp-libs",   ROAR_PREFIX_COMP_LIBS, 0, 0}, 
     474 {"prefix-comp-bins",   ROAR_PREFIX_COMP_BINS, 0, 0}, 
     475 {"prefix-plugins",     ROAR_PREFIX_PLUGINS, 1, 1}, 
    454476 {"prefix-buildsystem", ROAR_PREFIX_BUILDSYSTEM, 0, 0} 
    455477}; 
    456478 
    457 static int __product2path(char * path, size_t pathlen, int null_as_universal, const char * product) { 
     479static int __product2path(char * path, size_t pathlen, int null_as_universal, const char * product, int type) { 
    458480 const char * c; 
    459481 const char * e; 
     
    463485 if ( product == NULL ) { 
    464486  if ( null_as_universal ) { 
    465    snprintf(path, pathlen, "/universal/universal"); 
     487   if ( type == 2 ) { 
     488    snprintf(path, pathlen, "/universal"); 
     489   } else { 
     490    snprintf(path, pathlen, "/universal/universal"); 
     491   } 
    466492  } else { 
    467493   path[0] = 0; 
     
    483509 s = strstr(c, "/"); 
    484510 
    485  if ( s == NULL ) { 
     511 if ( type == 2 ) { 
     512  snprintf(path, pathlen, "/%.*s", (int)(size_t)(b-product), product); 
     513 } else if ( s == NULL ) { 
    486514  snprintf(path, pathlen, "/unreg-%.*s/%.*s", (int)(size_t)(e-c), c, (int)(size_t)(b-product), product); 
    487515 } else { 
     
    548576  } 
    549577 
    550   if ( __product2path(buf_product, sizeof(buf_product), null_as_universal, product) == -1 ) 
     578  if ( __product2path(buf_product, sizeof(buf_product), null_as_universal, product, __paths[i].with_product) == -1 ) 
    551579   return NULL; 
    552580 
Note: See TracChangeset for help on using the changeset viewer.