1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-09-30 05:59:07 +00:00

Renamed more global variables with global_ prefix

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1180 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Kevin Lyles 2008-06-21 09:24:56 +00:00
parent e528397a02
commit e7e874ac61

View File

@ -438,8 +438,8 @@ static int pad_percents = 0;
tcp_port_monitor_args_t tcp_port_monitor_args; tcp_port_monitor_args_t tcp_port_monitor_args;
#endif #endif
static char *text = 0; static char *global_text = 0;
long text_lines; long global_text_lines;
static int total_updates; static int total_updates;
@ -3958,7 +3958,7 @@ static struct text_object_list *extract_variable_text_internal(const char *const
memset(retval, 0, sizeof(struct text_object_list)); memset(retval, 0, sizeof(struct text_object_list));
retval->text_object_count = 0; retval->text_object_count = 0;
line = text_lines; line = global_text_lines;
while (*p) { while (*p) {
if (*p == '\n') { if (*p == '\n') {
@ -7653,9 +7653,9 @@ void reload_config(void)
#ifdef TCP_PORT_MONITOR #ifdef TCP_PORT_MONITOR
info.p_tcp_port_monitor_collection = NULL; info.p_tcp_port_monitor_collection = NULL;
#endif #endif
extract_variable_text(text); extract_variable_text(global_text);
free(text); free(global_text);
text = NULL; global_text = NULL;
if (tmpstring1) { if (tmpstring1) {
free(tmpstring1); free(tmpstring1);
} }
@ -7722,9 +7722,9 @@ void clean_up(void)
text_buffer = 0; text_buffer = 0;
} }
if (text) { if (global_text) {
free(text); free(global_text);
text = 0; global_text = 0;
} }
free(current_config); free(current_config);
@ -8505,32 +8505,32 @@ static void load_config_file(const char *f)
} }
} }
CONF("text") { CONF("text") {
if (text) { if (global_text) {
free(text); free(global_text);
text = 0; global_text = 0;
} }
text = (char *) malloc(1); global_text = (char *) malloc(1);
text[0] = '\0'; global_text[0] = '\0';
while (!feof(fp)) { while (!feof(fp)) {
unsigned int l = strlen(text); unsigned int l = strlen(global_text);
if (fgets(buf, 256, fp) == NULL) { if (fgets(buf, 256, fp) == NULL) {
break; break;
} }
text = (char *) realloc(text, l + strlen(buf) + 1); global_text = (char *) realloc(global_text, l + strlen(buf) + 1);
strcat(text, buf); strcat(global_text, buf);
if (strlen(text) > max_user_text) { if (strlen(global_text) > max_user_text) {
break; break;
} }
} }
fclose(fp); fclose(fp);
if (strlen(text) < 1) { if (strlen(global_text) < 1) {
CRIT_ERR("no text supplied in configuration; exiting"); CRIT_ERR("no text supplied in configuration; exiting");
} }
text_lines = line + 1; global_text_lines = line + 1;
return; return;
} }
#ifdef TCP_PORT_MONITOR #ifdef TCP_PORT_MONITOR
@ -8583,7 +8583,7 @@ static void load_config_file(const char *f)
// default to update_interval // default to update_interval
info.music_player_interval = update_interval; info.music_player_interval = update_interval;
} }
if (!text) { // didn't supply any text if (!global_text) { // didn't supply any text
CRIT_ERR("missing text block in configuration; exiting"); CRIT_ERR("missing text block in configuration; exiting");
} }
} }
@ -8833,12 +8833,12 @@ int main(int argc, char **argv)
#endif #endif
#endif /* X11 */ #endif /* X11 */
case 't': case 't':
if (text) { if (global_text) {
free(text); free(global_text);
text = 0; global_text = 0;
} }
text = strndup(optarg, max_user_text); global_text = strndup(optarg, max_user_text);
convert_escapes(text); convert_escapes(global_text);
break; break;
case 'u': case 'u':
@ -8873,12 +8873,12 @@ int main(int argc, char **argv)
#endif /* X11 */ #endif /* X11 */
/* generate text and get initial size */ /* generate text and get initial size */
extract_variable_text(text); extract_variable_text(global_text);
if (text) { if (global_text) {
free(text); free(global_text);
text = 0; global_text = 0;
} }
text = NULL; global_text = NULL;
/* fork */ /* fork */
if (fork_to_background) { if (fork_to_background) {
int pid = fork(); int pid = fork();