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

wf1.c File Reference

Go to the source code of this file.

Data Structures

struct  node

Functions

 err (char *s)
int getword (char *buf)
int isletter (c)
nodelookup (char *word, struct node **p)
nodelookup ()
 main ()
int strcmp (char *s1, char *s2)
 tprint (struct node *tree)

Variables

int next
node words [2000]


Function Documentation

err char *  s  ) 
 

Definition at line 26 of file wf1.c.

References exit(), printf(), and s.

Referenced by _GLimp_RestoreOriginalVideoSettings(), CheckErrors(), CreateGameWindow(), dodefine(), Error(), FindQuakeFilesInZip(), FS_LoadZipFile(), gettok(), GL_CheckErrors(), GLimp_SetGamma(), GLW_StartDriverAndSetMode(), IsPentium(), jpeg_create_compress(), jpeg_create_decompress(), lookup(), NET_IPSocket(), NET_IPXSocket(), NET_OpenSocks(), R_Init(), RE_BeginFrame(), SNDDMA_Init(), Sys_CaptureActiveDisplays(), Sys_DisplayToUse(), Sys_GetGammaTable(), Sys_GetPacket(), Sys_LoadDll(), Sys_PreventMouseMovement(), Sys_QueryVideoMemory(), Sys_ReenableMouseMovement(), Sys_ResumeGL(), Sys_SendPacket(), Sys_StoreGammaTables(), Sys_Unhide(), Sys_UnloadDll(), unzCloseCurrentFile(), unzGoToFirstFile(), unzGoToNextFile(), unzlocal_CheckCurrentFileCoherencyHeader(), unzlocal_GetCurrentFileInfoInternal(), unzLocateFile(), unzOpen(), unzOpenCurrentFile(), unzReadCurrentFile(), unzSetCurrentFileInfoPosition(), and Warning().

00026                 {
00027     printf("? %s\n", s);
00028     exit(1);
00029 }

Here is the call graph for this function:

int getword char *  buf  ) 
 

Definition at line 32 of file wf1.c.

References c, getchar, isletter(), and s.

Referenced by main().

00032                             {
00033     char *s;
00034     int c;
00035 
00036     while ((c = getchar()) != -1 && isletter(c) == 0)
00037         ;
00038     for (s = buf; c = isletter(c); c = getchar())
00039         *s++ = c;
00040     *s = 0;
00041     if (s > buf)
00042         return (1);
00043     return (0);
00044 }

Here is the call graph for this function:

int isletter  ) 
 

Definition at line 47 of file wf1.c.

References c.

Referenced by getword().

00047                 {
00048     if (c >= 'A' && c <= 'Z')
00049         c += 'a' - 'A';
00050     if (c >= 'a' && c <= 'z')
00051         return (c);
00052     return (0);
00053 }

struct node* lookup char *  word,
struct node **  p
 

Definition at line 56 of file wf1.c.

References cond(), err(), lookup(), malloc(), next, p, strcmp(), strcpy(), strlen(), and words.

00056                                                           {
00057     int cond;
00058     char *malloc();
00059 
00060     if (*p) {
00061         cond = strcmp(word, (*p)->word);
00062         if (cond < 0)
00063             return lookup(word, &(*p)->left);
00064         else if (cond > 0)
00065             return lookup(word, &(*p)->right);
00066         else
00067             return *p;
00068     }
00069     if (next >= 2000)
00070         err("out of node storage");
00071     words[next].count = 0;
00072     words[next].left = words[next].right = 0;
00073     words[next].word = malloc(strlen(word) + 1);
00074     if (words[next].word == 0)
00075         err("out of word storage");
00076     strcpy(words[next].word, word);
00077     return *p = &words[next++];
00078 }

Here is the call graph for this function:

struct node* lookup  ) 
 

Referenced by control(), dclglobal(), dcllocal(), dclparam(), decl(), doadefine(), dodefine(), enumdcl(), eval(), expandrow(), fieldref(), funcdefn(), gettok(), lookup(), main(), newstruct(), nonterm(), setup_kwtab(), statement(), stmtlabel(), structdcl(), term(), tokval(), and tree().

main  ) 
 

Definition at line 13 of file wf1.c.

References node::count, getword(), lookup(), next, root(), and tprint().

00013        {
00014     struct node *root;
00015     char word[20];
00016 
00017     root = 0;
00018     next = 0;
00019     while (getword(word))
00020         lookup(word, &root)->count++;
00021     tprint(root);
00022     return 0;
00023 }

Here is the call graph for this function:

int strcmp char *  s1,
char *  s2
 

Definition at line 90 of file wf1.c.

Referenced by AAS_AlwaysTriggered_r(), AAS_BestReachableFromJumpPadArea(), AAS_GetJumpPadInfo(), AAS_ParseBSPEntities(), AAS_PositionBrush(), AAS_Reachability_Elevator(), AAS_Reachability_FuncBobbing(), AAS_Reachability_JumpPad(), AAS_Reachability_Teleport(), AAS_SetWeaponJumpAreaFlags(), AAS_ValidEntity(), AAS_ValueForBSPEpairKey(), acaller(), CMainFrame::AddPlugInMenuItem(), asdl_init(), ASE_KeyGEOMOBJECT(), ASE_KeyMAP_DIFFUSE(), ASE_KeyMATERIAL(), ASE_KeyMATERIAL_LIST(), ASE_KeyMESH(), ASE_KeyMESH_ANIMATION(), ASE_KeyMESH_FACE_LIST(), ASE_KeyMESH_TVERTLIST(), ASE_KeyMESH_VERTEX_LIST(), ASE_KeyTFACE_LIST(), ASE_ParseBracedBlock(), ASE_Process(), ASE_SkipEnclosingBraces(), BotCheckEvents(), BotFindCachedCharacter(), BotFindStringInList(), BotGetActivateGoal(), BotGoalForBSPEntity(), BotInitInfoEntities(), BotInitLevelItems(), BotLoadCharacterFromFile(), BotLoadChatFile(), BotLoadInitialChat(), BotLoadMatchTemplates(), BotLoadReplyChat(), BotLoadSynonyms(), Brush_Parse(), BrushPrimit_Parse(), CG_CustomSound(), CG_Init(), CG_RegisterItemSounds(), CG_ServerCommand(), CG_VoiceChat(), CIN_PlayCinematic(), CL_ConfigstringModified(), CL_Connect_f(), CL_GetServerCommand(), CL_MotdPacket(), CL_Reconnect_f(), ClientConnect(), ClientNumberFromString(), ClientUserinfoChanged(), CM_LoadMap(), Cmd_AddCommand(), Cmd_RemoveCommand(), cmp(), Com_MatchToken(), COM_MatchToken(), Com_ParseInfos(), Com_StartupVariable(), CPlugInManager::CommitEntityHandleToMap(), Controls_DrawPlayer(), Controls_GetCvarDefault(), Controls_GetCvarValue(), CopyToBodyQue(), Cvar_Get(), Cvar_Set2(), Cvar_SetCheatState(), DeleteKey(), DrawPathLines(), Eclass_ForName(), emitkids(), emitnts(), emitrecalc(), EndOfScript(), Entity_Parse(), Entity_Write(), find(), FindEntity(), FindField(), FindFuzzyWeight(), FindMiptex(), FindReplace(), FindTargetEntity(), FloodEntities(), funcdefn(), G_CallSpawn(), G_FindConfigstringIndex(), G_FindTeams(), G_MissileImpact(), G_MoverPush(), G_ParseInfos(), get(), GetCachedModel(), getopt(), GetToken(), GibEntity(), Group_ForName(), HL_LoadMapFromBSP(), IN_Frame(), Info_RemoveKey(), Info_RemoveKey_Big(), initinputs(), CRadiantApp::InitInstance(), LightMain(), LoadItemConfig(), LoadModel(), LoadPortals(), LoadShader(), LoadWeaponConfig(), lookup(), main(), main_init(), Map_FindClass(), Map_ImportBuffer(), Map_LoadFile(), MatchToken(), NET_StringToAdr(), CMainFrame::OnFileSave(), CCharBuffer::operator!=(), Str::operator!=(), CCharBuffer::operator==(), Str::operator==(), PK3FileInfo::operator==(), operator==(), opt(), option(), idSplinePosition::parse(), idInterpolatedPosition::parse(), idFixedPosition::parse(), idCameraFOV::parse(), idCameraEvent::parse(), ParseEntity(), parseflags(), ParseMapEntity(), ParsePatch(), ParseRawBrush(), ParseShaderFile(), ParseSkyParms(), ParseVector(), Patch_Parse(), PC_CheckTokenString(), PC_Directive_define(), PC_Directive_undef(), PC_DollarEvaluate(), PC_Evaluate(), PC_EvaluateTokens(), PC_ExpectTokenString(), PC_FindDefine(), PC_FindDefineParm(), PC_FindHashedDefine(), PC_ReadDefineParms(), PC_ReadDirective(), PC_ReadDollarDirective(), PC_ReadLine(), PC_SkipUntilString(), Pickup_Team(), PlayerModel_BuildList(), PlayerSettings_DrawPlayer(), pragma(), prof_init(), PS_CheckTokenString(), PS_ExpectTokenString(), PS_SkipUntilString(), Q1_LoadMapFromBSP(), Q2_ParseBrush(), Q2_ParseBSPEntity(), Q2_ParseMapEntity(), Q3_ParseBSPEntity(), QERApp_TryTextureForName(), R_AddMD3Surfaces(), R_FindImageFile(), R_GetTag(), R_ScreenShot_f(), R_ScreenShotJPEG_f(), RandomString(), RE_RegisterModel(), RE_RegisterSkin(), ReadFuzzySeperators_r(), ReadNumber(), ReadSignedFloat(), ReadSignedInt(), ReadStructure(), ReadValue(), ReadWeightConfig(), S_FindWavChunk(), Save256Image(), ScaleWeight(), SetKeyValue(), SetLightStyles(), ShaderQTextureExists(), Signup_MenuEvent(), Sin_ParseBSPEntity(), SortTextures(), string(), String_Alloc(), SV_DirectConnect(), SV_ExecuteClientCommand(), SV_RankBegin(), SV_RankUserValidate(), SV_SetConfigstring(), SVC_RemoteCommand(), Sys_ParseArgs(), Terrain_Parse(), TexinfoForBrushTexture(), Texture_ForName(), Texture_ForNamePath(), Think_SetupTrainTargets(), UI_BuildQ3Model_List(), UI_ParseInfos(), unzStringFileNameCompare(), ValueForKey(), VisMain(), VL_LoadPortals(), VLightMain(), VM_SymbolToValue(), VS_LoadPortals(), VSoundMain(), and WriteMapFileSafe().

00090                                   {
00091     while (*s1 == *s2) {
00092         if (*s1++ == 0)
00093             return 0;
00094         ++s2;
00095     }
00096     if (*s1 == 0)
00097         return -1;
00098     else if (*s2 == 0)
00099         return 1;
00100     return *s1 - *s2;
00101 }

tprint struct node tree  ) 
 

Definition at line 81 of file wf1.c.

References tree::left, printf(), tree::right, and tree().

Referenced by main().

00081                                 {
00082     if (tree) {
00083         tprint(tree->left);
00084         printf("%d\t%s\n", tree->count, tree->word);
00085         tprint(tree->right);
00086     }
00087 }

Here is the call graph for this function:


Variable Documentation

int next
 

Definition at line 9 of file wf1.c.

Referenced by _prologue(), AddBrushListToTail(), Brush_Free(), Brush_RebuildBrush(), Brush_RemoveEmptyFaces(), Brush_Resize(), Brush_Subtract(), BuildFaceTree_r(), CG_AddLocalEntities(), CG_AddMarks(), CG_AddParticles(), CG_InterpolateEntityPosition(), CG_InterpolatePlayerState(), CG_OilSlickRemove(), CG_SnowLink(), ChopBrushes(), CleanCopyEntities(), CM_SubdivideGridColumns(), CSG_MakeHollow(), CSG_Merge(), CSG_Subtract(), CullList(), DeleteKey(), Entity_FreeEpairs(), FreeBrushList(), FreeValueKeys(), FS_Shutdown(), InterpolateInteriorPoints(), LeakFile(), linearize(), lookup(), main(), Map_ApplyRegion(), Map_BuildBrushData(), Map_RegionOff(), Map_SaveBetween(), Map_SaveFile(), Map_SaveSelected(), MoveBrushesToWorld(), PC_FreeDefine(), CXYWnd::ProduceSplitLists(), PutMeshOnCurve(), PutPointsOnCurve(), QE_CountBrushesAndUpdateStatusBar(), R_SubdividePatchToGrid(), Reached_Train(), Select_AllOfType(), Select_Clone(), Select_CompleteTall(), Select_Inside(), Select_Invert(), Select_PartialTall(), Select_Touching(), stringn(), SubdivideMesh(), SV_AreaEntities_r(), Think_SetupTrainTargets(), toQuat(), and Tree_PruneNodes_r().

struct node words[2000]
 


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