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

nanomud-IOstuff.c File Reference

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
#include <winsock.h>
#include <richedit.h>
#include <stdarg.h>
#include <errno.h>
#include "NanoMud.h"

Include dependency graph for nanomud-IOstuff.c:

Include dependency graph

Go to the source code of this file.

Functions

void LOG (char *fmt,...)
int read_string (char buf[], FILE *fp)
void write_buffer (const char *str)


Function Documentation

void LOG char *  fmt,
  ...
 

Definition at line 48 of file nanomud-IOstuff.c.

References write_buffer().

Referenced by fetch_line(), fix_line(), get_fore(), get_hash(), get_line(), log_html(), nano_malloc(), return_usage(), and WinMain().

00049 {
00050 
00051     char buf[2000];
00052     va_list args;
00053     va_start (args, fmt);
00054     vsprintf (buf, fmt, args);
00055     va_end (args);
00056     write_buffer(buf);
00057     
00058 
00059 }

Here is the call graph for this function:

int read_string char  buf[],
FILE *  fp
 

Definition at line 64 of file nanomud-IOstuff.c.

Referenced by do_nasty(), load_scripts(), and load_settings().

00065 {
00066     
00067     int c;
00068     int len=0;
00069     if (fp == NULL)
00070         return -1;
00071     len = 0;
00072     while (!feof(fp))
00073     {
00074 
00075         c = getc(fp);
00076         if (c == '\0')
00077             return len;
00078 
00079         buf[len++] = c;
00080         if (c == '\n')
00081             return len;
00082 
00083         if (c == '\r')
00084             return len;
00085             
00086         
00087         
00088     }
00089     return EOF;
00090 }           

void write_buffer const char *  str  ) 
 

Definition at line 32 of file nanomud-IOstuff.c.

References DEBUG_FILE, FALSE, and GiveError().

Referenced by LOG().

00033 {
00034     FILE *fp;
00035     
00036     if (str == NULL)
00037         return;
00038     
00039     if ((fp = fopen(DEBUG_FILE, "a")) == NULL)
00040     {
00041         GiveError("Unable to open debug file. Please restart with debugging support off.", FALSE);
00042         return;
00043     }
00044     
00045     fprintf(fp, "%s\n", str);
00046     fclose (fp);
00047 }

Here is the call graph for this function:


Generated on Sun Dec 26 17:22:33 2004 for mudclient by  doxygen 1.3.9.1