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

list-object.c File Reference

#include <sys/types.h>
#include <sys/time.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "merc.h"
#include "interp.h"
#include "recycle.h"
#include "tables.h"
#include "lookup.h"

Include dependency graph for list-object.c:

Go to the source code of this file.

Functions

void do_dump_objects (CHAR_DATA *ch, char *argument)


Function Documentation

void do_dump_objects CHAR_DATA ch,
char *  argument
 

Definition at line 19 of file list-object.c.

References append_file2(), free_buf(), get_obj_index(), MAX_STRING_LENGTH, new_buf(), send_to_char(), obj_index_data::short_descr, top_obj_index, unlink(), and obj_index_data::vnum.

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 }

Here is the call graph for this function:


Generated on Thu Jan 13 22:01:10 2005 for Beyond the Shadows by  doxygen 1.4.0