Changeset 5577:5d9bed8d3bc6 in roaraudio


Ignore:
Timestamp:
07/21/12 16:55:08 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

delay display of --list-proto until all plugins are loaded. Also indicate if protocol is a plugin based implementation

Location:
roard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • roard/clients.c

    r5576 r5577  
    11361136void print_protolist        (enum output_format format) { 
    11371137 struct roard_proto_handle * p; 
     1138 char flags[5] = "    "; 
    11381139 char subsys[7] = "      "; 
    11391140 const char * description; 
     
    11821183   continue; 
    11831184 
     1185  strncpy(flags, "    ", 4); 
    11841186  strncpy(subsys, "      ", 6); 
    11851187  description = "(none)"; 
     1188 
     1189  if ( p->lhandle != NULL ) 
     1190   flags[0] = 'P'; 
    11861191 
    11871192  switch (p->type) { 
     
    12121217  switch (format) { 
    12131218   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); 
    12151220    break; 
    12161221   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); 
    12181223    break; 
    12191224   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); 
    12211226    break; 
    12221227  } 
  • roard/roard.c

    r5567 r5577  
    4040 
    4141#include "roard.h" 
     42 
     43enum metaaction { 
     44 MA_ACTION, 
     45 MA_LIST_PROTO 
     46}; 
    4247 
    4348enum action { 
     
    14041409#endif 
    14051410#ifdef ROAR_HAVE_MAIN_ARGS 
     1411 enum metaaction metaaction = MA_ACTION; 
    14061412 enum action action = START; 
    14071413 int i; 
     
    21952201 
    21962202  } else if ( strcmp(k, "--list-proto") == 0 ) { 
    2197    print_protolist(print_format); 
    2198    return 0; 
     2203   metaaction = MA_LIST_PROTO; 
    21992204 
    22002205  } else if ( strcmp(k, "-t") == 0 || strcmp(k, "--tcp") == 0 ) { 
     
    23152320 
    23162321#ifdef ROAR_HAVE_MAIN_ARGS 
     2322 if ( metaaction != MA_ACTION ) 
     2323  action = START; 
     2324 
    23172325 switch (action) { 
    23182326  case START: 
     
    24502458 } 
    24512459 
     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 
    24522471 // we should handle this on microcontrollers, too. 
    24532472#if !defined(ROAR_TARGET_MICROCONTROLLER) && !defined(ROAR_TARGET_WIN32) 
Note: See TracChangeset for help on using the changeset viewer.