2005-10-24 15:26:25 +00:00
|
|
|
/** \file env_universal.h
|
2006-11-18 21:24:59 +00:00
|
|
|
Universal variable client library.
|
2005-09-20 13:26:39 +00:00
|
|
|
*/
|
|
|
|
|
2005-10-04 15:11:39 +00:00
|
|
|
#ifndef ENV_UNIVERSAL_H
|
|
|
|
#define ENV_UNIVERSAL_H
|
|
|
|
|
|
|
|
#include <wchar.h>
|
2005-09-20 13:26:39 +00:00
|
|
|
|
|
|
|
#include "env_universal_common.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
Data about the universal variable server.
|
|
|
|
*/
|
|
|
|
extern connection_t env_universal_server;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Initialize the envuni library
|
|
|
|
*/
|
2011-12-27 03:18:46 +00:00
|
|
|
void env_universal_init( wchar_t * p,
|
|
|
|
wchar_t *u,
|
|
|
|
void (*sf)(),
|
2012-10-08 21:47:25 +00:00
|
|
|
void (*cb)( fish_message_type_t type, const wchar_t *name, const wchar_t *val ));
|
2005-10-24 15:26:25 +00:00
|
|
|
/**
|
2005-09-20 13:26:39 +00:00
|
|
|
Free memory used by envuni
|
|
|
|
*/
|
|
|
|
void env_universal_destroy();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Get the value of a universal variable
|
|
|
|
*/
|
2012-02-23 19:25:46 +00:00
|
|
|
wchar_t *env_universal_get( const wcstring &name );
|
2005-09-22 20:16:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Get the export flag of the variable with the specified
|
|
|
|
name. Returns 0 if the variable doesn't exist.
|
|
|
|
*/
|
2012-05-09 10:06:10 +00:00
|
|
|
int env_universal_get_export( const wcstring &name );
|
2005-09-22 20:16:52 +00:00
|
|
|
|
2005-09-20 13:26:39 +00:00
|
|
|
/**
|
|
|
|
Set the value of a universal variable
|
|
|
|
*/
|
2012-05-09 10:06:10 +00:00
|
|
|
void env_universal_set( const wcstring &name, const wcstring &val, int exportv );
|
2005-09-20 13:26:39 +00:00
|
|
|
/**
|
|
|
|
Erase a universal variable
|
2011-12-27 03:18:46 +00:00
|
|
|
|
2006-06-04 20:14:51 +00:00
|
|
|
\return zero if the variable existed, and non-zero if the variable did not exist
|
2005-09-20 13:26:39 +00:00
|
|
|
*/
|
2006-06-04 20:14:51 +00:00
|
|
|
int env_universal_remove( const wchar_t *name );
|
2005-09-20 13:26:39 +00:00
|
|
|
|
2005-10-03 13:24:46 +00:00
|
|
|
/**
|
|
|
|
Read all available messages from the server.
|
|
|
|
*/
|
2005-09-20 13:26:39 +00:00
|
|
|
int env_universal_read_all();
|
|
|
|
|
2005-10-03 13:24:46 +00:00
|
|
|
/**
|
|
|
|
Get the names of all universal variables
|
2011-12-27 03:18:46 +00:00
|
|
|
|
2005-10-03 13:24:46 +00:00
|
|
|
\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
|
|
|
|
*/
|
2011-12-28 02:41:38 +00:00
|
|
|
void env_universal_get_names2( wcstring_list_t &list,
|
|
|
|
int show_exported,
|
|
|
|
int show_unexported );
|
2005-09-22 20:16:52 +00:00
|
|
|
|
2005-10-03 13:24:46 +00:00
|
|
|
/**
|
|
|
|
Synchronize with fishd
|
|
|
|
*/
|
2005-09-22 20:16:52 +00:00
|
|
|
void env_universal_barrier();
|
|
|
|
|
2005-09-20 13:26:39 +00:00
|
|
|
#endif
|