Enlightenment CVS committal Author : onefang Project : e17 Module : apps/e_utils
Dir : e17/apps/e_utils/src/bin/e17genmenu/src/bin Modified Files: dumb_list.c dumb_list.h main.c xmlame.c xmlame.h Log Message: Bugger all work done today, but at least I got little further. The infrastructure is there now, and the test code. I can right the actual xml parsing code next. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e_utils/src/bin/e17genmenu/src/bin/dumb_list.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- dumb_list.c 7 Feb 2006 16:34:55 -0000 1.1 +++ dumb_list.c 8 Feb 2006 04:35:56 -0000 1.2 @@ -1,4 +1,5 @@ #include <string.h> //string funcs +#include <stdio.h> #include <stdlib.h> #include <sys/types.h> @@ -143,12 +144,47 @@ } void -dumb_list_del(Dumb_List * list) +dumb_list_dump(Dumb_List *list, int level) { int i; E_FREE(list->elements); + for (i = 0; i < list->size; i++) + { + int j; + + for (j = 0; j < level; j++) + printf(" "); + switch (list->elements[i].type) + { + case DUMB_LIST_ELEMENT_TYPE_STRING : + { + printf("%s\n", (char *) list->elements[i].element); + } + break; + + case DUMB_LIST_ELEMENT_TYPE_LIST : + { + dumb_list_dump((Dumb_List *) list->elements[i].element, level + 1); + } + break; + + default : + { + printf("UNKNOWN ELEMENT TYPE!\n"); + } + break; + } + } +} + +void +dumb_list_del(Dumb_List * list) +{ + int i; + + for (i = list->size - 1; i >= 0; i--) { if (list->elements[i].type == DUMB_LIST_ELEMENT_TYPE_LIST) =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e_utils/src/bin/e17genmenu/src/bin/dumb_list.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- dumb_list.h 7 Feb 2006 16:34:55 -0000 1.1 +++ dumb_list.h 8 Feb 2006 04:35:56 -0000 1.2 @@ -39,10 +39,11 @@ Dumb_List *dumb_list_from_paths(char *paths); Dumb_List *dumb_list_new(char *buffer); - Dumb_List *dumb_list_add(Dumb_List * list, char *element); - Dumb_List *dumb_list_extend(Dumb_List * list, char *element); - int dumb_list_exist(Dumb_List * list, char *element); - void dumb_list_del(Dumb_List * list); + Dumb_List *dumb_list_add(Dumb_List *list, char *element); + Dumb_List *dumb_list_extend(Dumb_List *list, char *element); + int dumb_list_exist(Dumb_List *list, char *element); + void dumb_list_dump(Dumb_List *list, int level); + void dumb_list_del(Dumb_List *list); # ifdef __cplusplus } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e_utils/src/bin/e17genmenu/src/bin/main.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- main.c 5 Feb 2006 10:40:51 -0000 1.13 +++ main.c 8 Feb 2006 04:35:56 -0000 1.14 @@ -5,6 +5,7 @@ #include "icons.h" #include "sort.h" #include "fdo_paths.h" +#include "xmlame.h" /* Function Prototypes */ void _e17genmenu_backup(void); @@ -52,8 +53,16 @@ char *directory = "Applications.directory"; char *desktop = "xterm.desktop"; char *icon = "tux.png"; + Dumb_List *menus = NULL; printf("Path to %s is %s\n", menu, path); + menus = xmlame_new(NULL); + if (menus) + { + xmlame_fill(path); + dumb_list_dump(menus, 0); + printf("\n\n"); + } free(path); /* During the processing of the menu file, you will need to search for =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e_utils/src/bin/e17genmenu/src/bin/xmlame.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- xmlame.c 7 Feb 2006 18:01:46 -0000 1.1 +++ xmlame.c 8 Feb 2006 04:35:56 -0000 1.2 @@ -15,10 +15,16 @@ * may get away with it. Much testing on lots of systems is highly recommended. */ -Dumb_List *xmlame_new(char *buffer) +Dumb_List * +xmlame_new(char *buffer) { Dumb_List *list; list = dumb_list_new(buffer); return list; } + +void +xmlame_fill(char *file) +{ +} =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e_utils/src/bin/e17genmenu/src/bin/xmlame.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- xmlame.h 7 Feb 2006 18:01:46 -0000 1.1 +++ xmlame.h 8 Feb 2006 04:35:56 -0000 1.2 @@ -4,5 +4,6 @@ #include "dumb_list.h" Dumb_List *xmlame_new(char *buffer); +void xmlame_fill(char *file); #endif ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs