#include <stdio.h> #include <strings.h> #include <ctype.h> #include "structs.h" #include "utils.h" #include "db.h" main() { struct obj_file_u st; FILE *fl; int i=0,j,k=0; char buf[500]; if(!(fl=fopen("LIB/pcobjs.obj","r"))) { printf("can't open file?\n"); return; } while(!feof(fl)) { fseek(fl,i*sizeof(struct obj_file_u),0); fread(&st,sizeof(struct obj_file_u),1,fl); /* for(k=0;k<35;k++) { j=st.objects[k].item_number; if(j==14018 || j==14019 || j==14020) printf("%s has %d\n",st.owner,j); }*/ printf("*** %s ***\n",st.owner); printf("coins %d\n",st.gold_left); for(k=0;k<35;k++) if(st.objects[k].item_number!=-1) printf("item %d\n",st.objects[k].item_number); i++; } fclose(fl); }