aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Expand)AuthorFilesLines
2009-04-06add shuttle VFD drivermichux4-4/+454
2009-03-31update option filemichux1-0/+2
2009-03-31drv_vnc: http port as optionmichux1-0/+5
2009-03-31drv_vnc: run as http daemonmichux1-2/+12
2009-03-30fix fps delay errormichux1-1/+1
2009-03-30add fps limitermichux2-2/+33
2009-03-30add UNSECURE password option to drv_vnc - SSH would be the better choice.michux2-1/+17
2009-03-28add keypadframe color as parameter, some minor fixupsmichux2-7/+21
2009-03-28update keypad handling, add more options, remove compiler waarningsmichux2-20/+40
2009-03-27update lcd4linux sample configmichux1-11/+11
2009-03-27add server port as config option, rename optionsmichux2-29/+37
2009-03-27vnc driver: keypad works nowmichux1-29/+35
2009-03-27some more keypad stuff for vnc driver...michux2-24/+50
2009-03-27update keypad function for vnc drivermichux1-5/+79
2009-03-26vnc driver: add beta keypad support michux3-11/+57
2009-03-26remove unneeded libsmichux2-2/+2
2009-03-26add sample cfg for vnc driver, indentmichux3-6/+16
2009-03-26add max client optionmichux1-7/+16
2009-03-26ignore security check for cygwinmichux1-0/+2
2009-03-26string compare is not case sensitive anymoremichux1-1/+1
2009-03-26more cygwin fixesmichux2-2/+2
2009-03-26fix cygwin compilemichux1-0/+19
2009-03-25I just wanted to commit the 1000st change to lcd4linux ;)michux1-2/+2
2009-03-25minor fixupmichux1-9/+4
2009-03-25more vnc driver stuff...michux3-40/+59
2009-03-25add vnc drivermichux9-114/+627
2009-03-23test intersection of (displayable) widgetsvolker9-15/+82
2009-03-16Fixed pot. buffer overflow in glcd2usbharbaum1-1/+1
2009-03-16glcd2usb button supportharbaum1-13/+11
2009-03-16glcd2usb button supportharbaum3-3747/+3087
2009-03-04autoconf updatemichael3-2946/+3598
2009-03-04GLCD2USB by Till Harbaummichael5-13/+59
2009-03-04add asc255bug setting to MatrixOrbital driver by Maik Dilgermichael1-1/+7
2009-02-28indentmichael1-50/+46
2009-02-28driver for GX series lcd from Matrix Orbital by Abbas Kosanmichael7-3/+626
2009-02-28GLCD2USB driver from Till Harbaummichael8-14/+629
2009-02-28added some contrib files from Nicu Pavelmichael6-0/+1101
2009-02-28patch for picoLCDGraphics that adds keypad/gpi/gpo capabilities from Nicu Pavelmichael1-5/+30
2009-02-28uh-oh... changed perl comment to C comment :-)michael1-1/+1
2009-02-28IRLCD patch from Jussi Kilpelainenmichael1-2/+2
2009-01-29removed backslash handling from cfg.c (its now part of the evaluator)michael1-37/+2
2009-01-29add octal escape sequences to evaluatormichael1-0/+15
2009-01-28update st2205 desc.michux1-1/+1
2009-01-26evaluator: escape sequences in strings (fix for ticket #145)michael1-5/+57
2009-01-23wifi ioctl() fixed (ticket #144)michael1-3/+12
2009-01-19style 'H' (hollow) for vertical bars, individual bar colors for vertical bars...michael2-11/+15
2009-01-18Brightness dimms every colorvolker1-5/+1
2009-01-18more descriptive display names with option -lmichael19-19/+20
2009-01-18'emty format string' compiler warning solvedmichael1-1/+1
2009-01-17correct brightness handling, reduced round tripsvolker1-16/+38
t * * fixed a bug in seti.c (file was never closed, lcd4linux run out of fd's * * improved socket debugging * * Revision 1.9 2001/08/05 17:13:29 reinelt * * cleaned up inlude of sys/time.h and time.h * * Revision 1.8 2001/03/15 15:49:23 ltoetsch * fixed compile HD44780.c, cosmetics * * Revision 1.7 2001/03/15 14:25:05 ltoetsch * added unread/total news * * Revision 1.6 2001/03/14 13:19:29 ltoetsch * Added pop3/imap4 mail support * * Revision 1.5 2001/03/13 08:34:15 reinelt * * corrected a off-by-one bug with sensors * * Revision 1.4 2001/03/08 09:02:04 reinelt * * seti client cleanup * * Revision 1.3 2001/02/21 04:48:13 reinelt * * big mailbox patch from Axel Ehnert * thanks to herp for his idea to check mtime of mailbox * * Revision 1.2 2001/02/19 00:15:46 reinelt * * integrated mail and seti client * major rewrite of parser and tokenizer to support double-byte tokens * * Revision 1.1 2001/02/18 22:11:34 reinelt * *** empty log message *** * */ /* * exported functions: * * Mail (int index, int *num) * returns 0 if ok, -1 if error * sets num to number of emails in mailbox #index * */ #define FALSE 0 #define TRUE 1 #include "config.h" #include <stdlib.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <fcntl.h> #include <time.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/stat.h> #include "cfg.h" #include "debug.h" #include "mail.h" int Mail (int index, int *num, int *unseen) { FILE *fstr; char buffer[32]; static int cfgmbx[MAILBOXES+1]={[0 ... MAILBOXES]=TRUE,}; // Mailbox #index configured? static time_t mbxlt[MAILBOXES+1]={[0 ... MAILBOXES]=0,}; // mtime of Mailbox #index static int mbxnum[MAILBOXES+1]={[0 ... MAILBOXES]=0,}; // Last calculated # of mails static time_t now[MAILBOXES+1]={[0 ... MAILBOXES]=0,}; // Last call to procedure at // for Mailbox #index char *fnp1; int v1=0; int last_line_blank1; // Was the last line blank? struct stat fst; int rc; char *s: int i; char *txt; char txt1[100]; if (index<0 || index>MAILBOXES) return -1; if (now[index] == 0) { /* first time, to give faster a chance */ now[index] = -1-index; return 0; } if (now[index] < -1) { /* wait different time to avoid long startup */ now[index]++; return 0; } if (now[index] > 0) { /* not first time, delay */ sprintf(txt1, "Delay_e%d", index); s= cfg_get(NULL, txt1, "5"); i=now[index]+atoi(s); free(s); if (time(NULL)<=i) return 0; // no more then 5/Delay_eX seconds after last check? } time(&now[index]); // for Mailbox #index /* Build the filename from the config */ qprintf(buffer, sizeof(buffer), "Mailbox%d", index); fnp1=cfg_get(NULL, buffer, NULL); if (fnp1==NULL || *fnp1=='\0') { cfgmbx[index]=FALSE; // There is now entry for Mailbox #index } v1=mbxnum[index]; /* Open the file */ if (cfgmbx[index]==TRUE) { /* Check the last touch of mailbox. Changed? */ rc=stat(fnp1, &fst); if ( rc != 0 ) { /* is it pop3, imap4 or nntp? */ rc = Mail_pop_imap_news(fnp1, num, unseen); if (rc == 0) { free(fnp1); return 0; } else cfgmbx[index] = FALSE; /* don't try again */ error ("Error getting stat of Mailbox%d", index); return (-1); } if ( mbxlt[index] != fst.st_mtime ) { mbxlt[index]=fst.st_mtime; fstr=fopen(fnp1,"r"); if (fstr != NULL) { txt=&txt1[0]; last_line_blank1=TRUE; v1=0; while ( ( fgets ( txt1, 100, fstr ) ) != NULL ) { txt1[strlen(txt1)-1]='\0'; // cut the newline /* Is there a "From ..." line. Count only, if a blank line was directly before this */ if ( strncmp (txt1, "From ", 5 ) == 0 ) { if ( last_line_blank1 == TRUE ) { v1++; last_line_blank1 = FALSE; } } if ( strlen (txt1) == 0 ) { last_line_blank1 = TRUE; } else { last_line_blank1 = FALSE; } } fclose (fstr); } } } free(fnp1); /* FIXME look at the Status of Mails */ *unseen = v1 - mbxnum[index]; if (*unseen < 0) *unseen = 0; mbxnum[index]=v1; *num=v1; return (0); }