1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-20 03:51:18 +00:00
conky/src/common.h

135 lines
4.7 KiB
C
Raw Normal View History

/* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
* vim: ts=4 sw=4 noet ai cindent syntax=c
*/
#ifndef _COMMON_H
#define _COMMON_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include "text_object.h"
void add_update_callback(void (*func)(void));
void free_update_callbacks(void);
void start_update_threading(void);
void strfold(char *start, int count);
int check_mount(struct text_object *);
void prepare_update(void);
void update_uptime(void);
void update_meminfo(void);
void update_net_stats(void);
void update_cpu_usage(void);
void update_total_processes(void);
void update_uname(void);
void update_threads(void);
void update_running_processes(void);
void update_stuff(void);
char get_freq(char *, size_t, const char *, int, unsigned int);
2009-11-12 23:24:54 +00:00
void print_voltage_mv(struct text_object *, char *, int);
void print_voltage_v(struct text_object *, char *, int);
void update_load_average(void);
void update_top(void);
void free_all_processes(void);
struct process *get_first_process(void);
void get_cpu_count(void);
double get_time(void);
/* 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);
void format_seconds_short(char *buf, unsigned int n, long t);
int round_to_int_temp(float);
unsigned int round_to_int(float);
extern int no_buffers;
int open_acpi_temperature(const char *name);
double get_acpi_temperature(int fd);
void get_acpi_ac_adapter(char *, size_t);
void get_acpi_fan(char *, size_t);
void get_battery_stuff(char *buf, unsigned int n, const char *bat, int item);
int get_battery_perct(const char *bat);
double get_battery_perct_bar(struct text_object *);
2009-02-18 04:49:45 +00:00
void get_battery_short_status(char *buf, unsigned int n, const char *bat);
void scan_loadavg_arg(struct text_object *, const char *);
void print_loadavg(struct text_object *, char *, int);
#ifdef X11
void scan_loadgraph_arg(struct text_object *, const char *);
2009-12-04 00:49:31 +00:00
double loadgraphval(struct text_object *);
#endif /* X11 */
2009-11-25 00:30:21 +00:00
uint8_t cpu_percentage(struct text_object *);
2009-12-04 00:19:07 +00:00
double cpu_barval(struct text_object *);
void print_mem(struct text_object *, char *, int);
void print_memeasyfree(struct text_object *, char *, int);
void print_memfree(struct text_object *, char *, int);
void print_memmax(struct text_object *, char *, int);
void print_swap(struct text_object *, char *, int);
void print_swapfree(struct text_object *, char *, int);
void print_swapmax(struct text_object *, char *, int);
uint8_t mem_percentage(struct text_object *);
2009-12-04 00:22:36 +00:00
double mem_barval(struct text_object *);
uint8_t swap_percentage(struct text_object *);
2009-12-04 00:25:41 +00:00
double swap_barval(struct text_object *);
2009-11-22 17:02:56 +00:00
void print_kernel(struct text_object *, char *, int);
void print_machine(struct text_object *, char *, int);
2009-11-25 23:22:25 +00:00
void print_nodename(struct text_object *, char *, int);
2009-11-25 23:29:50 +00:00
void print_sysname(struct text_object *, char *, int);
void print_uptime(struct text_object *, char *, int);
void print_uptime_short(struct text_object *, char *, int);
void print_processes(struct text_object *, char *, int);
void print_running_processes(struct text_object *, char *, int);
void print_running_threads(struct text_object *, char *, int);
void print_threads(struct text_object *, char *, int);
void print_buffers(struct text_object *, char *, int);
void print_cached(struct text_object *, char *, int);
2009-11-26 00:15:33 +00:00
void print_evaluate(struct text_object *, char *, int);
int if_empty_iftest(struct text_object *);
int if_existing_iftest(struct text_object *);
int if_running_iftest(struct text_object *);
#ifndef __OpenBSD__
void print_acpitemp(struct text_object *, char *, int);
void free_acpitemp(struct text_object *);
#endif /* !__OpenBSD__ */
void print_freq(struct text_object *, char *, int);
void print_freq_g(struct text_object *, char *, int);
#ifndef __OpenBSD__
void print_acpifan(struct text_object *, char *, int);
void print_acpiacadapter(struct text_object *, char *, int);
void print_battery(struct text_object *, char *, int);
void print_battery_time(struct text_object *, char *, int);
uint8_t battery_percentage(struct text_object *);
void print_battery_short(struct text_object *, char *, int);
#endif /* !__OpenBSD__ */
2009-11-29 11:47:11 +00:00
void print_to_bytes(struct text_object *, char *, int);
2009-11-29 11:56:09 +00:00
void print_blink(struct text_object *, char *, int);
2009-11-29 11:59:04 +00:00
void print_include(struct text_object *, char *, int);
2009-11-29 11:47:11 +00:00
2009-11-29 18:48:24 +00:00
void print_updates(struct text_object *, char *, int);
int updatenr_iftest(struct text_object *);
2009-11-29 18:48:24 +00:00
#endif /* _COMMON_H */