Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

env_universal_common.h

00001 #ifndef FISH_ENV_UNIVERSAL_COMMON_H
00002 #define FISH_ENV_UNIVERSAL_COMMON_H
00003 
00004 #include <wchar.h>
00005 
00006 #include "util.h"
00007 
00011 #define SET_STR L"SET"
00012 
00016 #define SET_EXPORT_STR L"SET_EXPORT"
00017 
00021 #define ERASE_STR L"ERASE"
00022 
00026 #define BARRIER_STR L"BARRIER"
00027 
00031 #define BARRIER_REPLY_STR L"BARRIER_REPLY"
00032 
00033 
00037 #define SOCK_FILENAME "fishd.socket."
00038 
00042 enum
00043 {
00044         SET,
00045         SET_EXPORT,
00046         ERASE,
00047         BARRIER,
00048         BARRIER_REPLY,
00049 }
00050         ;
00051 
00055 #define ENV_UNIVERSAL_BUFFER_SIZE 1024
00056 
00060 typedef struct connection
00061 {
00065         int fd;
00069         dyn_queue_t unsent;
00073         int killme;
00078         buffer_t input;
00079         
00083         char buffer[ENV_UNIVERSAL_BUFFER_SIZE];
00084 
00088         int buffer_consumed;
00089         
00093         int buffer_used;
00094         
00095 
00099         struct connection *next;
00100 }
00101         connection_t;
00102 
00106 typedef struct 
00107 {
00111         int count;
00115         char body[1];
00116 }
00117         message_t;
00118 
00122 void read_message( connection_t * );
00123 
00127 void try_send_all( connection_t *c );
00128 
00132 message_t *create_message( int type, const wchar_t *key, const wchar_t *val );
00133 
00137 void env_universal_common_init(void (*cb)(int type, const wchar_t *key, const wchar_t *val ) );
00138 
00142 void env_universal_common_destroy();
00143 
00150 void env_universal_common_get_names( array_list_t *l,
00151                                                                          int show_exported,
00152                                                                          int show_unexported );
00153 
00163 void env_universal_common_set( const wchar_t *key, const wchar_t *val, int export );
00164 
00174 void env_universal_common_remove( const wchar_t *key );
00175 
00182 wchar_t *env_universal_common_get( const wchar_t *name );
00183 
00191 int env_universal_common_get_export( const wchar_t *name );
00192 
00196 void enqueue_all( connection_t *c );
00197 
00202 void connection_init( connection_t *c, int fd );
00203 
00209 void connection_destroy( connection_t *c);
00210 
00211 #endif

Generated on Sun Jan 13 02:52:28 2008 for fish by  doxygen 1.4.4