+/* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*- */
+
#ifndef _COMMON_H
#define _COMMON_H
+#include "structs.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
+void strfold(char *start, int count);
int check_mount(char *s);
void prepare_update(void);
void update_uptime(void);
void update_net_stats(void);
void update_cpu_usage(void);
void update_total_processes(void);
-void update_uname(void);
+void update_uname(conky_context *ctx);
void update_running_processes(void);
void update_i8k(void);
-void update_stuff(void);
+void update_stuff(conky_context *ctx);
char get_freq(char *, size_t, const char *, int, unsigned int);
void get_freq_dynamic(char *, size_t, const char *, int);
char get_voltage(char *, size_t, const char *, int, unsigned int); /* ptarjan */
void get_cpu_count(void);
double get_time(void);
-FILE *open_file(const char *, int *);
+/* Converts '~/...' paths to '/home/blah/...' assumes that 'dest' is at least
+ * DEFAULT_TEXT_BUFFER_SIZE. It's similar to variable_substitute, except only
+ * cheques for $HOME and ~/ in path */
+void to_real_path(char *dest, const char *source);
+FILE *open_file(const char *file, int *reported);
+int open_fifo(const char *file, int *reported);
void variable_substitute(const char *s, char *dest, unsigned int n);
void format_seconds(char *buf, unsigned int n, long t);
extern unsigned long long need_mask;
extern int no_buffers;
-struct dns_data {
- int nscount;
- char **ns_list;
-};
-void free_dns_data(void);
+void free_dns_data(conky_context *ctx);
struct net_stat {
- const char *dev;
+ char *dev;
int up;
long long last_read_recv, last_read_trans;
long long recv, trans;
char ap[18];
};
void clear_net_stats(void);
-struct net_stat *get_net_stat(const char *);
-int interface_up(const char *dev);
+void clear_cpu_stats(void);
+struct net_stat *get_net_stat(conky_context *ctx, const char *dev, void *free_at_crash1, void *free_at_crash2);
+int interface_up(conky_context *ctx, const char *dev);
void get_adt746x_cpu(char *, size_t);
void get_adt746x_fan(char *, size_t);