Changeset 5387:ec00c0a72024 in roaraudio
- Timestamp:
- 01/16/12 18:33:43 (12 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile.inc
r5214 r5387 6 6 COMMON_VERSION = $(COMMON_V_MM).$(COMMON_V_REV) 7 7 COMMON_SOVERSION= 2 8 9 PKGDEFINES = -DPACKAGE_VERSION="\"$(VERSION)\"" -DDEVICE_VENDOR_ID=$(DEV_VENDOR) -DDEVICE_VENDOR_NAME="\"$(DEV_VENDOR_NAME)\"" -DDEVICE_VENDOR_STRING="\"$(DEV_VENDOR_STRING)\"" -DDISTRIBUTION_VERSION_STRING="\"$(DISTRIBUTION_VERSION_STRING)\"" 8 10 9 11 # libroar: -
include/libroar/serverinfo.h
r5381 r5387 59 59 60 60 struct roar_server_info * roar_server_info(struct roar_connection * con); 61 struct roar_server_info * roar_library_info(void); 61 62 int roar_server_info_free(struct roar_server_info * info); 62 63 -
libroar/Makefile
r5367 r5387 16 16 #DEFINES+= -D_LIBROAR_NOATTR_WARNINGS 17 17 INCLUDE = -I../include -I../include/libroar 18 CFLAGS += -g -Wall $(OPTI_O) $(DEFINES) $( INCLUDE) $(INCPATH) $(SHARED_CF) $(fPIC)18 CFLAGS += -g -Wall $(OPTI_O) $(DEFINES) $(PKGDEFINES) $(INCLUDE) $(INCPATH) $(SHARED_CF) $(fPIC) 19 19 LDFLAGS+= -g -Wall $(SHARED) $(LDPATH) 20 20 LIBS = $(LIBROAR_NS) -
libroar/serverinfo.c
r5381 r5387 36 36 #include "libroar.h" 37 37 38 // include for uname() used by roar_library_info() 39 #ifdef ROAR_HAVE_UNAME 40 #include <sys/utsname.h> 41 #endif 42 38 43 struct ie { 39 44 int type; … … 71 76 } 72 77 78 #ifdef ROAR_HAVE_GETHOSTID 79 #define _HOSTID_BUFLEN 64 80 #else 81 #define _HOSTID_BUFLEN 0 82 #endif 83 struct roar_server_info * roar_library_info(void) { 84 struct roar_server_info * ret = roar_mm_malloc(sizeof(struct roar_server_info) + _HOSTID_BUFLEN); 85 #ifdef ROAR_HAVE_UNAME 86 static struct utsname utsname; 87 static int utsname_inited = 0; 88 #endif 89 #ifdef ROAR_HAVE_GETHOSTID 90 long hostid; 91 char * hostidbuf = ((void*)ret) + sizeof(*ret); 92 #endif 93 94 if ( ret == NULL ) 95 return NULL; 96 97 memset(ret, 0, sizeof(struct roar_server_info)); 98 99 #if 0 100 + const char * version; 101 X const char * location; 102 X const char * description; 103 X const char * contact; 104 X const char * serial; 105 X const char * address; 106 X const char * uiurl; 107 const char * hostid; 108 + const char * license; 109 + const char * build; 110 + struct { 111 + const char * sysname; 112 + const char * release; 113 + const char * nodename; 114 + const char * machine; 115 + } un; 116 #endif 117 118 if ( DISTRIBUTION_VERSION_STRING[0] == 0 ) { 119 ret->version = "libroar/" PACKAGE_VERSION " <" DEVICE_VENDOR_STRING ">"; 120 } else { 121 ret->version = "libroar/" PACKAGE_VERSION " <" DEVICE_VENDOR_STRING "> (" DISTRIBUTION_VERSION_STRING ")"; 122 } 123 #ifdef ROAR_HAVE_GETHOSTID 124 hostid = gethostid(); 125 snprintf(hostidbuf, _HOSTID_BUFLEN, sizeof(long) == 8 ? "0x%.16lx" : "0x%.8lx", hostid); 126 ret->hostid = hostidbuf; 127 #endif 128 ret->license = ROAR_LICENSE_GPLv3_0; 129 ret->build = ROAR_BUILD_STAMP; 130 131 #ifdef ROAR_HAVE_UNAME 132 if ( !utsname_inited ) 133 if ( uname(&utsname) == 0 ) 134 utsname_inited = 1; 135 136 if ( utsname_inited ) { 137 ret->un.sysname = utsname.sysname; 138 ret->un.release = utsname.release; 139 ret->un.nodename = utsname.nodename; 140 ret->un.machine = utsname.machine; 141 } 142 #endif 143 #ifdef ROAR_HAVE_GETVERSIONEX 144 ret->un.sysname = "Windows"; 145 #endif 146 147 return ret; 148 } 149 73 150 int roar_server_info_free(struct roar_server_info * info) { 74 if ( info == NULL ) 151 if ( info == NULL ) { 152 roar_err_set(ROAR_ERROR_FAULT); 75 153 return -1; 154 } 76 155 77 156 roar_mm_free(info); -
roarclients/roarctl.c
r5386 r5387 127 127 "\n" 128 128 " serverinfo - Gets general information about the server\n" 129 " libinfo - Gets general information about the library (libroar)\n" 129 130 " servertime - Gets server's time\n" 130 131 " serveroinfo - Gets Information about server output\n" … … 270 271 #endif 271 272 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)); 273 274 void 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(); 275 276 long hostid; 276 277 … … 294 295 295 296 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, 297 299 ((hostid & 0x00FF0000UL) >> 16UL), 298 300 ((hostid & 0xFF000000UL) >> 24UL), … … 301 303 ); 302 304 } else { 303 printf("Server %-15s: %s\n", "HostID", info->hostid);305 _pm(hostid, "HostID"); 304 306 } 305 307 } … … 1310 1312 } else if ( !strcmp(k, "serverinfo") ) { 1311 1313 server_info(&con); 1314 } else if ( !strcmp(k, "libinfo") ) { 1315 server_info(NULL); 1312 1316 } else if ( !strcmp(k, "servertime") ) { 1313 1317 server_time(&con); -
roard/Makefile
r5270 r5387 16 16 #DEFINES = -DDEBUG 17 17 #DEFINES = -DMONITOR_LATENCY 18 PKGDEFINES= -DPACKAGE_VERSION="\"$(VERSION)\"" -DDEVICE_VENDOR_ID=$(DEV_VENDOR) -DDEVICE_VENDOR_NAME="\"$(DEV_VENDOR_NAME)\"" -DDEVICE_VENDOR_STRING="\"$(DEV_VENDOR_STRING)\"" -DDISTRIBUTION_VERSION_STRING="\"$(DISTRIBUTION_VERSION_STRING)\""19 18 INCLUDE = -I../include -I./include 20 19 CFLAGS += -g -Wall $(OPTI_O) $(DEFINES) $(PKGDEFINES) $(INCLUDE) $(INCPATH)
Note: See TracChangeset
for help on using the changeset viewer.