Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

list-object.c

Go to the documentation of this file.
00001 /* Writes all objects, and stats to a HTML file */
00002 #if defined(macintosh)
00003 #include <types.h>
00004 #include <time.h>
00005 #else
00006 #include <sys/types.h>
00007 #include <sys/time.h>
00008 #endif
00009 #include <stdio.h>
00010 #include <string.h>
00011 #include <stdlib.h>
00012 #include <unistd.h>              
00013 #include "merc.h"
00014 #include "interp.h"
00015 #include "recycle.h"
00016 #include "tables.h"
00017 #include "lookup.h"
00018 
00019 void do_dump_objects (CHAR_DATA *ch, char *argument)
00020 {
00021     char buf[MAX_STRING_LENGTH];
00022     BUFFER *buffer;
00023     OBJ_INDEX_DATA *obj;
00024     int number=0;
00025     int vnum;
00026     int match=0;
00027     char object_name[MAX_STRING_LENGTH];
00028     extern int top_obj_index;
00029     FILE *fp;
00030     
00031 
00032     buffer = new_buf();
00033 
00034     send_to_char("Beginning dump, now.\n\r",ch);
00035     if ((fp = fopen("/var/www/html/object.html", "r")) != NULL)
00036     {
00037         fclose(fp);
00038         unlink("/var/www/html/object.html");
00039     }
00040 
00041     append_file2("", "/var/www/html/object.html", "<body bgcolor=black><font color=red><pre>");
00042     for (vnum = 0; match < top_obj_index; vnum++)
00043     {
00044         if ((obj = get_obj_index(vnum)) != NULL)
00045         {
00046             match++;
00047             number++;
00048             sprintf(object_name, "%s", obj->short_descr);
00049             sprintf(buf, "Name:%-40.40s Vnum:%-10d\n", object_name, obj->vnum);
00050             append_file2("", "/var/www/html/object.html", buf);
00051         }
00052     }
00053     sprintf(buf, "\n\r\n\rObjects total: %d", number);
00054     append_file2("", "/var/www/html/object.html",buf);
00055     send_to_char("\n\r\n\rFreeing up buffer...",ch);
00056     free_buf(buffer);
00057     send_to_char("Done.\n\rObject dump complete.\n\r",ch);
00058     return;
00059 }

Generated on Thu Jan 13 21:48:11 2005 for Beyond the Shadows by  doxygen 1.4.0