Second version of that patch. Rich. -- Emerging Technologies, Red Hat http://et.redhat.com/~rjones/ 64 Baker Street, London, W1U 7DF Mobile: +44 7866 314 421 "[Negative numbers] darken the very whole doctrines of the equations and make dark of the things which are in their nature excessively obvious and simple" (Francis Maseres FRS, mathematician, 1759)
diff --git a/src/conf.c b/src/conf.c index b59daef..fbe7555 100644 --- a/src/conf.c +++ b/src/conf.c @@ -146,7 +146,8 @@ virConfFreeValue(virConfValuePtr val) free(val); } -virConfPtr virConfNew(void) +virConfPtr +_virConfNew(void) { virConfPtr ret; @@ -694,7 +695,7 @@ error: ************************************************************************/ /** - * virConfReadFile: + * _virConfReadFile: * @filename: the path to the configuration file. * * Reads a configuration file. @@ -703,7 +704,7 @@ error: * read or parse the file, use virConfFree() to free the data. */ virConfPtr -virConfReadFile(const char *filename) +_virConfReadFile(const char *filename) { char content[4096]; int fd; @@ -728,7 +729,7 @@ virConfReadFile(const char *filename) } /** - * virConfReadMem: + * _virConfReadMem: * @memory: pointer to the content of the configuration file * @len: lenght in byte * @@ -739,7 +740,7 @@ virConfReadFile(const char *filename) * parse the content, use virConfFree() to free the data. */ virConfPtr -virConfReadMem(const char *memory, int len) +_virConfReadMem(const char *memory, int len) { if ((memory == NULL) || (len < 0)) { virConfError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__, 0); @@ -752,7 +753,7 @@ virConfReadMem(const char *memory, int len) } /** - * virConfFree: + * _virConfFree: * @conf: a configuration file handle * * Frees all data associated to the handle @@ -760,7 +761,7 @@ virConfReadMem(const char *memory, int len) * Returns 0 in case of success, -1 in case of error. */ int -virConfFree(virConfPtr conf) +_virConfFree(virConfPtr conf) { virConfEntryPtr tmp; if (conf == NULL) { @@ -784,7 +785,7 @@ virConfFree(virConfPtr conf) } /** - * virConfGetValue: + * _virConfGetValue: * @conf: a configuration file handle * @entry: the name of the entry * @@ -794,7 +795,7 @@ virConfFree(virConfPtr conf) * associated will be freed when virConfFree() is called */ virConfValuePtr -virConfGetValue(virConfPtr conf, const char *setting) +_virConfGetValue(virConfPtr conf, const char *setting) { virConfEntryPtr cur; @@ -808,7 +809,7 @@ virConfGetValue(virConfPtr conf, const char *setting) } /** - * virConfGetValue: + * _virConfSetValue: * @conf: a configuration file handle * @entry: the name of the entry * @value: the new configuration value @@ -820,9 +821,11 @@ virConfGetValue(virConfPtr conf, const char *setting) * * Returns 0 on success, or -1 on failure. */ -int virConfSetValue (virConfPtr conf, - const char *setting, - virConfValuePtr value) { +int +_virConfSetValue (virConfPtr conf, + const char *setting, + virConfValuePtr value) +{ virConfEntryPtr cur, prev = NULL; cur = conf->entries; @@ -864,7 +867,7 @@ int virConfSetValue (virConfPtr conf, /** - * virConfWriteFile: + * _virConfWriteFile: * @filename: the path to the configuration file. * @conf: the conf * @@ -873,7 +876,7 @@ int virConfSetValue (virConfPtr conf, * Returns the number of bytes written or -1 in case of error. */ int -virConfWriteFile(const char *filename, virConfPtr conf) +_virConfWriteFile(const char *filename, virConfPtr conf) { virBufferPtr buf; virConfEntryPtr cur; @@ -913,7 +916,7 @@ error: } /** - * virConfWriteMem: + * _virConfWriteMem: * @memory: pointer to the memory to store the config file * @len: pointer to the lenght in byte of the store, on output the size * @conf: the conf @@ -926,7 +929,7 @@ error: * Returns the number of bytes written or -1 in case of error. */ int -virConfWriteMem(char *memory, int *len, virConfPtr conf) +_virConfWriteMem(char *memory, int *len, virConfPtr conf) { virBufferPtr buf; virConfEntryPtr cur; diff --git a/src/conf.h b/src/conf.h index 3b83ba6..7192906 100644 --- a/src/conf.h +++ b/src/conf.h @@ -50,23 +50,32 @@ struct _virConfValue { typedef struct _virConf virConf; typedef virConf *virConfPtr; -virConfPtr virConfNew (void); -virConfPtr virConfReadFile (const char *filename); -virConfPtr virConfReadMem (const char *memory, +virConfPtr _virConfNew (void); +virConfPtr _virConfReadFile (const char *filename); +virConfPtr _virConfReadMem (const char *memory, int len); -int virConfFree (virConfPtr conf); +int _virConfFree (virConfPtr conf); -virConfValuePtr virConfGetValue (virConfPtr conf, +virConfValuePtr _virConfGetValue (virConfPtr conf, const char *setting); -int virConfSetValue (virConfPtr conf, +int _virConfSetValue (virConfPtr conf, const char *setting, virConfValuePtr value); -int virConfWriteFile (const char *filename, +int _virConfWriteFile (const char *filename, virConfPtr conf); -int virConfWriteMem (char *memory, +int _virConfWriteMem (char *memory, int *len, virConfPtr conf); +#define virConfNew() (_virConfNew()) +#define virConfReadFile(f) (_virConfReadFile((f))) +#define virConfReadMem(m,l) (_virConfReadMem((m),(l))) +#define virConfFree(c) (_virConfFree((c))) +#define virConfGetValue(c,s) (_virConfGetValue((c),(s))) +#define virConfSetValue(c,s,v) (_virConfSetValue((c),(s),(v))) +#define virConfWriteFile(f,c) (_virConfWriteFile((f),(c))) +#define virConfWriteMem(m,l,c) (_virConfWriteMem((m),(l),(c))) + #ifdef __cplusplus } #endif diff --git a/src/libvirt_sym.version b/src/libvirt_sym.version index b179a54..85c69c2 100644 --- a/src/libvirt_sym.version +++ b/src/libvirt_sym.version @@ -60,9 +60,9 @@ virDomainAttachDevice; virDomainDetachDevice; + _virConfReadFile; + _virConfGetValue; + _virConfFree; virConnectNumOfNetworks; virConnectListNetworks;
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature