Changeset 5373:8da157c10483 in roaraudio for include/libroar


Ignore:
Timestamp:
12/21/11 19:02:52 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:
  • Updated config structure
  • Added a flag to ask libroar to only connect to local servers
  • Added a way to override fork()
  • added support for +internal
Location:
include/libroar
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • include/libroar/config.h

    r5357 r5373  
    3939#include "libroar.h" 
    4040 
     41struct roar_connection; 
     42 
    4143// WorkAroundS: 
    4244#define ROAR_LIBROAR_CONFIG_WAS_NONE        0x00 
     
    6769 ROAR_LIBROAR_CONFIG_OPMODE_MS     = 2, 
    6870#define ROAR_LIBROAR_CONFIG_OPMODE_MS       ROAR_LIBROAR_CONFIG_OPMODE_MS 
     71}; 
     72 
     73struct roar_libroar_forkapi { 
     74 int   (*prefork)(void ** context, void * userdata); 
     75 pid_t (*fork   )(void ** context, void * userdata); 
     76 int   (*failed )(void ** context, void * userdata); 
     77 int   (*parent )(void ** context, void * userdata, pid_t child); 
     78 int   (*child  )(void ** context, void * userdata); 
     79 void * userdata; 
    6980}; 
    7081 
     
    115126#endif 
    116127 enum roar_libroar_config_opmode opmode; 
     128 struct roar_libroar_forkapi * forkapi; 
     129 struct roar_vio_calls * (*connect_internal)(struct roar_connection * con, const char * server, int type, int flags, uint_least32_t timeout); 
     130 char * daemonimage; 
     131 int serverflags; 
    117132}; 
    118133 
     
    129144const char * roar_libroar_get_server(void) _LIBROAR_ATTR_USE_RESULT; 
    130145 
     146int    roar_libroar_set_forkapi(struct roar_libroar_forkapi * api); 
     147 
     148int    roar_libroar_set_connect_internal(struct roar_vio_calls * (*func)(struct roar_connection * con, const char * server, int type, int flags, uint_least32_t timeout)); 
     149 
    131150void   roar_libroar_nowarn(void); 
    132151void   roar_libroar_warn(void); 
  • include/libroar/enumdev.h

    r4708 r5373  
    4040 
    4141#define ROAR_ENUM_FLAG_NONE         0x0000 /* no flags set                     */ 
    42 #define ROAR_ENUM_FLAG_DESC         0x0001 /* ask for server description       */ 
     42#define ROAR_ENUM_FLAG_DESC         0x0001 /* ask for server description     1 */ 
    4343#define ROAR_ENUM_FLAG_LOCATION     0x0002 /* ask for server location        1 */ 
    44 #define ROAR_ENUM_FLAG_NONBLOCK     0x0004 /* do not block                   1 */ 
     44#define ROAR_ENUM_FLAG_NONBLOCK     0x0004 /* do not block                     */ 
    4545#define ROAR_ENUM_FLAG_HARDNONBLOCK 0x0008 /* do even less block than NONBLOCK */ 
     46#define ROAR_ENUM_FLAG_LOCALONLY    0x0010 /* only list local servers          */ 
    4647/* 
    4748 * 1 = This is a request. The result may include or not include the data anyway. 
    48  *     This is only so the lib does not need to spend extra work if data is not needed. 
     49 *     This is only so the lib does not need to spend extra work when data is not needed. 
    4950 */ 
    5051 
  • include/libroar/libroar.h

    r5367 r5373  
    202202int roar_usleep(uint_least32_t t); 
    203203int roar_sleep(int t); 
     204pid_t roar_fork(const struct roar_libroar_forkapi * api); 
    204205 
    205206// call this function after we fork/exec()ed or similar. 
Note: See TracChangeset for help on using the changeset viewer.