#include "wmParser.h" #include #include void fgetvalue(char *line,FILE *f) { int count=0; int c; c=fgetc(f); while ((c!=EOF)&&(c!=';')&&(c!='{')&&(c!='}')) { if (c!='\n') line[count++]=c; c=fgetc(f); } line[count]='\0'; } void getMiddleValue(char *value,char *middle) { int length; int count; int mcount; length=strlen(value); count=mcount=0; strcpy(middle,""); while ((value[count]!=',')&&(count=length) return; count++; while ((buffer[count]!='\n')&&(buffer[count]!='\0')&&(count2) { name[strlen(name)-1]='\0'; } if (!strcmp(name,"IconPath")) { strcpy(pathValue,value); } } } fclose(f); if (strlen(pathValue)<1) return(NULL); while ((position=getWMValue(position,pathValue,pathName))>0) { if (first==NULL) { first=(struct stDirectoryll *)malloc(sizeof(struct stDirectoryll)); current=first; } else { temp=(struct stDirectoryll *)malloc(sizeof(struct stDirectoryll)); current->next=temp; current=temp; } strcpy(current->name,pathName); current->next=NULL; } return (first); } int getWMValue(int position,char *valueStr,char *value) { int count,vcount,length; length=strlen(valueStr); count=vcount=0; /* Get rid of the beginning white space or parenthesis */ count=position+strspn(valueStr," \t("); if (count>=length) return -1; while ((valueStr[count]!=',')&&(valueStr[count]!=' ')&& (valueStr[count]!='\t')&&(valueStr[count]!=')')&& (count