aboutsummaryrefslogtreecommitdiffstats
path: root/README (follow)
AgeCommit message (Collapse)AuthorFilesLines
2007-01-14svn keywords correctedmichael1-1/+1
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@730 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2007-01-14svn properties fixedmichael1-3/+2
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@726 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2005-01-09[lcd4linux @ 2005-01-09 10:53:22 by reinelt]reinelt1-2/+2
small type in plugin_uname fixed new homepage lcd4linux.bulix.org git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@500 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2003-08-01[lcd4linux @ 2003-08-01 05:15:42 by reinelt]reinelt1-284/+3
last cleanups for 0.9.9 git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@205 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2002-04-29[lcd4linux @ 2002-04-29 11:00:25 by reinelt]reinelt1-1/+8
added Toshiba T6963 driver added ndelay() with nanosecond resolution git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@152 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2001-09-05[lcd4linux @ 2001-09-05 09:38:52 by reinelt]reinelt1-1/+12
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@141 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2001-05-27[lcd4linux @ 2001-05-27 17:32:35 by reinelt]reinelt1-47/+50
updated README with the seti@home client stuff git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@136 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2001-03-16[lcd4linux @ 2001-03-16 16:40:17 by ltoetsch]ltoetsch1-1/+6
implemented time bar git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@127 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2001-03-15[lcd4linux @ 2001-03-15 14:25:05 by ltoetsch]ltoetsch1-2/+12
added unread/total news git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@124 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2001-03-14[lcd4linux @ 2001-03-14 13:19:29 by ltoetsch]ltoetsch1-5/+20
Added pop3/imap4 mail support git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@117 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2001-03-13[lcd4linux @ 2001-03-13 07:41:22 by reinelt]reinelt1-1/+3
added NEWS file git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@113 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2001-03-09[lcd4linux @ 2001-03-09 14:24:49 by ltoetsch]ltoetsch1-2/+3
exec: Scale_x ->Min/Max_x git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@106 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2001-03-09[lcd4linux @ 2001-03-09 13:08:11 by ltoetsch]ltoetsch1-2/+13
Added Text driver git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@105 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2001-03-08[lcd4linux @ 2001-03-08 15:25:38 by ltoetsch]ltoetsch1-43/+62
improved exec git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@103 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2001-03-07[lcd4linux @ 2001-03-07 18:10:21 by ltoetsch]ltoetsch1-3/+23
added e(x)ec commands git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@100 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2001-03-02[lcd4linux @ 2001-03-02 10:18:03 by ltoetsch]ltoetsch1-1/+4
added /proc/apm battery stat git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@93 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2001-02-16[lcd4linux @ 2001-02-16 08:23:09 by reinelt]reinelt1-1/+2
new token 'ic' (ISDN connected) by Carsten Nau <info@cnau.de> git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@81 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2000-11-28[lcd4linux @ 2000-11-28 16:46:11 by reinelt]reinelt1-5/+5
first try to support display of SIN router git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@70 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2000-08-10[lcd4linux @ 2000-08-10 09:44:09 by reinelt]reinelt1-2/+2
new debugging scheme: error(), info(), debug() uses syslog if in daemon mode git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@64 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2000-08-09[lcd4linux @ 2000-08-09 14:14:11 by reinelt]reinelt1-4/+5
new switch -F (do not fork) added automatic forking if -F not specified git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@63 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2000-08-09[lcd4linux @ 2000-08-09 09:50:29 by reinelt]reinelt1-11/+30
opened 0.98 development removed driver-specific signal-handlers added 'quit'-function to driver structure added global signal-handler git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@61 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2000-04-15[lcd4linux @ 2000-04-15 16:56:52 by reinelt]reinelt1-3/+6
moved delay loops to udelay.c renamed -d (debugging) switch to -v (verbose) new switch -d to calibrate delay loop 'Delay' entry for HD44780 back again delay loops will not calibrate automatically, because this will fail with hich CPU load git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@47 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2000-04-15[lcd4linux @ 2000-04-15 11:13:54 by reinelt]reinelt1-3/+4
added '-d' (debugging) switch added several debugging messages removed config entry 'Delay' for HD44780 driver delay loop for HD44780 will be calibrated automatically git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@45 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2000-04-10[lcd4linux @ 2000-04-10 04:40:53 by reinelt]reinelt1-5/+13
minor changes and cleanups git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@42 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2000-04-03[lcd4linux @ 2000-04-03 04:46:38 by reinelt]reinelt1-1/+16
added '-c key=val' option git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@34 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2000-03-26[lcd4linux @ 2000-03-26 19:03:52 by reinelt]reinelt1-1/+3
more Pixmap renaming quoting of '#' in config file git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@23 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
2000-03-19[lcd4linux @ 2000-03-19 08:41:28 by reinelt]reinelt1-0/+130
documentation available! README, README.MatrixOrbital, README.Drivers added Skeleton.c as a starting point for new drivers git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@14 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
s="cm"> * hash handling rewritten to solve performance issues * * Revision 1.8 2004/05/27 03:39:47 reinelt * * changed function naming scheme to plugin::function * * Revision 1.7 2004/03/11 06:39:59 reinelt * big patch from Martin: * - reuse filehandles * - memory leaks fixed * - earlier busy-flag checking with HD44780 * - reuse memory for strings in RESULT and hash * - netdev_fast to wavid time-consuming regex * * Revision 1.6 2004/03/03 04:44:16 reinelt * changes (cosmetics?) to the big patch from Martin * hash patch un-applied * * Revision 1.5 2004/03/03 03:47:04 reinelt * big patch from Martin Hejl: * - use qprintf() where appropriate * - save CPU cycles on gettimeofday() * - add quit() functions to free allocated memory * - fixed lots of memory leaks * * Revision 1.4 2004/02/15 07:23:04 reinelt * bug in netdev parsing fixed * * Revision 1.3 2004/02/01 19:37:40 reinelt * got rid of every strtok() incarnation. * * Revision 1.2 2004/01/29 04:40:02 reinelt * every .c file includes "config.h" now * * Revision 1.1 2004/01/25 05:30:09 reinelt * plugin_netdev for parsing /proc/net/dev added * */ /* * exported functions: * * int plugin_init_netdev (void) * adds functions to access /proc/net/dev * */ #include "config.h" #include <stdlib.h> #include <stdio.h> #include <string.h> #include <ctype.h> #include <errno.h> #include "debug.h" #include "plugin.h" #include "qprintf.h" #include "hash.h" static HASH NetDev; static FILE *Stream = NULL; static char *DELIMITER = " :|\t\n"; static int parse_netdev(void) { int age; int row, col; static int first_time = 1; /* reread every 10 msec only */ age = hash_age(&NetDev, NULL); if (age > 0 && age <= 10) return 0; if (Stream == NULL) Stream = fopen("/proc/net/dev", "r"); if (Stream == NULL) { error("fopen(/proc/net/dev) failed: %s", strerror(errno)); return -1; } rewind(Stream); row = 0; while (!feof(Stream)) { char buffer[256]; char dev[16]; char *beg, *end; unsigned int len; if (fgets(buffer, sizeof(buffer), Stream) == NULL) break; switch (++row) { case 1: /* skip row 1 */ continue; case 2: /* row 2 used for headers */ if (first_time) { char *RxTx = strrchr(buffer, '|'); first_time = 0; col = 0; beg = buffer; while (beg) { char key[32]; while (strchr(DELIMITER, *beg)) beg++; if ((end = strpbrk(beg, DELIMITER)) != NULL) *end = '\0'; qprintf(key, sizeof(key), "%s_%s", beg < RxTx ? "Rx" : "Tx", beg); hash_set_column(&NetDev, col++, key); beg = end ? end + 1 : NULL; } } continue; default: /* fetch interface name (1st column) as key */ beg = buffer; while (*beg && *beg == ' ') beg++; end = beg + 1; while (*end && *end != ':') end++; len = end - beg; if (len >= sizeof(dev)) len = sizeof(dev) - 1; strncpy(dev, beg, len); dev[len] = '\0'; hash_put_delta(&NetDev, dev, buffer); } } return 0; } static void my_netdev(RESULT * result, RESULT * arg1, RESULT * arg2, RESULT * arg3) { char *dev, *key; int delay; double value; if (parse_netdev() < 0) { SetResult(&result, R_STRING, ""); return; } dev = R2S(arg1); key = R2S(arg2); delay = R2N(arg3); value = hash_get_regex(&NetDev, dev, key, delay); SetResult(&result, R_NUMBER, &value); } static void my_netdev_fast(RESULT * result, RESULT * arg1, RESULT * arg2, RESULT * arg3) { char *dev, *key; int delay; double value; if (parse_netdev() < 0) { SetResult(&result, R_STRING, ""); return; } dev = R2S(arg1); key = R2S(arg2); delay = R2N(arg3); value = hash_get_delta(&NetDev, dev, key, delay); SetResult(&result, R_NUMBER, &value); } int plugin_init_netdev(void) { hash_create(&NetDev); hash_set_delimiter(&NetDev, " :|\t\n"); AddFunction("netdev", 3, my_netdev); AddFunction("netdev::fast", 3, my_netdev_fast); return 0; } void plugin_exit_netdev(void) { if (Stream != NULL) { fclose(Stream); Stream = NULL; } hash_destroy(&NetDev); }