2005-10-24 23:26:25 +08:00
|
|
|
/** \file env_universal.h
|
2006-11-19 05:24:59 +08:00
|
|
|
Universal variable client library.
|
2005-09-20 21:26:39 +08:00
|
|
|
*/
|
|
|
|
|
2005-10-04 23:11:39 +08:00
|
|
|
#ifndef ENV_UNIVERSAL_H
|
|
|
|
#define ENV_UNIVERSAL_H
|
|
|
|
|
|
|
|
#include <wchar.h>
|
2005-09-20 21:26:39 +08:00
|
|
|
|
|
|
|
#include "env_universal_common.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
Data about the universal variable server.
|
|
|
|
*/
|
|
|
|
extern connection_t env_universal_server;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Initialize the envuni library
|
|
|
|
*/
|
|
|
|
void env_universal_init();
|
2005-10-24 23:26:25 +08:00
|
|
|
/**
|
2005-09-20 21:26:39 +08:00
|
|
|
Free memory used by envuni
|
|
|
|
*/
|
|
|
|
void env_universal_destroy();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Get the value of a universal variable
|
|
|
|
*/
|
|
|
|
wchar_t *env_universal_get( const wchar_t *name );
|
2005-09-23 04:16:52 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
Get the export flag of the variable with the specified
|
|
|
|
name. Returns 0 if the variable doesn't exist.
|
|
|
|
*/
|
|
|
|
int env_universal_get_export( const wchar_t *name );
|
|
|
|
|
2005-09-20 21:26:39 +08:00
|
|
|
/**
|
|
|
|
Set the value of a universal variable
|
|
|
|
*/
|
2005-09-23 04:16:52 +08:00
|
|
|
void env_universal_set( const wchar_t *name, const wchar_t *val, int export );
|
2005-09-20 21:26:39 +08:00
|
|
|
/**
|
|
|
|
Erase a universal variable
|
2006-06-05 04:14:51 +08:00
|
|
|
|
|
|
|
\return zero if the variable existed, and non-zero if the variable did not exist
|
2005-09-20 21:26:39 +08:00
|
|
|
*/
|
2006-06-05 04:14:51 +08:00
|
|
|
int env_universal_remove( const wchar_t *name );
|
2005-09-20 21:26:39 +08:00
|
|
|
|
2005-10-03 21:24:46 +08:00
|
|
|
/**
|
|
|
|
Read all available messages from the server.
|
|
|
|
*/
|
2005-09-20 21:26:39 +08:00
|
|
|
int env_universal_read_all();
|
|
|
|
|
2005-10-03 21:24:46 +08:00
|
|
|
/**
|
|
|
|
Get the names of all universal variables
|
|
|
|
|
|
|
|
\param l the list to insert the names into
|
|
|
|
\param show_exported whether exported variables should be shown
|
|
|
|
\param show_unexported whether unexported variables should be shown
|
|
|
|
*/
|
2005-09-23 04:16:52 +08:00
|
|
|
void env_universal_get_names( array_list_t *l,
|
|
|
|
int show_exported,
|
|
|
|
int show_unexported );
|
|
|
|
|
2005-10-03 21:24:46 +08:00
|
|
|
/**
|
|
|
|
Synchronize with fishd
|
|
|
|
*/
|
2005-09-23 04:16:52 +08:00
|
|
|
void env_universal_barrier();
|
|
|
|
|
2005-09-20 21:26:39 +08:00
|
|
|
#endif
|