Enlightenment CVS committal Author : fletch3k Project : misc Module : enotes
Dir : misc/enotes/src Modified Files: argsparser.c confparse.c funcs_cmds.h main.h newentry.c usage.h var_conf.h variables.c Log Message: Option for timestamping notes added. =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/argsparser.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- argsparser.c 1 Mar 2003 10:34:52 -0000 1.2 +++ argsparser.c 4 Mar 2003 16:14:11 -0000 1.3 @@ -71,6 +71,11 @@ strcpy (xbtnfn, argv[a + 1]); a++; } + else if (!strcmp (argv[a], "--timestamp")) + { + timestampbool = 1; + a++; + } else if (!strcmp (argv[a], "-s") || !strcmp (argv[a], "--config")) { =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/confparse.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- confparse.c 2 Mar 2003 16:21:52 -0000 1.3 +++ confparse.c 4 Mar 2003 16:14:12 -0000 1.4 @@ -140,6 +140,11 @@ sectiontype = 45; goto lp1; } + else if (!strncmp (tmp2, "[+timestamp]", 12)) + { + timestampbool = 1; + goto lp1; + } if (sectiontype == 1) { =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/funcs_cmds.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- funcs_cmds.h 1 Mar 2003 10:34:52 -0000 1.1 +++ funcs_cmds.h 4 Mar 2003 16:14:12 -0000 1.2 @@ -40,3 +40,5 @@ void slideout (int slideloop); void slidein (int slideloop); + +char *fgetdate (void); =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/main.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- main.h 1 Mar 2003 10:34:52 -0000 1.20 +++ main.h 4 Mar 2003 16:14:13 -0000 1.21 @@ -14,10 +14,16 @@ |_________________________________________________________| */ +/* Standard Library and + * Linux System Headers */ + #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <time.h> + +/* E-Libs and X11 */ #include <X11/Xlib.h> #include <Eprog.h> =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/newentry.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- newentry.c 28 Feb 2003 20:27:40 -0000 1.8 +++ newentry.c 4 Mar 2003 16:14:14 -0000 1.9 @@ -51,11 +51,9 @@ cancelbtn = ewl_button_new ("Cancel"); ewltitle = ewl_entry_new ("Title"); - printf ("Loop One to Begin.\n"); while ((wloop++) < 12) { sprintf (wtmp, "Line %d", wloop); - printf (":: %s\n", wtmp); note[wloop - 1] = ewl_entry_new (wtmp); } @@ -63,7 +61,6 @@ wloop = -1; - printf ("Loop Two to Begin.\n"); while ((wloop++) < 12) { ewl_container_append_child (EWL_CONTAINER (main_box), @@ -78,7 +75,6 @@ ewl_widget_show (ewltitle); - printf ("Loop Three to Begin.\n"); wloop = -1; while ((wloop++) < 12) { @@ -107,8 +103,17 @@ fileopen ("a"); - dtmp = ewl_entry_get_text ((Ewl_Entry *) ewltitle); + if (timestampbool == 1) + { + strcpy (dtmp, fgetdate ()); + strcat (dtmp, ewl_entry_get_text ((Ewl_Entry *) ewltitle)); + } + else + { + strcpy (dtmp, ewl_entry_get_text ((Ewl_Entry *) ewltitle)); + } strcat (dtmp, "\n"); + printf (dtmp); fputs (dtmp, file); while ((d++) < 12) @@ -127,4 +132,20 @@ free (dtmp); exit (-1); +} + +char * +fgetdate () +{ + char *tmptimestr = malloc (str_size); + struct tm *ftm; + time_t ftimet; + + time (&ftimet); + ftm = localtime (&ftimet); + + + strftime (tmptimestr, ftimet, "%d/%m/%Y - ", ftm); + + return (tmptimestr); } =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/usage.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- usage.h 1 Mar 2003 10:34:52 -0000 1.1 +++ usage.h 4 Mar 2003 16:14:15 -0000 1.2 @@ -60,7 +60,11 @@ the menubar background.\n\ -S <s> --fontsize <s> Use a different font size.\n\ -T <s> --tsize <s> Use a different font size\n\ - for the title.\n\n\ + for the title.\n\ + --timestamp Timestamp new entry, for use\n\ + only with -N only, advisable to\n\ + use configuration for menu/bar\n\ + based new note launch.\n\n\ E-Notes Execution Bar - Options:\n\ GNU Description\n\ --barwin_x <n> Use N as the X co-ordinate for\n\ =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/var_conf.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- var_conf.h 1 Mar 2003 10:34:52 -0000 1.1 +++ var_conf.h 4 Mar 2003 16:14:15 -0000 1.2 @@ -82,3 +82,5 @@ extern char *newbtnimg; extern char *nubtnimg; extern char *exitbtnimg; + +extern unsigned int timestampbool; =================================================================== RCS file: /cvsroot/enlightenment/misc/enotes/src/variables.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- variables.c 1 Mar 2003 10:34:52 -0000 1.2 +++ variables.c 4 Mar 2003 16:14:15 -0000 1.3 @@ -87,6 +87,8 @@ char *nubtnimg; char *exitbtnimg; +unsigned int timestampbool; + E_Prog *bar; Evas_Object *bar_bg; Evas_Object *bar_firstbtn; ------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger for complex code. Debugging C/C++ programs can leave you feeling lost and disoriented. TotalView can help you find your way. Available on major UNIX and Linux platforms. Try it free. www.etnus.com _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs