mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-02 23:41:28 +00:00
start documenting things (progs building still borked)
This is an imperfect revision of history.
This commit is contained in:
parent
780fb41858
commit
8770df39e5
35 changed files with 1367 additions and 196 deletions
|
@ -24,7 +24,20 @@ EXTRA_DIST= 3dfx.txt CodingStyle glqnotes.txt \
|
|||
data/docs/install.quake data/docs/install.quake2 data/docs/readme \
|
||||
data/docs/readme.glquake data/docs/readme.squake data/docs/readme.x11 \
|
||||
\
|
||||
ideas/quakedownload.txt ideas/rhamph.txt ideas/serverlist.txt
|
||||
ideas/quakedownload.txt ideas/rhamph.txt ideas/serverlist.txt \
|
||||
\
|
||||
progs/vm-mem.fig
|
||||
|
||||
doc: quakeforge.dox
|
||||
%.png: %.fig
|
||||
@mkdir -p `dirname $@`
|
||||
fig2dev -L png $< $@
|
||||
|
||||
%.eps: %.fig
|
||||
@mkdir -p `dirname $@`
|
||||
fig2dev -L ps $< $@
|
||||
|
||||
progs/vm-mem.png: progs/vm-mem.fig
|
||||
progs/vm-mem.eps: progs/vm-mem.fig
|
||||
|
||||
doc: quakeforge.dox progs/vm-mem.png progs/vm-mem.eps
|
||||
doxygen quakeforge.dox
|
||||
|
|
29
doc/progs/vm-exec.c
Normal file
29
doc/progs/vm-exec.c
Normal file
|
@ -0,0 +1,29 @@
|
|||
#include "QF/progs.h"
|
||||
|
||||
int
|
||||
call_progs_main (progs_t *pr, int argc, const char **argv)
|
||||
{
|
||||
int i;
|
||||
dfunction_t *dfunc;
|
||||
func_t progs_main = 0;
|
||||
string_t *pr_argv;
|
||||
|
||||
if ((dfunc = PR_FindFunction (pr, "main"))) {
|
||||
progs_main = dfunc - pr->pr_functions;
|
||||
} else {
|
||||
PR_Undefined (pr, "function", "main");
|
||||
return -1;
|
||||
}
|
||||
|
||||
PR_PushFrame (pr);
|
||||
pr_argv = PR_Zone_Malloc (pr, (argc + 1) * 4);
|
||||
for (i = 0; i < argc; i++)
|
||||
pr_argv[i] = PR_SetTempString (pr, argv[1 + i]);
|
||||
pr_argv[i] = 0;
|
||||
P_INT (pr, 0) = argc;
|
||||
P_POINTER (pr, 1) = PR_SetPointer (pr, pr_argv);
|
||||
PR_ExecuteProgram (pr, progs_main);
|
||||
PR_PopFrame (pr);
|
||||
PR_Zone_Free (pr, pr_argv);
|
||||
return R_INT (pr);
|
||||
}
|
|
@ -345,8 +345,12 @@ WARN_LOGFILE =
|
|||
# directories like "/usr/src/myproject". Separate the files or directories
|
||||
# with spaces.
|
||||
|
||||
INPUT = @top_srcdir@/include @top_srcdir@/libs @top_srcdir@/nq
|
||||
INPUT += @top_srcdir@/qw @top_srcdir@/tools
|
||||
INPUT = @top_srcdir@/include
|
||||
INPUT += @top_srcdir@/libs
|
||||
INPUT += @top_srcdir@/nq
|
||||
INPUT += @top_srcdir@/qtv
|
||||
INPUT += @top_srcdir@/qw
|
||||
INPUT += @top_srcdir@/tools
|
||||
|
||||
# If the value of the INPUT tag contains directories, you can use the
|
||||
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
|
||||
|
@ -367,9 +371,16 @@ RECURSIVE = YES
|
|||
# excluded from the INPUT source files. This way you can easily exclude a
|
||||
# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
||||
|
||||
EXCLUDE = qc-lex.c qc-parse.c qc-parse.h
|
||||
EXCLUDE += fbset_modes_l.c fbset_modes_y.c fbset_modes_y.h
|
||||
EXCLUDE = @top_srcdir@/tools/qfcc/source/qc-lex.c
|
||||
EXCLUDE += @top_srcdir@/tools/qfcc/source/qc-parse.c
|
||||
EXCLUDE += @top_srcdir@/tools/qfcc/source/qc-parse.h
|
||||
EXCLUDE += @top_srcdir@/tools/qfcc/test
|
||||
EXCLUDE += @top_srcdir@/tools/texpaint
|
||||
EXCLUDE += @top_srcdir@/libs/video/targets/fbset_modes_l.c
|
||||
EXCLUDE += @top_srcdir@/libs/video/targets/fbset_modes_y.c
|
||||
EXCLUDE += @top_srcdir@/libs/video/targets/fbset_modes_y.h
|
||||
EXCLUDE += @top_srcdir@/tools/Forge
|
||||
EXCLUDE += @top_srcdir@/include/QF/GL
|
||||
|
||||
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories
|
||||
# that are symbolic links (a Unix filesystem feature) are excluded from the input.
|
||||
|
@ -386,7 +397,8 @@ EXCLUDE_PATTERNS =
|
|||
# directories that contain example code fragments that are included (see
|
||||
# the \include command).
|
||||
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATH = @top_srcdir@/doc
|
||||
EXAMPLE_PATH += @top_srcdir@/doc/progs
|
||||
|
||||
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
|
||||
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
|
||||
|
@ -406,7 +418,8 @@ EXAMPLE_RECURSIVE = NO
|
|||
# directories that contain image that are included in the documentation (see
|
||||
# the \image command).
|
||||
|
||||
IMAGE_PATH =
|
||||
IMAGE_PATH = @top_builddir@/doc
|
||||
IMAGE_PATH += @top_builddir@/doc/progs
|
||||
|
||||
# The INPUT_FILTER tag can be used to specify a program that doxygen should
|
||||
# invoke to filter for each input file. Doxygen will invoke the filter program
|
||||
|
@ -430,7 +443,7 @@ FILTER_SOURCE_FILES = NO
|
|||
# If the SOURCE_BROWSER tag is set to YES then a list of source files will
|
||||
# be generated. Documented entities will be cross-referenced with these sources.
|
||||
|
||||
SOURCE_BROWSER = YES
|
||||
SOURCE_BROWSER = NO
|
||||
|
||||
# Setting the INLINE_SOURCES tag to YES will include the body
|
||||
# of functions and classes directly in the documentation.
|
||||
|
|
|
@ -32,6 +32,13 @@
|
|||
#ifndef __QF_cbuf_h
|
||||
#define __QF_cbuf_h
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \defgroup cbuf Command buffer management.
|
||||
*/
|
||||
//@{
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "QF/qtypes.h"
|
||||
|
@ -95,4 +102,7 @@ void Cbuf_Execute (cbuf_t *cbuf);
|
|||
void Cbuf_Execute_Stack (cbuf_t *cbuf);
|
||||
void Cbuf_Execute_Sets (cbuf_t *cbuf);
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif//__QF_cbuf_h
|
||||
|
|
|
@ -29,10 +29,20 @@
|
|||
#ifndef __checksum_h
|
||||
#define __checksum_h
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \addtogroup crc
|
||||
*/
|
||||
//@{
|
||||
|
||||
#include "QF/qtypes.h"
|
||||
|
||||
unsigned int Com_BlockChecksum (const void *buffer, int length);
|
||||
void Com_BlockFullChecksum (const void *buffer, int len, unsigned char *outbuf);
|
||||
byte COM_BlockSequenceCRCByte (const byte *base, int length, int sequence);
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif // __checksum_h
|
||||
|
|
|
@ -29,6 +29,13 @@
|
|||
#ifndef __QF_cmd_h
|
||||
#define __QF_cmd_h
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \defgroup cmd Command management.
|
||||
*/
|
||||
//@{
|
||||
|
||||
#include "QF/qtypes.h"
|
||||
|
||||
typedef void (*xcommand_t) (void);
|
||||
|
@ -66,4 +73,7 @@ void Cmd_Exec_File (struct cbuf_s *cbuf, const char *path, int qfs);
|
|||
extern struct cbuf_args_s *cmd_args;
|
||||
extern struct cvar_s *cmd_warncmd;
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif//__QF_cmd_h
|
||||
|
|
|
@ -29,6 +29,13 @@
|
|||
#ifndef __crc_h
|
||||
#define __crc_h
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \defgroup crc Checksum generation.
|
||||
*/
|
||||
//@{
|
||||
|
||||
#include "QF/qtypes.h"
|
||||
|
||||
void CRC_Init(unsigned short *crcvalue);
|
||||
|
@ -37,4 +44,7 @@ void CRC_ProcessBlock (byte *start, unsigned short *crcvalue, int count);
|
|||
unsigned short CRC_Value(unsigned short crcvalue);
|
||||
unsigned short CRC_Block (byte *start, int count);
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif // __crc_h
|
||||
|
|
|
@ -29,6 +29,13 @@
|
|||
#ifndef __cvar_h
|
||||
#define __cvar_h
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \defgroup cvar Configuration variables
|
||||
*/
|
||||
//@{
|
||||
|
||||
#include "QF/qtypes.h"
|
||||
#include "QF/quakeio.h"
|
||||
|
||||
|
@ -126,4 +133,7 @@ void Cvar_Shutdown (void);
|
|||
|
||||
extern cvar_t *cvar_vars;
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif // __cvar_h
|
||||
|
|
|
@ -29,6 +29,13 @@
|
|||
#ifndef __dstring_h
|
||||
#define __dstring_h
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \defgroup dstring Dynamic Strings
|
||||
*/
|
||||
//@{
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
@ -150,4 +157,7 @@ int davsprintf (dstring_t *dstr, const char *fmt, va_list args);
|
|||
int dasprintf (dstring_t *dstr, const char *fmt, ...) __attribute__((format(printf,2,3)));
|
||||
//@}
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif // __dstring_h
|
||||
|
|
|
@ -29,6 +29,13 @@
|
|||
#ifndef __hash_h
|
||||
#define __hash_h
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \defgroup hash Hash tables
|
||||
*/
|
||||
//@{
|
||||
|
||||
typedef struct hashtab_s hashtab_t;
|
||||
|
||||
/** create a new hash table:
|
||||
|
@ -154,4 +161,7 @@ void **Hash_GetList (hashtab_t *tab);
|
|||
*/
|
||||
void Hash_Stats (hashtab_t *tab);
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif // __hash_h
|
||||
|
|
|
@ -31,6 +31,13 @@
|
|||
#ifndef __QF_idparse_h
|
||||
#define __QF_idparse_h
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \addtogroup cbuf
|
||||
*/
|
||||
//@{
|
||||
|
||||
extern const char *com_token;
|
||||
|
||||
struct cbuf_args_s;
|
||||
|
@ -40,4 +47,7 @@ void COM_TokenizeString (const char *str, struct cbuf_args_s *args);
|
|||
|
||||
extern struct cbuf_interpreter_s id_interp;
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif//__QF_idparse_h
|
||||
|
|
|
@ -29,6 +29,13 @@
|
|||
#ifndef _INFO_H
|
||||
#define _INFO_H
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \defgroup info Info Keys
|
||||
*/
|
||||
//@{
|
||||
|
||||
#include <stdlib.h> // for size_t. sys/types.h SHOULD be used, but can't :(bc)
|
||||
#include <QF/qtypes.h>
|
||||
|
||||
|
@ -60,4 +67,7 @@ void Info_Destroy (info_t *info);
|
|||
char *Info_MakeString (info_t *info, int (*filter)(const char *));
|
||||
void Info_AddKeys (info_t *info, info_t *keys);
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif // _INFO_H
|
||||
|
|
|
@ -29,6 +29,13 @@
|
|||
#ifndef __mathlib_h
|
||||
#define __mathlib_h
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \defgroup mathlib Vector and matrix functions
|
||||
*/
|
||||
//@{
|
||||
|
||||
#include <math.h>
|
||||
#include "QF/qtypes.h"
|
||||
|
||||
|
@ -312,4 +319,7 @@ VectorNormalize (vec3_t v)
|
|||
return length;
|
||||
}
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif // __mathlib_h
|
||||
|
|
|
@ -30,6 +30,13 @@
|
|||
#ifndef __mdfour_h
|
||||
#define __mdfour_h
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \addtogroup crc
|
||||
*/
|
||||
//@{
|
||||
|
||||
#include "QF/uint32.h"
|
||||
|
||||
#define MDFOUR_DIGEST_BYTES 16
|
||||
|
@ -44,4 +51,7 @@ void mdfour_update(struct mdfour *md, const unsigned char *in, int n); //old: MD
|
|||
void mdfour_result(struct mdfour *md, unsigned char *out); // old: MD4Final
|
||||
void mdfour(unsigned char *out, const unsigned char *in, int n);
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif // __mdfour_h
|
||||
|
|
|
@ -28,6 +28,13 @@
|
|||
#ifndef _MSG_H
|
||||
#define _MSG_H
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \defgroup msg Message reading and writing
|
||||
*/
|
||||
//@{
|
||||
|
||||
#include "QF/sizebuf.h"
|
||||
|
||||
void MSG_WriteByte (sizebuf_t *sb, int c);
|
||||
|
@ -66,4 +73,7 @@ void MSG_ReadCoordAngleV (qmsg_t *msg, vec3_t coord, vec3_t angles);
|
|||
void MSG_ReadAngleV (qmsg_t *msg, vec3_t angles);
|
||||
float MSG_ReadAngle16 (qmsg_t *msg);
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -32,6 +32,13 @@
|
|||
#ifndef __qf_pak_h
|
||||
#define __qf_pak_h
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \addtogroup pak
|
||||
*/
|
||||
//@{
|
||||
|
||||
#define PAK_PATH_LENGTH 56
|
||||
|
||||
typedef struct {
|
||||
|
@ -45,4 +52,7 @@ typedef struct {
|
|||
int dirlen;
|
||||
} dpackheader_t;
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif//__qf_pak_h
|
||||
|
|
|
@ -31,6 +31,13 @@
|
|||
#ifndef __QF_pakfile_h
|
||||
#define __QF_pakfile_h
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \defgroup pak pakfile proccessing
|
||||
*/
|
||||
//@{
|
||||
|
||||
#include "QF/hash.h"
|
||||
#include "QF/pak.h"
|
||||
#include "QF/quakeio.h"
|
||||
|
@ -60,4 +67,7 @@ int pack_add (pack_t *pack, const char *filename);
|
|||
int pack_extract (pack_t *pack, dpackfile_t *pf);
|
||||
dpackfile_t *pack_find_file (pack_t *pack, const char *filename);
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif//__QF_pakfile_h
|
||||
|
|
|
@ -29,6 +29,13 @@
|
|||
#ifndef __QF_plugin_h_
|
||||
#define __QF_plugin_h_
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \defgroup plugin Plugins
|
||||
*/
|
||||
//@{
|
||||
|
||||
#define QFPLUGIN_VERSION "1.0"
|
||||
|
||||
#include <QF/qtypes.h>
|
||||
|
@ -110,4 +117,7 @@ void PI_Shutdown (void);
|
|||
|
||||
// FIXME: we need a generic function to initialize unused fields
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif // __QF_plugin_h_
|
||||
|
|
1117
include/QF/progs.h
1117
include/QF/progs.h
File diff suppressed because it is too large
Load diff
|
@ -31,6 +31,13 @@
|
|||
#ifndef __qargs_h
|
||||
#define __qargs_h
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \addtogroup misc
|
||||
*/
|
||||
//@{
|
||||
|
||||
#include "QF/qtypes.h"
|
||||
|
||||
extern int com_argc;
|
||||
|
@ -44,4 +51,7 @@ void COM_Init (void);
|
|||
void COM_Init_Cvars (void);
|
||||
void COM_InitArgv (int argc, const char **argv);
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif // __qargs_h
|
||||
|
|
|
@ -31,6 +31,13 @@
|
|||
#ifndef __qendian_h
|
||||
#define __qendian_h
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \defgroup qendian Endian handling functions
|
||||
*/
|
||||
//@{
|
||||
|
||||
#include "QF/qtypes.h"
|
||||
|
||||
#ifndef NULL
|
||||
|
@ -89,4 +96,7 @@ byte ReadByte (struct QFile_s *file);
|
|||
unsigned short ReadShort (struct QFile_s *file);
|
||||
unsigned long ReadLong (struct QFile_s *file);
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif // __qendian_h
|
||||
|
|
|
@ -31,6 +31,13 @@
|
|||
#ifndef __quakefs_h
|
||||
#define __quakefs_h
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \defgroup quakefs Quake Filesystem
|
||||
*/
|
||||
//@{
|
||||
|
||||
#include "QF/qtypes.h"
|
||||
#include "QF/quakeio.h"
|
||||
|
||||
|
@ -125,4 +132,7 @@ void QFS_FilelistFree (filelist_t *list);
|
|||
// FIXME: This is here temporarily until fs_usercfg gets sorted out
|
||||
char *expand_squiggle (const char *path);
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif // __quakefs_h
|
||||
|
|
|
@ -30,6 +30,13 @@
|
|||
#ifndef __quakeio_h
|
||||
#define __quakeio_h
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \defgroup quakeio File IO
|
||||
*/
|
||||
//@{
|
||||
|
||||
typedef struct QFile_s QFile;
|
||||
|
||||
int Qrename(const char *old, const char *new);
|
||||
|
@ -53,4 +60,7 @@ int Qflush(QFile *file);
|
|||
int Qeof(QFile *file);
|
||||
const char *Qgetline(QFile *file);
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif /*__quakeio_h*/
|
||||
|
|
|
@ -28,6 +28,14 @@
|
|||
#ifndef __sizebuf_h
|
||||
#define __sizebuf_h
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \defgroup sizebuf Fixed Size Buffers
|
||||
Fixed size buffer management
|
||||
*/
|
||||
//@{
|
||||
|
||||
#include "QF/qtypes.h"
|
||||
|
||||
typedef struct sizebuf_s
|
||||
|
@ -46,4 +54,7 @@ void *SZ_GetSpace (sizebuf_t *buf, int length);
|
|||
void SZ_Write (sizebuf_t *buf, const void *data, int length);
|
||||
void SZ_Print (sizebuf_t *buf, const char *data); // strcats onto the sizebuf
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif // __sizebuf_h
|
||||
|
|
|
@ -29,6 +29,14 @@
|
|||
#ifndef __sys_h
|
||||
#define __sys_h
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \defgroup sys Portability
|
||||
Non-portable functions
|
||||
*/
|
||||
//@{
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
|
@ -105,4 +113,7 @@ void Sys_DebugLog(const char *file, const char *fmt, ...) __attribute__((format(
|
|||
Sys_Error ("%s: Failed to allocate memory.", __FUNCTION__); \
|
||||
} while (0)
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif // __sys_h
|
||||
|
|
|
@ -30,9 +30,20 @@
|
|||
#ifndef __va_h
|
||||
#define __va_h
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \addtogroup misc
|
||||
Formatted printing.
|
||||
*/
|
||||
//@{
|
||||
|
||||
// does a varargs printf into a temp buffer
|
||||
char *va(const char *format, ...) __attribute__((format(printf,1,2)));
|
||||
// does a varargs printf into a malloced buffer
|
||||
char *nva(const char *format, ...) __attribute__((format(printf,1,2)));
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif // __va_h
|
||||
|
|
|
@ -29,6 +29,13 @@
|
|||
#ifndef __ver_check_h_
|
||||
#define __ver_check_h_
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \addtogroup misc
|
||||
*/
|
||||
//@{
|
||||
|
||||
/*
|
||||
ver_compare
|
||||
|
||||
|
@ -38,4 +45,7 @@
|
|||
*/
|
||||
int ver_compare (const char *, const char *);
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif // __ver_check_h_
|
||||
|
|
|
@ -30,6 +30,14 @@
|
|||
#ifndef _WAD_H
|
||||
#define _WAD_H
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \addtogroup wad
|
||||
Wad Files
|
||||
*/
|
||||
//@{
|
||||
|
||||
#include "QF/wadfile.h"
|
||||
|
||||
|
||||
|
@ -42,4 +50,7 @@ void *W_GetLumpName (const char *name);
|
|||
|
||||
void SwapPic (qpic_t *pic);
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif // _WAD_H
|
||||
|
|
|
@ -25,7 +25,14 @@
|
|||
|
||||
$Id$
|
||||
*/
|
||||
// wadfile.h
|
||||
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \defgroup wad Wad Files
|
||||
Wadfile processing
|
||||
*/
|
||||
//@{
|
||||
|
||||
#ifndef __QF_wadfile_h
|
||||
#define __QF_wadfile_h
|
||||
|
@ -98,4 +105,7 @@ int wad_add_data (wad_t *wad, const char *lumpname, byte type,
|
|||
const void *data, int bytes);
|
||||
lumpinfo_t *wad_find_lump (wad_t *wad, const char *filename);
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif//__QF_wadfile_h
|
||||
|
|
|
@ -28,71 +28,70 @@
|
|||
#ifndef __zone_h
|
||||
#define __zone_h
|
||||
|
||||
/*
|
||||
memory allocation
|
||||
/** \addtogroup utils */
|
||||
//@{
|
||||
|
||||
/** \defgroup zone Memory Management
|
||||
|
||||
H_??? The hunk manages the entire memory block given to quake. It must be
|
||||
contiguous. Memory can be allocated from either the low or high end in a
|
||||
stack fashion. The only way memory is released is by resetting one of the
|
||||
pointers.
|
||||
|
||||
Hunk allocations should be given a name, so the Hunk_Print () function
|
||||
can display usage.
|
||||
|
||||
Hunk allocations are guaranteed to be 16 byte aligned.
|
||||
|
||||
The video buffers are allocated high to avoid leaving a hole underneath
|
||||
server allocations when changing to a higher video mode.
|
||||
|
||||
|
||||
H_??? The hunk manages the entire memory block given to quake. It must be
|
||||
contiguous. Memory can be allocated from either the low or high end in a
|
||||
stack fashion. The only way memory is released is by resetting one of the
|
||||
pointers.
|
||||
Z_??? Zone memory functions used for small, dynamic allocations like text
|
||||
strings from command input. There is only about 48K for it, allocated at
|
||||
the very bottom of the hunk.
|
||||
|
||||
Hunk allocations should be given a name, so the Hunk_Print () function
|
||||
can display usage.
|
||||
Cache_??? Cache memory is for objects that can be dynamically loaded and
|
||||
can usefully stay persistant between levels. The size of the cache
|
||||
fluctuates from level to level.
|
||||
|
||||
Hunk allocations are guaranteed to be 16 byte aligned.
|
||||
|
||||
The video buffers are allocated high to avoid leaving a hole underneath
|
||||
server allocations when changing to a higher video mode.
|
||||
To allocate a cachable object
|
||||
|
||||
|
||||
Z_??? Zone memory functions used for small, dynamic allocations like text
|
||||
strings from command input. There is only about 48K for it, allocated at
|
||||
the very bottom of the hunk.
|
||||
|
||||
Cache_??? Cache memory is for objects that can be dynamically loaded and
|
||||
can usefully stay persistant between levels. The size of the cache
|
||||
fluctuates from level to level.
|
||||
|
||||
To allocate a cachable object
|
||||
Temp_??? Temp memory is used for file loading and surface caching. The
|
||||
size of the cache memory is adjusted so that there is a minimum of 512k
|
||||
remaining for temp memory.
|
||||
|
||||
|
||||
Temp_??? Temp memory is used for file loading and surface caching. The size
|
||||
of the cache memory is adjusted so that there is a minimum of 512k remaining
|
||||
for temp memory.
|
||||
------ Top of Memory -------
|
||||
|
||||
high hunk allocations
|
||||
|
||||
------ Top of Memory -------
|
||||
<--- high hunk reset point held by vid
|
||||
|
||||
high hunk allocations
|
||||
video buffer
|
||||
|
||||
<--- high hunk reset point held by vid
|
||||
z buffer
|
||||
|
||||
video buffer
|
||||
surface cache
|
||||
|
||||
z buffer
|
||||
<--- high hunk used
|
||||
|
||||
surface cache
|
||||
cachable memory
|
||||
|
||||
<--- high hunk used
|
||||
<--- low hunk used
|
||||
|
||||
cachable memory
|
||||
client and server low hunk allocations
|
||||
|
||||
<--- low hunk used
|
||||
|
||||
client and server low hunk allocations
|
||||
|
||||
<-- low hunk reset point held by host
|
||||
|
||||
startup hunk allocations
|
||||
|
||||
Zone block
|
||||
|
||||
----- Bottom of Memory -----
|
||||
<-- low hunk reset point held by host
|
||||
|
||||
startup hunk allocations
|
||||
|
||||
Zone block
|
||||
|
||||
----- Bottom of Memory -----
|
||||
*/
|
||||
//@{
|
||||
|
||||
typedef struct memzone_s memzone_t;
|
||||
|
||||
|
@ -174,4 +173,7 @@ void *QA_realloc (void *ptr, size_t size);
|
|||
void QA_free (void *ptr);
|
||||
char *QA_strdup (const char *s);
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
#endif // __zone_h
|
||||
|
|
|
@ -92,7 +92,7 @@ bi_gib_builtin_f (void)
|
|||
pr_list[i].integer_var = PR_SetTempString (builtin->pr, GIB_Argv(i));
|
||||
|
||||
P_INT (builtin->pr, 0) = GIB_Argc();
|
||||
P_INT (builtin->pr, 1) = POINTER_TO_PROG (builtin->pr, pr_list);
|
||||
P_INT (builtin->pr, 1) = PR_SetPointer (builtin->pr, pr_list);
|
||||
PR_ExecuteProgram (builtin->pr, builtin->func);
|
||||
PR_PopFrame (builtin->pr);
|
||||
PR_Zone_Free (builtin->pr, pr_list);
|
||||
|
|
|
@ -29,11 +29,6 @@
|
|||
#ifndef __sv_pr_cmds_h
|
||||
#define __sv_pr_cmds_h
|
||||
|
||||
#ifndef PROGS_T
|
||||
typedef struct progs_s progs_t;
|
||||
# define PROGS_T
|
||||
#endif
|
||||
|
||||
void PF_error (progs_t *pr);
|
||||
void PF_objerror (progs_t *pr);
|
||||
void PF_makevectors (progs_t *pr);
|
||||
|
|
|
@ -44,6 +44,7 @@ static __attribute__ ((unused)) const char rcsid[] =
|
|||
#include "QF/cmd.h"
|
||||
#include "QF/cvar.h"
|
||||
#include "QF/msg.h"
|
||||
#include "QF/progs.h"
|
||||
#include "QF/ruamoko.h"
|
||||
#include "QF/sys.h"
|
||||
#include "QF/va.h"
|
||||
|
|
|
@ -55,16 +55,22 @@ dump_methods (progs_t *pr, pr_method_list_t *methods, int class)
|
|||
int i;
|
||||
char mark = class ? '+' : '-';
|
||||
const char *sel_id;
|
||||
const char *types;
|
||||
|
||||
while (methods) {
|
||||
pr_method_t *method = methods->method_list;
|
||||
for (i = 0; i < methods->method_count; i++) {
|
||||
if (PR_StringValid (pr, method->method_name.sel_id))
|
||||
sel_id = PR_GetString (pr, method->method_name.sel_id);
|
||||
if (PR_StringValid (pr, method->method_name))
|
||||
sel_id = PR_GetString (pr, method->method_name);
|
||||
else
|
||||
sel_id = "<invalid string>";
|
||||
printf (" %c%s %d @ %d\n", mark, sel_id, method->method_imp,
|
||||
POINTER_TO_PROG (pr, method));
|
||||
if (PR_StringValid (pr, method->method_types))
|
||||
types = PR_GetString (pr, method->method_types);
|
||||
else
|
||||
types = "<invalid string>";
|
||||
printf (" %c%s %d @ %d %s\n", mark, sel_id,
|
||||
method->method_imp,
|
||||
PR_SetPointer (pr, method), types);
|
||||
method++;
|
||||
}
|
||||
methods = &G_STRUCT (pr, pr_method_list_t, methods->method_next);
|
||||
|
@ -98,10 +104,10 @@ dump_class (progs_t *pr, pr_class_t *class)
|
|||
if (class->super_class) {
|
||||
if (PR_StringValid (pr, class->super_class))
|
||||
super_class_name = PR_GetString (pr, class->super_class);
|
||||
printf (" %s @ %d : %s\n", class_name, POINTER_TO_PROG (pr, class),
|
||||
printf (" %s @ %d : %s\n", class_name, PR_SetPointer (pr, class),
|
||||
super_class_name);
|
||||
} else {
|
||||
printf (" %s @ %d\n", class_name, POINTER_TO_PROG (pr, class));
|
||||
printf (" %s @ %d\n", class_name, PR_SetPointer (pr, class));
|
||||
}
|
||||
printf (" %d %d %u %d\n", class->class_pointer, class->version,
|
||||
class->info, class->instance_size);
|
||||
|
@ -120,7 +126,7 @@ dump_category (progs_t *pr, pr_category_t *category)
|
|||
if (PR_StringValid (pr, category->class_name))
|
||||
class_name = PR_GetString (pr, category->class_name);
|
||||
printf (" %s (%s) @ %d\n", class_name, category_name,
|
||||
POINTER_TO_PROG (pr, category));
|
||||
PR_SetPointer (pr, category));
|
||||
dump_methods (pr,
|
||||
&G_STRUCT (pr, pr_method_list_t, category->instance_methods),
|
||||
0);
|
||||
|
|
|
@ -117,6 +117,7 @@ init_qf (void)
|
|||
pr.load_file = load_file;
|
||||
pr.allocate_progs_mem = allocate_progs_mem;
|
||||
pr.free_progs_mem = free_progs_mem;
|
||||
pr.no_exec_limit = 1;
|
||||
|
||||
PR_Init_Cvars ();
|
||||
PR_Init ();
|
||||
|
|
Loading…
Reference in a new issue