Changeset 5577:5d9bed8d3bc6 in roaraudio for roard
- Timestamp:
- 07/21/12 16:55:08 (12 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roard
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/clients.c
r5576 r5577 1136 1136 void print_protolist (enum output_format format) { 1137 1137 struct roard_proto_handle * p; 1138 char flags[5] = " "; 1138 1139 char subsys[7] = " "; 1139 1140 const char * description; … … 1182 1183 continue; 1183 1184 1185 strncpy(flags, " ", 4); 1184 1186 strncpy(subsys, " ", 6); 1185 1187 description = "(none)"; 1188 1189 if ( p->lhandle != NULL ) 1190 flags[0] = 'P'; 1186 1191 1187 1192 switch (p->type) { … … 1212 1217 switch (format) { 1213 1218 case FORMAT_NATIVE: 1214 printf(" %- 13s %s - %s\n", roar_proto2str(p->proto), subsys, description);1219 printf(" %-8s %s %s - %s\n", roar_proto2str(p->proto), flags, subsys, description); 1215 1220 break; 1216 1221 case FORMAT_WIKI: 1217 printf("||%s || ||%s ||%s ||\n", roar_proto2str(p->proto), subsys, description);1222 printf("||%s ||%s ||%s ||%s ||\n", roar_proto2str(p->proto), flags, subsys, description); 1218 1223 break; 1219 1224 case FORMAT_CSV: 1220 printf("%s, ,%s,%s\n", roar_proto2str(p->proto), subsys, description);1225 printf("%s,%s,%s,%s\n", roar_proto2str(p->proto), flags, subsys, description); 1221 1226 break; 1222 1227 } -
roard/roard.c
r5567 r5577 40 40 41 41 #include "roard.h" 42 43 enum metaaction { 44 MA_ACTION, 45 MA_LIST_PROTO 46 }; 42 47 43 48 enum action { … … 1404 1409 #endif 1405 1410 #ifdef ROAR_HAVE_MAIN_ARGS 1411 enum metaaction metaaction = MA_ACTION; 1406 1412 enum action action = START; 1407 1413 int i; … … 2195 2201 2196 2202 } else if ( strcmp(k, "--list-proto") == 0 ) { 2197 print_protolist(print_format); 2198 return 0; 2203 metaaction = MA_LIST_PROTO; 2199 2204 2200 2205 } else if ( strcmp(k, "-t") == 0 || strcmp(k, "--tcp") == 0 ) { … … 2315 2320 2316 2321 #ifdef ROAR_HAVE_MAIN_ARGS 2322 if ( metaaction != MA_ACTION ) 2323 action = START; 2324 2317 2325 switch (action) { 2318 2326 case START: … … 2450 2458 } 2451 2459 2460 #ifdef ROAR_HAVE_MAIN_ARGS 2461 // check meta action now as everything is set up. 2462 switch (metaaction) { 2463 case MA_ACTION: /* noop */; break; 2464 case MA_LIST_PROTO: 2465 print_protolist(print_format); 2466 return 0; 2467 break; 2468 } 2469 #endif 2470 2452 2471 // we should handle this on microcontrollers, too. 2453 2472 #if !defined(ROAR_TARGET_MICROCONTROLLER) && !defined(ROAR_TARGET_WIN32)
Note: See TracChangeset
for help on using the changeset viewer.