-/* $Id: drv_Cwlinux.c,v 1.25 2006/02/06 06:29:30 reinelt Exp $
+/* $Id: drv_Cwlinux.c,v 1.26 2006/02/25 13:36:33 geronet Exp $
*
* new style driver for Cwlinux display modules
*
*
*
* $Log: drv_Cwlinux.c,v $
+ * Revision 1.26 2006/02/25 13:36:33 geronet
+ * updated indent.sh, applied coding style
+ *
* Revision 1.25 2006/02/06 06:29:30 reinelt
* Image driver uses RGBA
*
/* Fixme: GPO's not yet implemented! */
error("%s: GPO's not yet implemented!", Name);
/* Fixme: num*val to avoid compiler warning */
- return num*val;
+ return num * val;
}
WIDGET_CLASS wc;
int ret;
- info("%s: %s", Name, "$Revision: 1.25 $");
+ info("%s: %s", Name, "$Revision: 1.26 $");
/* display preferences */
XRES = 6; /* pixel width of one char */
-/* $Id: drv_Noritake.c,v 1.5 2006/01/30 06:25:53 reinelt Exp $
+/* $Id: drv_Noritake.c,v 1.6 2006/02/25 13:36:33 geronet Exp $
*
* Driver for a Noritake GU128x32-311 graphical display.
*
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log: drv_Noritake.c,v $
+ * Revision 1.6 2006/02/25 13:36:33 geronet
+ * updated indent.sh, applied coding style
+ *
* Revision 1.5 2006/01/30 06:25:53 reinelt
* added CVS Revision
*
static unsigned char SIGNAL_WR; /* Write OUTPUT, negative logic, pport STOBE */
static unsigned char SIGNAL_RESET; /* Reset, OUTPUT, negative logic, pport INIT */
static unsigned char SIGNAL_BLANK; /* Blank, OUTPUT , negative logic, pport SELECT-IN */
- /* static unsigned char SIGNAL_BUSY; *//* Busy, INPUT , positive logic, pport BUSY, not used */
- /* static unsigned char SIGNAL_FRP; *//* Frame Pulse, INPUT , positive logic, pport ACK, not used */
+ /* static unsigned char SIGNAL_BUSY; *//* Busy, INPUT , positive logic, pport BUSY, not used */
+ /* static unsigned char SIGNAL_FRP; *//* Frame Pulse, INPUT , positive logic, pport ACK, not used */
void (*drv_Noritake_clear) (void);
/* Data port is positive logic */
WIDGET_CLASS wc;
int ret;
- info("%s: %s", Name, "$Revision: 1.5 $");
+ info("%s: %s", Name, "$Revision: 1.6 $");
/* start display */
if ((ret = drv_Noritake_start(section)) != 0)
-/* $Id: drv_generic_i2c.h,v 1.4 2005/05/31 21:32:00 lfcorreia Exp $\r
+/* $Id: drv_generic_i2c.h,v 1.5 2006/02/25 13:36:33 geronet Exp $\r
*\r
* generic driver helper for i2c displays\r
*\r
*\r
*\r
* $Log: drv_generic_i2c.h,v $
+ * Revision 1.5 2006/02/25 13:36:33 geronet
+ * updated indent.sh, applied coding style
+ *
* Revision 1.4 2005/05/31 21:32:00 lfcorreia
* fix my email address
*\r
* HD44780/I2C patch from Luis merged (still does not work for me)\r
*\r
*\r
- */\r
-\r
+ */ \r
+ \r
/* \r
*\r
* exported fuctions:\r
* void drv_generic_i2c_command(unsigned char command, unsigned char *data,unsigned char length)\r
* send command and the data to the i2c device\r
* \r
- */\r
-\r
+ */ \r
+ \r
#ifndef _DRV_GENERIC_I2C_H_\r
#define _DRV_GENERIC_I2C_H_\r
-\r
-int drv_generic_i2c_open(const char *section, const char *driver);\r
-int drv_generic_i2c_close(void);\r
-unsigned char drv_generic_i2c_wire(const char *name, const char *deflt);\r
-void drv_generic_i2c_data(const unsigned char data);\r
-void drv_generic_i2c_command(const unsigned char command, const unsigned char *data, const unsigned char length);\r
-\r
-#endif\r
+\rint drv_generic_i2c_open(const char *section, const char *driver);
+\rint drv_generic_i2c_close(void);
+\runsigned char drv_generic_i2c_wire(const char *name, const char *deflt);
+\rvoid drv_generic_i2c_data(const unsigned char data);
+\rvoid drv_generic_i2c_command(const unsigned char command, const unsigned char *data, const unsigned char length);
+\r\r
+#endif /* \r */
-/* $Id: drv_generic_parport.c,v 1.20 2005/12/12 05:52:03 reinelt Exp $
+/* $Id: drv_generic_parport.c,v 1.21 2006/02/25 13:36:33 geronet Exp $
*
* generic driver helper for serial and parport access
*
*
*
* $Log: drv_generic_parport.c,v $
+ * Revision 1.21 2006/02/25 13:36:33 geronet
+ * updated indent.sh, applied coding style
+ *
* Revision 1.20 2005/12/12 05:52:03 reinelt
* type of delays is 'unsigned long'
*
unsigned char drv_generic_parport_status(void)
{
- unsigned char mask = PARPORT_STATUS_ERROR | PARPORT_STATUS_SELECT | PARPORT_STATUS_PAPEROUT | PARPORT_STATUS_ACK | PARPORT_STATUS_BUSY;
+ unsigned char mask =
+ PARPORT_STATUS_ERROR | PARPORT_STATUS_SELECT | PARPORT_STATUS_PAPEROUT | PARPORT_STATUS_ACK |
+ PARPORT_STATUS_BUSY;
unsigned char data;
debug("%cSTROBE %cAUTOFD %cINIT %cSLCTIN",
control & PARPORT_CONTROL_STROBE ? '-' : '+',
- control & PARPORT_CONTROL_AUTOFD ? '-' : '+', control & PARPORT_CONTROL_INIT ? '+' : '-', control & PARPORT_CONTROL_SELECT ? '-' : '+');
+ control & PARPORT_CONTROL_AUTOFD ? '-' : '+', control & PARPORT_CONTROL_INIT ? '+' : '-',
+ control & PARPORT_CONTROL_SELECT ? '-' : '+');
}
-/* $Id: drv_generic_text.c,v 1.31 2006/01/30 05:47:38 reinelt Exp $
+/* $Id: drv_generic_text.c,v 1.32 2006/02/25 13:36:33 geronet Exp $
*
* generic driver helper for text-based displays
*
*
*
* $Log: drv_generic_text.c,v $
+ * Revision 1.32 2006/02/25 13:36:33 geronet
+ * updated indent.sh, applied coding style
+ *
* Revision 1.31 2006/01/30 05:47:38 reinelt
* graphic subsystem changed to full-color RGBA
*
break;
/* hollow style, val(1,2) == 1, like '[' */
/* if (l1 == 1 && l2 == 1 && Segment[i].style == STYLE_FIRST && BarFB[n].style == STYLE_HOLLOW)
- break;
+ break;
*//* hollow style, val(1,2) == 1, like ']' */
/* if (l1 == 1 && l2 == 1 && Segment[i].style == STYLE_LAST && BarFB[n].style == STYLE_HOLLOW)
break;
-/* $Id: evaluator.c,v 1.30 2006/01/30 12:53:08 reinelt Exp $
+/* $Id: evaluator.c,v 1.31 2006/02/25 13:36:33 geronet Exp $
*
* expression evaluation
*
*
*
* $Log: evaluator.c,v $
+ * Revision 1.31 2006/02/25 13:36:33 geronet
+ * updated indent.sh, applied coding style
+ *
* Revision 1.30 2006/01/30 12:53:08 reinelt
* replaced strncpy with strcpy where possible
*
if ((*result)->string)
free((*result)->string);
/* allocate memory in multiples of CHUNK_SIZE */
- (*result)->size = CHUNK_SIZE * ((len+1) / CHUNK_SIZE + 1);
+ (*result)->size = CHUNK_SIZE * ((len + 1) / CHUNK_SIZE + 1);
(*result)->string = malloc((*result)->size);
}
strcpy((*result)->string, value);
# -l120 Set maximum line length for non-comment lines to 150.
# -pmt Preserve access and modification times on output files.
-indent -kr -l120 -pmt *.c *.h
+indent -kr -l120 *.c *.h
+for i in *.c *.h; do
+ if !(diff -q $i $i~); then
+ rm $i~
+ else
+ mv $i~ $i
+ fi
+done
-/* $Id: lcd4linux_i2c.h,v 1.3 2005/07/06 04:40:18 reinelt Exp $
+/* $Id: lcd4linux_i2c.h,v 1.4 2006/02/25 13:36:33 geronet Exp $
*
* user space i2c sturctures and defines, taken from the official kernel i2c
* includes to solve the problem when compiling user space application
*
*
* $Log: lcd4linux_i2c.h,v $
+ * Revision 1.4 2006/02/25 13:36:33 geronet
+ * updated indent.sh, applied coding style
+ *
* Revision 1.3 2005/07/06 04:40:18 reinelt
* GCC-4 fixes
*
* It will only call found_proc if some client is connected at the
* specific address (unless a 'force' matched);
*/
-extern int i2c_probe(struct i2c_adapter *adapter, struct i2c_client_address_data *address_data, int (*found_proc) (struct i2c_adapter *, int, int));
+extern int i2c_probe(struct i2c_adapter *adapter, struct i2c_client_address_data *address_data,
+ int (*found_proc) (struct i2c_adapter *, int, int));
/* An ioctl like call to set div. parameters of the adapter.
*/
-/* $Id: plugin_i2c_sensors.c,v 1.24 2005/05/08 04:32:44 reinelt Exp $
+/* $Id: plugin_i2c_sensors.c,v 1.25 2006/02/25 13:36:33 geronet Exp $
*
* I2C sensors plugin
*
*
*
* $Log: plugin_i2c_sensors.c,v $
+ * Revision 1.25 2006/02/25 13:36:33 geronet
+ * updated indent.sh, applied coding style
+ *
* Revision 1.24 2005/05/08 04:32:44 reinelt
* CodingStyle added and applied
*
while ((dir = readdir(fd1))) {
/* Skip non-directories and '.' and '..' */
- if ((dir->d_type != DT_DIR && dir->d_type != DT_LNK) || strcmp(dir->d_name, ".") == 0 || strcmp(dir->d_name, "..") == 0) {
+ if ((dir->d_type != DT_DIR && dir->d_type != DT_LNK) || strcmp(dir->d_name, ".") == 0
+ || strcmp(dir->d_name, "..") == 0) {
continue;
}
done = 0;
while ((file = readdir(fd2))) {
/* FIXME : do all sensors have a temp_input1 ? */
- if (!strcmp(file->d_name, "temp_input1") || !strcmp(file->d_name, "temp1_input") || !strcmp(file->d_name, "temp1")) {
+ if (!strcmp(file->d_name, "temp_input1") || !strcmp(file->d_name, "temp1_input")
+ || !strcmp(file->d_name, "temp1")) {
path = realloc(path, strlen(dname) + 1);
strcpy(path, dname);
done = 1;
-/* $Id: plugin_mysql.c,v 1.10 2006/01/20 15:58:05 reinelt Exp $
+/* $Id: plugin_mysql.c,v 1.11 2006/02/25 13:36:33 geronet Exp $
*
* plugin for execute SQL queries into a MySQL DBSM.
*
*
*
* $Log: plugin_mysql.c,v $
+ * Revision 1.11 2006/02/25 13:36:33 geronet
+ * updated indent.sh, applied coding style
+ *
* Revision 1.10 2006/01/20 15:58:05 reinelt
* MySQL::count() added again
*
char *q;
double value;
MYSQL_RES *res;
-
+
if (configure_mysql() < 0) {
value = -1;
SetResult(&result, R_NUMBER, &value);
char *q;
double value;
MYSQL_RES *res;
- MYSQL_ROW row=NULL;
+ MYSQL_ROW row = NULL;
if (configure_mysql() < 0) {
value = -1;
-/* $Id: plugin_pop3.c,v 1.9 2005/05/08 04:32:44 reinelt Exp $
+/* $Id: plugin_pop3.c,v 1.10 2006/02/25 13:36:33 geronet Exp $
*
* Plugin to check POP3 mail accounts
*
*
*
* $Log: plugin_pop3.c,v $
+ * Revision 1.10 2006/02/25 13:36:33 geronet
+ * updated indent.sh, applied coding style
+ *
* Revision 1.9 2005/05/08 04:32:44 reinelt
* CodingStyle added and applied
*
node->username = x;
x = cfg_get(Section, password, "");
if (*x == '\0') {
- info("[POP3] No '%s.%s' entry from %s, disabling POP3 account #%d", Section, password, cfg_source(), i);
+ info("[POP3] No '%s.%s' entry from %s, disabling POP3 account #%d", Section, password, cfg_source(),
+ i);
free(x);
} else {
node->password = x;
if (cfg_number(Section, port, POP3PORT, 1, 65536, &node->port) < 1) {
- info("[POP3] No '%s.%s' entry from %s, %d will be used for account #%d", Section, port, cfg_source(), POP3PORT, i);
+ info("[POP3] No '%s.%s' entry from %s, %d will be used for account #%d", Section, port,
+ cfg_source(), POP3PORT, i);
}
check_node_add(&head, node);
n++;
-/* $Id: widget_icon.c,v 1.22 2006/01/23 06:17:18 reinelt Exp $
+/* $Id: widget_icon.c,v 1.23 2006/02/25 13:36:33 geronet Exp $
*
* icon widget handling
*
*
*
* $Log: widget_icon.c,v $
+ * Revision 1.23 2006/02/25 13:36:33 geronet
+ * updated indent.sh, applied coding style
+ *
* Revision 1.22 2006/01/23 06:17:18 reinelt
* timer widget added
*
Icon->visible = 0;
DelResult(&result);
}
-
+
/* rotate icon bitmap */
Icon->curmap++;
if (Icon->curmap >= Icon->maxmap)
Icon->curmap = 0;
}
-
+
/* finally, draw it! */
if (W->class->draw)
W->class->draw(W);
-
+
/* add a new one-shot timer */
if (Icon->speed > 0) {
timer_add(widget_icon_update, Self, Icon->speed, 1);
-/* $Id: widget_image.c,v 1.4 2006/02/19 07:20:54 reinelt Exp $
+/* $Id: widget_image.c,v 1.5 2006/02/25 13:36:33 geronet Exp $
*
* image widget handling
*
*
*
* $Log: widget_image.c,v $
+ * Revision 1.5 2006/02/25 13:36:33 geronet
+ * updated indent.sh, applied coding style
+ *
* Revision 1.4 2006/02/19 07:20:54 reinelt
* image support nearly finished
*
if (Image->bitmap) {
int i;
for (i = 0; i < Image->height * Image->width; i++) {
- RGBA empty = { R: 0x00, G: 0x00, B: 0x00, A:0x00 };
+ RGBA empty = { R: 0x00, G: 0x00, B: 0x00, A:0x00 };
Image->bitmap[i] = empty;
}
}
-
+
if (Image->file == NULL || Image->file[0] == '\0') {
error("Warning: Image %s has no file", Name);
return;
}
-
+
fd = fopen(Image->file, "rb");
if (fd == NULL) {
error("Warning: Image %s: fopen(%s) failed: %s", Name, Image->file, strerror(errno));
return;
}
for (i = 0; i < Image->height * Image->width; i++) {
- RGBA empty = { R: 0x00, G: 0x00, B: 0x00, A:0x00 };
+ RGBA empty = { R: 0x00, G: 0x00, B: 0x00, A:0x00 };
Image->bitmap[i] = empty;
}
}
/* finally really render it */
- for (x=0; x < gdImage->sx; x++) {
- for (y=0; y < gdImage->sy; y++) {
- int p = gdImageGetTrueColorPixel (gdImage, x, y);
+ for (x = 0; x < gdImage->sx; x++) {
+ for (y = 0; y < gdImage->sy; y++) {
+ int p = gdImageGetTrueColorPixel(gdImage, x, y);
int a = gdTrueColorGetAlpha(p);
- int i = y*Image->width+x;
- Image->bitmap[i].R = gdTrueColorGetRed(p);
- Image->bitmap[i].G = gdTrueColorGetGreen (p);
+ int i = y * Image->width + x;
+ Image->bitmap[i].R = gdTrueColorGetRed(p);
+ Image->bitmap[i].G = gdTrueColorGetGreen(p);
Image->bitmap[i].B = gdTrueColorGetBlue(p);
/* GD's alpha is 0 (opaque) to 127 (tranparanet) */
/* our alpha is 0 (transparent) to 255 (opaque) */
- Image->bitmap[i].A = (a == 127) ? 0 : 255-2*a;
+ Image->bitmap[i].A = (a == 127) ? 0 : 255 - 2 * a;
}
}
}
Image->visible = 0;
DelResult(&result);
}
-
#ifdef WITH_GD
/* render image into bitmap */
widget_image_render(W->name, Image);
-/* $Id: widget_image.h,v 1.2 2006/02/08 04:55:05 reinelt Exp $
+/* $Id: widget_image.h,v 1.3 2006/02/25 13:36:33 geronet Exp $
*
* image widget handling
*
*
*
* $Log: widget_image.h,v $
+ * Revision 1.3 2006/02/25 13:36:33 geronet
+ * updated indent.sh, applied coding style
+ *
* Revision 1.2 2006/02/08 04:55:05 reinelt
* moved widget registration to drv_generic_graphic
*
#include "rgb.h"
typedef struct WIDGET_IMAGE {
- RGBA *bitmap; /* image bitmap */
- int width, height; /* size of the image */
+ RGBA *bitmap; /* image bitmap */
+ int width, height; /* size of the image */
char *file_expr; /* expression for image filename */
void *file_tree; /* pre-compiled expression for image filename */
- char *file; /* evaluated filename */
+ char *file; /* evaluated filename */
char *update_expr; /* expression for update interval */
void *update_tree; /* pre-compiled expression for update interval */
int update; /* update interval (msec) */
-/* $Id: widget_keypad.h,v 1.1 2006/02/21 05:50:34 reinelt Exp $
+/* $Id: widget_keypad.h,v 1.2 2006/02/25 13:36:33 geronet Exp $
*
* keypad widget handling
*
*
*
* $Log: widget_keypad.h,v $
+ * Revision 1.2 2006/02/25 13:36:33 geronet
+ * updated indent.sh, applied coding style
+ *
* Revision 1.1 2006/02/21 05:50:34 reinelt
* keypad support from Cris Maj
*
#define _WIDGET_KEYPAD_H_
typedef enum { KEY_UP = 1, KEY_DOWN = 2, KEY_LEFT = 4, KEY_RIGHT = 8, KEY_CONFIRM = 16, KEY_CANCEL = 32, KEY_PRESSED =
- 64, KEY_RELEASED = 128 } KEYPADKEY;
+ 64, KEY_RELEASED = 128
+} KEYPADKEY;
typedef struct WIDGET_KEYPAD {
char *expression; /* expression that delivers the value */
-/* $Id: widget_timer.c,v 1.1 2006/01/23 06:17:18 reinelt Exp $
+/* $Id: widget_timer.c,v 1.2 2006/02/25 13:36:33 geronet Exp $
*
* timer widget handling
*
*
*
* $Log: widget_timer.c,v $
+ * Revision 1.2 2006/02/25 13:36:33 geronet
+ * updated indent.sh, applied coding style
+ *
* Revision 1.1 2006/01/23 06:17:18 reinelt
* timer widget added
*
Timer->update = 10;
DelResult(&result);
}
-
+
Timer->active = 1;
if (Timer->active_tree != NULL) {
Eval(Timer->active_tree, &result);
Timer->active = 0;
DelResult(&result);
}
-
+
/* finally, fire it! */
if (Timer->active) {
Eval(Timer->expr_tree, &result);
DelResult(&result);
}
-
+
/* add a new one-shot timer */
timer_add(widget_timer_update, Self, Timer->update, 1);
}
section = malloc(strlen(Self->name) + 8);
strcpy(section, "Widget:");
strcat(section, Self->name);
-
+
Timer = malloc(sizeof(WIDGET_TIMER));
memset(Timer, 0, sizeof(WIDGET_TIMER));
Timer->expression = cfg_get_raw(section, "axpression", NULL);
Timer->update_expr = cfg_get_raw(section, "update", "100");
Timer->active_expr = cfg_get_raw(section, "active", "1");
-
+
/* sanity checks */
if (Timer->expression == NULL || *Timer->expression == '\0') {
error("Timer %s has no expression, using '1'", Self->name);
Compile(Timer->expression, &Timer->expr_tree);
Compile(Timer->update_expr, &Timer->update_tree);
Compile(Timer->active_expr, &Timer->active_tree);
-
-
+
+
free(section);
Self->data = Timer;
-
+
/* just do it! */
widget_timer_update(Self);
-/* $Id: widget_timer.h,v 1.1 2006/01/23 06:17:18 reinelt Exp $
+/* $Id: widget_timer.h,v 1.2 2006/02/25 13:36:33 geronet Exp $
*
* timer widget handling
*
*
*
* $Log: widget_timer.h,v $
+ * Revision 1.2 2006/02/25 13:36:33 geronet
+ * updated indent.sh, applied coding style
+ *
* Revision 1.1 2006/01/23 06:17:18 reinelt
* timer widget added
*
#define _WIDGET_TIMER_H_
typedef struct WIDGET_TIMER {
- char *expression; /* main timer expression */
- void *expr_tree; /* pre-compiled main expression */
+ char *expression; /* main timer expression */
+ void *expr_tree; /* pre-compiled main expression */
char *update_expr; /* expression for update interval */
void *update_tree; /* pre-compiled expression for update interval */
int update; /* update interval (msec) */
char *active_expr; /* expression for active */
void *active_tree; /* pre-compiled expression for active */
- int active; /* timer active? */
+ int active; /* timer active? */
} WIDGET_TIMER;
extern WIDGET_CLASS Widget_Timer;