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

list.c File Reference

#include "c.h"

Include dependency graph for list.c:

Include dependency graph

Go to the source code of this file.

Functions

List append (void *x, List list)
int length (List list)
void * ltov (List *list, unsigned arena)

Variables

List freenodes


Function Documentation

List append void *  x,
List  list
 

Definition at line 7 of file list.c.

References freenodes, list::link, List, NEW, PERM, and list::x.

Referenced by attach(), bbfile(), bbincr(), compile(), compose(), compound(), dcllocal(), enumdcl(), filename(), ftype(), initinputs(), locus(), idStr::operator+=(), opt(), parameters(), path2list(), printproto(), prof_init(), tempname(), and use().

00007                                 {
00008     List new;
00009 
00010     if ((new = freenodes) != NULL)
00011         freenodes = freenodes->link;
00012     else
00013         NEW(new, PERM);
00014     if (list) {
00015         new->link = list->link;
00016         list->link = new;
00017     } else
00018         new->link = new;
00019     new->x = x;
00020     return new;
00021 }

int length List  list  ) 
 

Definition at line 24 of file list.c.

References list::link, List, and n.

Referenced by __VectorNormalize(), AAS_LoadAASFile(), AAS_LoadAASLump(), AAS_Reachability_EqualFloorHeight(), AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(), AAS_WriteAASLump(), AddSeperators(), idStr::append(), AppendPathSeperator(), idStr::CapLength(), CG_FindClientHeadFile(), CG_FindClientModelFile(), CG_ParticleBloodCloud(), CG_ParticleDust(), ClipToSeperators(), CM_LoadMap(), CM_TraceThroughSphere(), CM_TraceThroughVerticalCylinder(), Com_BlockChecksum(), Com_BlockChecksumKey(), compound(), CopyLump(), emit_dac(), emit_dht(), idStr::EnsureDataWritable(), FS_ListFilteredFiles(), get_app0(), get_app14(), get_dac(), get_dht(), get_dqt(), get_dri(), get_sof(), get_sos(), HL_CopyLump(), HL_LoadBSPFile(), HL_LoadMapFromBSP(), Hunk_Trash(), inflateSetDictionary(), quat_t::Length(), idVec3_t::Length(), LoadBMP(), LoadFile(), LoadFileBlock(), LoadFileNoCrash(), LoadQuakeFile(), LoadScriptFile(), LoadScriptMemory(), LoadSourceFile(), LoadSourceMemory(), ltov(), MSG_Copy(), NET_SendLoopPacket(), NET_SendPacket(), Netchan_Transmit(), quat_t::Normalize(), idVec3_t::Normalize(), parameters(), ParseChunk(), Q1_CopyLump(), Q1_LoadBSPFile(), Q1_LoadMapFromBSP(), Q2_CopyLump(), Q2_LoadBSPFile(), Q2_LoadBSPFileTexinfo(), Q2_LoadMapFromBSP(), Q3_CopyLump(), QCopyFile(), Rankings_DrawName(), Rankings_DrawPassword(), Reached_Train(), ReadQuakeFile(), Sin_CopyLump(), Sin_LoadBSPFile(), Sin_LoadBSPFileTexinfo(), Sin_LoadMapFromBSP(), skip_variable(), SP_func_pendulum(), StripExtension(), StripFilename(), SubdivideMeshQuads(), Sys_SendPacket(), TryLoadFile(), UI_FindClientHeadFile(), VectorLength(), VectorNormalize(), VectorNormalize2(), VL_PlaneForEdgeToWinding(), VL_SmoothenLightmapEdges(), VM_Create(), VM_Restart(), VS_PlaneForEdgeToWinding(), VS_SmoothenLightmapEdges(), WriteLBMfile(), and WritePCXfile().

00024                       {
00025     int n = 0;
00026 
00027     if (list) {
00028         List lp = list;
00029         do
00030             n++;
00031         while ((lp = lp->link) != list);
00032     }
00033     return n;
00034 }

void* ltov List list,
unsigned  arena
 

Definition at line 37 of file list.c.

References array(), freenodes, i, length(), list::link, List, newarray, and list::x.

Referenced by bbvars(), compose(), compound(), enumdcl(), ftype(), main(), parameters(), and printproto().

00037                                        {
00038     int i = 0;
00039     void **array = newarray(length(*list) + 1, sizeof array[0], arena);
00040 
00041     if (*list) {
00042         List lp = *list;
00043         do {
00044             lp = lp->link;
00045             array[i++] = lp->x;
00046         } while (lp != *list);
00047 #ifndef PURIFY
00048         lp = (*list)->link;
00049         (*list)->link = freenodes;
00050         freenodes = lp;
00051 #endif
00052     }
00053     *list = NULL;
00054     array[i] = NULL;
00055     return array;
00056 }

Here is the call graph for this function:


Variable Documentation

List freenodes [static]
 

Definition at line 4 of file list.c.

Referenced by append(), and ltov().


Generated on Thu Aug 25 15:54:48 2005 for Quake III Arena by  doxygen 1.3.9.1