/* This is free software. See LICENSE for terms.
* Copyright 2004 - 2015, Patricia Kirk.
*/
#ifndef STRUCTS_H
#define STRUCTS_H
#include <X11/xpm.h>
#include "salmon.h"
struct global {
int running; /* restrict samcon changes */
int iconic; /* start as an icon */
int iconized; /* current iconic state */
int withdrawn; /* for windowmaker */
int refresh; /* interval in seconds to check the data */
int xmag; /* full window size in 64x64 pixel multiples */
int daemonize; /* Run in background */
int logbeep; /* make noise at message logging */
long boottime; /* boot time in seconds */
int effectiveuid; /* May be root */
int realuid; /* Real user id */
int settime; /* Reset wall clock at startup */
pid_t ppid; /* id of parent process */
pid_t cpid; /* id of child process */
int updaterequest; /* Call to Redraw() required. */
int isize; /* Width and height of icon. */
int psize; /* Width and height of one panel. */
int msize; /* Width and height of main window. */
int linecount; /* total number of display lines */
int lines[4][2]; /* Line count per panel and line numbers */
int localhost; /* running on the local host. */
int panel; /* instrument panel mode. */
int split; /* separate usage by cpu */
int ncpu; /* number of cpu's */
int pixmap; /* use an alternate background pixmap. */
int moongraphic; /* display graphic moon phase */
int phasecalc; /* moon phase calculator */
time_t phasetime; /* time of next/previous quarter */
int calendar; /* calendar function */
int volconn; /* latch left and right volume */
int pingsock; /* The IPPROTO_ICMP ping socket */
int timeport; /* Time service port */
int timesock; /* Time service socket */
int timepoll; /* time client poll rate. */
int timelog; /* write all time activity to salmon.log */
int timeserver; /* this host is the master time keeper */
char *timehost; /* master time keeper name */
int ctlport; /* control port. */
int ctlsock; /* control socket. */
int execport; /* execute port. */
int execsock; /* execute socket. */
int execstop; /* exit at execute call. */
int execlog; /* Log remote execute activity. */
char *network; /* restrict time and remote execute service to this network */
int poweroff; /* shutdown at low power. */
int powertime; /* time in minutes for shutdown command */
int powerlog; /* write power state changes to salmon.log */
char *powercmd; /* command to execute at low power shutdown */
int clickoff; /* shutdown at pointer event */
int clicktime; /* minutes to delay at pointer shutdown */
int clicksound; /* make a noise at pointer shutdown */
int thermoff; /* shutdown at critical over temp */
int thermtime; /* thermal shutdown delay in minutes */
int thermlog; /* write temp zone changes to salmon.log */
char *thermcmd; /* command to execute at thermal shutdown */
int stepsock; /* afterstep socket */
char *stepfile; /* file name of afterstep socket */
char *appname; /* name of app as seen by X windows */
char *display; /* name and display number of X server */
char *position; /* location of full window on screen */
char *cfgfile; /* configuration file to use, global or personal */
char *cmdfile; /* file to use for commands, user spec */
char *datadir; /* graphics and sound file location */
char *tempdir; /* resize file location */
char *unzip; /* pixmap unzip command */
char *resize; /* pixmap resize command */
char *tiler; /* tile repeat command */
char *talker; /* speech synthesizer command */
char *audiocmd; /* command to use to make noise */
char *audiodev; /* device to send noise to */
char *mixer; /* audio volume control command */
char *hostname; /* Localhost name, base name only. */
char *ostype;
char *osvers;
};
/* pixlist[0] is the background color or pixmap.
* pixlist[1] is the global foreground color.
* pixlist[2] is the shutdown warning color.
* Any additional pixstacks are specific colors
* for one or more lines.
*/
struct pixstack {
struct pixstack *next;
int index;
char *colorname;
Pixmap mask;
Pixmap pixmap;
XpmAttributes attributes;
};
struct lineopts {
struct lineopts *next;
struct lineopts *prev;
int index; /* Numerical type. */
int panel; /* Panel number, 1 - 4. */
int linenum; /* Line number, 1 - 6 */
int upper; /* Upper limit for clicks. */
int lower; /* Lower limit for clicks. */
int left; /* Left limit for clicks. */
int right; /* Right limit for clicks. */
int color; /* May be reset to current status. */
int color1; /* Color index on pixstack. */
int color2; /* Color index on pixstack. */
int color3; /* Color index on pixstack. */
int sound; /* Number of first audio file. */
int sound1; /* Number of second audio file. */
int warn; /* Warning temperature or battery level. */
int crit; /* Cricital temperature or battery level. */
char *type; /* Type of information, ie, memfree, device, tzone etc. */
char *argument; /* Type option argument ie. tzone, time format etc. */
char *command; /* Click or time out command to execute. */
char *status; /* Current status. */
char *value; /* Current value. */
char *buffer; /* Temporary manipulation buffer */
char *setting; /* Various line type specific info. */
};
struct pingsent {
struct pingsent *next; /* Pings are removed when returned or at timeout. */
struct pingsent *prev;
struct lineopts *line; /* Line this ping is associated with */
time_t expire; /* Time to stop waiting for a return */
int sequence; /* Sequence number of this ping */
int address; /* Address of host */
};
struct data {
double memtotal; /* total memory */
double memused; /* used memory */
double memfree; /* free memory */
double swaptotal; /* total swap space */
double swapused; /* used swap space */
double swapfree; /* free swap space */
int swapdev; /* number of swap devices */
float loads[3]; /* one, five and fifteen minute loads */
float states[5]; /* total usage split */
float **splits; /* per cpu usage splits */
int proc[2]; /* number of running and active processes */
int volume[2]; /* left and right audio volume */
double share; /* shared memory */
double buffer; /* buffer memory */
double cache; /* cached memory */
long uptime; /* time in seconds since boot */
float phase; /* moon phase percent */
int power; /* ac line on or time remaining on battery */
int maxtherm; /* last thermal zone (0 - n) */
int **zones; /* thermal zone temperatures */
int pixmap; /* moon phase pixmap */
long timeofdata; /* last resort check for updaterequest */
};
#endif /* STRUCTS_H */