Changeset 5387:ec00c0a72024 in roaraudio for roarclients


Ignore:
Timestamp:
01/16/12 18:33:43 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added function to get serverinfo for library as well as libinfo command for roarctl to list those infos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarctl.c

    r5386 r5387  
    127127        "\n" 
    128128        "  serverinfo              - Gets general information about the server\n" 
     129        "  libinfo                 - Gets general information about the library (libroar)\n" 
    129130        "  servertime              - Gets server's time\n" 
    130131        "  serveroinfo             - Gets Information about server output\n" 
     
    270271#endif 
    271272 
    272 #define _pm(m,n) if ( info->m != NULL ) printf("Server %-15s: %s\n", (n), (info->m)); 
     273#define _pm(m,n) if ( info->m != NULL ) printf(con != NULL ? "Server %-15s: %s\n" : "Library %-14s: %s\n", (n), (info->m)); 
    273274void server_info (struct roar_connection * con) { 
    274  struct roar_server_info * info = roar_server_info(con); 
     275 struct roar_server_info * info = con != NULL ? roar_server_info(con) : roar_library_info(); 
    275276 long hostid; 
    276277 
     
    294295 
    295296  if ( hostid ) { 
    296    printf("Server %-15s: %s (%li.%li.%li.%li)\n", "HostID", info->hostid, 
     297   printf(con != NULL ? "Server %-15s: %s (%li.%li.%li.%li)\n" 
     298                      : "Library %-14s: %s (%li.%li.%li.%li)\n", "HostID", info->hostid, 
    297299           ((hostid & 0x00FF0000UL) >> 16UL), 
    298300           ((hostid & 0xFF000000UL) >> 24UL), 
     
    301303         ); 
    302304  } else { 
    303    printf("Server %-15s: %s\n", "HostID", info->hostid); 
     305   _pm(hostid, "HostID"); 
    304306  } 
    305307 } 
     
    13101312  } else if ( !strcmp(k, "serverinfo") ) { 
    13111313   server_info(&con); 
     1314  } else if ( !strcmp(k, "libinfo") ) { 
     1315   server_info(NULL); 
    13121316  } else if ( !strcmp(k, "servertime") ) { 
    13131317   server_time(&con); 
Note: See TracChangeset for help on using the changeset viewer.