Changeset 5828:d981716ace28 in roaraudio for roarclients
- Timestamp:
- 01/06/13 14:53:12 (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roarclients/roar-config.c
r5824 r5828 142 142 } 143 143 144 void list_path(int null_as_universal, const char * product, const char * provider) { 145 const char * names[32]; 146 char * path; 147 size_t offset = 0; 148 ssize_t ret; 149 ssize_t i; 150 const char * err; 151 size_t errlen; 152 153 while (1) { 154 ret = roar_libroar_list_path(names, sizeof(names)/sizeof(*names), offset); 155 if ( ret < 1 ) 156 break; 157 offset += (size_t)ret; 158 159 for (i = 0; i < ret; i++) { 160 path = roar_libroar_get_path(names[i], null_as_universal, product, provider); 161 if ( path == NULL && roar_error == ROAR_ERROR_INVAL ) 162 path = roar_libroar_get_path(names[i], 0, product, NULL); 163 if ( path == NULL && roar_error == ROAR_ERROR_INVAL ) 164 path = roar_libroar_get_path(names[i], 0, NULL, NULL); 165 if ( path == NULL ) { 166 err = roar_errorstring; 167 errlen = roar_mm_strlen(err) + roar_mm_strlen("<Error: >") + 1; 168 path = roar_mm_malloc(errlen); 169 if ( path == NULL ) 170 continue; 171 snprintf(path, errlen, "<Error: %s>", err); 172 } 173 174 printf("%-24s: %s\n", names[i], path); 175 roar_mm_free(path); 176 } 177 } 178 } 179 144 180 void print_renderpath(const char * path) { 145 181 char buf[1024]; … … 156 192 " roar-config --compare-versions VERSIONA OPERATOR VERSIONB\n" 157 193 " roar-config [{--output-pc|--output-normal}] [--libs] [--cflags] [LIB]\n" 158 " roar-config [--product PRODUCT] [--provider PROVIDER] [--universal] --path PATH\n"194 " roar-config [--product PRODUCT] [--provider PROVIDER] [--universal] {--path PATH|--list-path}\n" 159 195 " roar-config --render-path PATH\n"); 160 196 … … 166 202 " - Compare version A against B with operator OP.\n" 167 203 " --path NAME - Print path NAME\n" 168 " --product PRODUCT - Product string for --path\n" 169 " --provider PROVIDER - Provider string for --path\n" 170 " --universal - Use universal path for --path\n" 204 " --list-path - Print all known paths\n" 205 " --product PRODUCT - Product string for --path/--list-path\n" 206 " --provider PROVIDER - Provider string for --path/--list-path\n" 207 " --universal - Use universal path for --path/--list-path\n" 171 208 " --render-path PATH - Print a rendered path\n" 172 209 " --libs - Show linker flags (-lxxx) needed to link library\n" … … 211 248 } else if ( !strcmp(argv[i], "--path") ) { 212 249 print_path(argv[++i], null_as_universal, product, provider); 250 } else if ( !strcmp(argv[i], "--list-path") ) { 251 list_path(null_as_universal, product, provider); 213 252 } else if ( !strcmp(argv[i], "--render-path") ) { 214 253 print_renderpath(argv[++i]);
Note: See TracChangeset
for help on using the changeset viewer.