diff options
author | Lubos Lunak <l.lunak@ suse.cz> | 2006-03-14 13:30:01 +0000 |
---|---|---|
committer | Lubos Lunak <l.lunak@ suse.cz> | 2006-03-14 13:30:01 +0000 |
commit | 18f08afd4aab83465264909a1a9aee9abd766bf5 (patch) | |
tree | 8f3c1daaca9f511f86f933b55f8820520b90ec94 /lib | |
parent | 61fc70f0535ef027ff01a9b66ed143f7a631e909 (diff) |
Add convenience connectAndInit() functions.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/comm.c | 18 | ||||
-rw-r--r-- | lib/comm.h | 3 |
2 files changed, 21 insertions, 0 deletions
@@ -362,4 +362,22 @@ void dapi_windowInfoInitWindow( DapiWindowInfo* winfo, long window ) winfo->window = window; } +DapiConnection* dapi_connectAndInit() + { + return dapi_namedConnectAndInit( "" ); + } + +DapiConnection* dapi_namedConnectAndInit( const char* name ) + { + DapiConnection* conn = dapi_namedConnect( name ); + if( conn == NULL ) + return NULL; + if( !dapi_Init( conn )) + { + dapi_close( conn ); + return NULL; + } + return conn; + } + #include "../kde/gen/comm_generated.c" @@ -12,6 +12,9 @@ DapiConnection* dapi_namedConnect( const char* name ); void dapi_close( DapiConnection* conn ); int dapi_socket( DapiConnection* conn ); +DapiConnection* dapi_connectAndInit( void ); +DapiConnection* dapi_namedConnectAndInit( const char* name ); + int dapi_bindSocket( void ); int dapi_namedBindSocket( const char* name ); DapiConnection* dapi_acceptSocket( int sock ); |