1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-30 10:38:36 +00:00

cpp-ify timeinfo.c

This commit is contained in:
Nikolas Garofil 2010-02-09 02:24:41 +01:00
parent 196f6bc796
commit 66a63d9e87
3 changed files with 6 additions and 14 deletions

View File

@ -37,7 +37,7 @@ endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/build.h)
set(conky_sources colours.cc combine.cc common.cc conky.cc core.cc
diskio.cc entropy.cc exec.cc fs.cc mail.cc mixer.cc net_stat.cc template.cc
mboxscan.cc read_tcp.cc scroll.cc specials.cc tailhead.cc
temphelper.cc text_object.cc timeinfo.c top.cc algebra.c prioqueue.c proc.c
temphelper.cc text_object.cc timeinfo.cc top.cc algebra.c prioqueue.c proc.c
user.c)
# add timed thread library

View File

@ -1,5 +1,5 @@
/* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
* vim: ts=4 sw=4 noet ai cindent syntax=c
/* -*- mode: c++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
* vim: ts=4 sw=4 noet ai cindent syntax=cpp
*
* Conky, a system monitor, based on torsmo
*
@ -75,7 +75,7 @@ void scan_tztime(struct text_object *obj, const char *arg)
}
}
ts = malloc(sizeof(struct tztime_s));
ts = (tztime_s*) malloc(sizeof(struct tztime_s));
memset(ts, 0, sizeof(struct tztime_s));
ts->fmt = strndup(fmt ? fmt : "%F %T", text_buffer_size);
ts->tz = tz ? strndup(tz, text_buffer_size) : NULL;
@ -105,7 +105,7 @@ void print_tztime(struct text_object *obj, char *p, int p_max_size)
char *oldTZ = NULL;
time_t t;
struct tm *tm;
struct tztime_s *ts = obj->data.opaque;
struct tztime_s *ts = (tztime_s*) obj->data.opaque;
if (!ts)
return;
@ -139,7 +139,7 @@ void free_time(struct text_object *obj)
void free_tztime(struct text_object *obj)
{
struct tztime_s *ts = obj->data.opaque;
struct tztime_s *ts = (tztime_s*) obj->data.opaque;
if (!ts)
return;

View File

@ -30,10 +30,6 @@
#ifndef _TIMEINFO_H
#define _TIMEINFO_H
#ifdef __cplusplus
extern "C" {
#endif
/* for the times_in_seconds configuration variable and it's users */
void set_times_in_seconds(char);
char times_in_seconds(void);
@ -55,8 +51,4 @@ void print_format_time(struct text_object *obj, char *p, int p_max_size);
void free_time(struct text_object *);
void free_tztime(struct text_object *);
#ifdef __cplusplus
}
#endif
#endif /* _TIMEINFO_H */