#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "qbsp.h"
Include dependency graph for l_log.c:

Go to the source code of this file.
Data Structures | |
| struct | logfile_s |
Defines | |
| #define | MAX_LOGFILENAMESIZE 1024 |
Typedefs | |
| typedef logfile_s | logfile_t |
Functions | |
| void | Log_Close (void) |
| FILE * | Log_FileStruct (void) |
| void | Log_Flush (void) |
| void | Log_Open (char *filename) |
| void | Log_Print (char *fmt,...) |
| void | Log_Shutdown (void) |
| void | Log_UnifyEndOfLine (char *buf) |
| void | Log_Write (char *fmt,...) |
| void | Log_WriteTimeStamped (char *fmt,...) |
Variables | |
| logfile_t | logfile |
|
|
|
|
|
|
|
|
Definition at line 73 of file l_log.c. References botimport, fclose(), logfile_s::filename, logfile_s::fp, logfile, printf(), PRT_ERROR, and PRT_MESSAGE. 00074 {
00075 if (!logfile.fp)
00076 {
00077 printf("no log file to close\n");
00078 return;
00079 } //end if
00080 if (fclose(logfile.fp))
00081 {
00082 printf("can't close log file %s\n", logfile.filename);
00083 return;
00084 } //end if
00085 logfile.fp = NULL;
00086 printf("Closed log %s\n", logfile.filename);
00087 } //end of the function Log_Close
|
Here is the call graph for this function:

|
|
Definition at line 201 of file l_log.c. References logfile_s::fp, and logfile.
|
|
|
Definition at line 211 of file l_log.c. References fflush(), logfile_s::fp, and logfile.
|
Here is the call graph for this function:

|
|
Definition at line 46 of file l_log.c. References botimport, logfile_s::filename, fopen(), logfile_s::fp, LibVarValue(), logfile, MAX_LOGFILENAMESIZE, printf(), PRT_ERROR, PRT_MESSAGE, strlen(), and strncpy(). Referenced by Export_BotLibSetup(), and main(). 00047 {
00048 if (!filename || !strlen(filename))
00049 {
00050 printf("openlog <filename>\n");
00051 return;
00052 } //end if
00053 if (logfile.fp)
00054 {
00055 printf("log file %s is already opened\n", logfile.filename);
00056 return;
00057 } //end if
00058 logfile.fp = fopen(filename, "wb");
00059 if (!logfile.fp)
00060 {
00061 printf("can't open the log file %s\n", filename);
00062 return;
00063 } //end if
00064 strncpy(logfile.filename, filename, MAX_LOGFILENAMESIZE);
00065 printf("Opened log %s\n", logfile.filename);
00066 } //end of the function Log_Create
|
Here is the call graph for this function:

|
||||||||||||
Here is the call graph for this function:

|
|
Definition at line 94 of file l_log.c. References logfile_s::fp, Log_Close(), and logfile.
|
Here is the call graph for this function:

|
|
Definition at line 104 of file l_log.c. References i, memmove(), and strlen(). Referenced by Log_Print(), and Log_Write(). 00105 {
00106 int i;
00107
00108 for (i = 0; buf[i]; i++)
00109 {
00110 if (buf[i] == '\n')
00111 {
00112 if (i <= 0 || buf[i-1] != '\r')
00113 {
00114 memmove(&buf[i+1], &buf[i], strlen(&buf[i])+1);
00115 buf[i] = '\r';
00116 i++;
00117 } //end if
00118 } //end if
00119 } //end for
00120 } //end of the function Log_UnifyEndOfLine
|
Here is the call graph for this function:

|
||||||||||||
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 177 of file l_log.c. References botlibglobals, fflush(), logfile_s::fp, fprintf(), logfile, logfile_s::numwrites, QDECL, botlib_globals_s::time, va_end, va_list, va_start, and vfprintf(). 00178 {
00179 va_list ap;
00180
00181 if (!logfile.fp) return;
00182 /* fprintf(logfile.fp, "%d %02d:%02d:%02d:%02d ",
00183 logfile.numwrites,
00184 (int) (botlibglobals.time / 60 / 60),
00185 (int) (botlibglobals.time / 60),
00186 (int) (botlibglobals.time),
00187 (int) ((int) (botlibglobals.time * 100)) -
00188 ((int) botlibglobals.time) * 100);*/
00189 va_start(ap, fmt);
00190 vfprintf(logfile.fp, fmt, ap);
00191 va_end(ap);
00192 logfile.numwrites++;
00193 fflush(logfile.fp);
00194 } //end of the function Log_Write
|
Here is the call graph for this function:

|
|
Definition at line 38 of file l_log.c. Referenced by Com_Printf(), Com_Shutdown(), Hunk_Log(), Hunk_SmallLog(), Log_Close(), Log_FileStruct(), Log_Flush(), Log_Open(), Log_Print(), Log_Shutdown(), Log_Write(), Log_WriteTimeStamped(), and Z_LogZoneHeap(). |
1.3.9.1