mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-30 18:49:31 +00:00
cpp-ify conf_cookie.c
This commit is contained in:
parent
c1648e6558
commit
63133c19d6
@ -166,7 +166,7 @@ if(BUILD_ICONV)
|
|||||||
endif(BUILD_ICONV)
|
endif(BUILD_ICONV)
|
||||||
|
|
||||||
if(BUILD_BUILTIN_CONFIG)
|
if(BUILD_BUILTIN_CONFIG)
|
||||||
set(optional_sources ${optional_sources} conf_cookie.c)
|
set(optional_sources ${optional_sources} conf_cookie.cc)
|
||||||
endif(BUILD_BUILTIN_CONFIG)
|
endif(BUILD_BUILTIN_CONFIG)
|
||||||
|
|
||||||
add_executable(conky ${conky_sources} ${optional_sources})
|
add_executable(conky ${conky_sources} ${optional_sources})
|
||||||
|
@ -61,14 +61,13 @@ conf_read(void *cookie, char *buf, COOKIE_LEN_T size)
|
|||||||
#endif /* defined(HAVE_FOPENCOOKIE) || defined(HAVE_FUNOPEN) */
|
#endif /* defined(HAVE_FOPENCOOKIE) || defined(HAVE_FUNOPEN) */
|
||||||
|
|
||||||
#if defined(HAVE_FOPENCOOKIE)
|
#if defined(HAVE_FOPENCOOKIE)
|
||||||
static cookie_io_functions_t conf_cookie = {
|
static cookie_io_functions_t conf_cookie;
|
||||||
.read = &conf_read,
|
|
||||||
.write = NULL,
|
|
||||||
.seek = NULL,
|
|
||||||
.close = NULL,
|
|
||||||
};
|
|
||||||
FILE *conf_cookie_open(void)
|
FILE *conf_cookie_open(void)
|
||||||
{
|
{
|
||||||
|
conf_cookie.read = &conf_read;
|
||||||
|
conf_cookie.write = NULL;
|
||||||
|
conf_cookie.seek = NULL;
|
||||||
|
conf_cookie.close = NULL;
|
||||||
return fopencookie(NULL, "r", conf_cookie);
|
return fopencookie(NULL, "r", conf_cookie);
|
||||||
}
|
}
|
||||||
#elif defined(HAVE_FUNOPEN)
|
#elif defined(HAVE_FUNOPEN)
|
@ -3,14 +3,6 @@
|
|||||||
#ifndef _CONF_COOKIE_H
|
#ifndef _CONF_COOKIE_H
|
||||||
#define _CONF_COOKIE_H
|
#define _CONF_COOKIE_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
FILE *conf_cookie_open(void);
|
FILE *conf_cookie_open(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _CONF_COOKIE_H */
|
#endif /* _CONF_COOKIE_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user