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

FNMATCH.H File Reference

Go to the source code of this file.

Functions

int match (char *mask, char *name)


Function Documentation

int match char *  mask,
char *  name
 

Definition at line 26 of file FNMATCH.CPP.

References m, n, q, Reg1, and tolower().

Referenced by BotAddressedToBot(), BotCheckConsoleMessages(), BotConstructChatMessage(), BotExpandChatMessage(), BotFindMatch(), BotGetPatrolWaypoints(), BotGetTime(), BotInitialChat(), BotMatch_AttackEnemyBase(), BotMatch_Camp(), BotMatch_CheckPoint(), BotMatch_CTF(), BotMatch_DefendKeyArea(), BotMatch_Dismiss(), BotMatch_EnterGame(), BotMatch_FormationSpace(), BotMatch_GetFlag(), BotMatch_GetItem(), BotMatch_HelpAccompany(), BotMatch_JoinSubteam(), BotMatch_Kill(), BotMatch_LeadTheWay(), BotMatch_LeaveSubteam(), BotMatch_NewLeader(), BotMatch_Patrol(), BotMatch_ReturnFlag(), BotMatch_RushBase(), BotMatch_StartTeamLeaderShip(), BotMatch_StopTeamLeaderShip(), BotMatch_Suicide(), BotMatch_TaskPreference(), BotMatch_WhatAreYouDoing(), BotMatch_WhereAreYou(), BotMatch_WhichTeam(), BotMatchMessage(), BotMatchVariable(), BotReplyChat(), CG_ScanForExistingClientInfo(), CG_SetDeferredClientInfo(), Cmd_List_f(), COM_MatchToken(), Com_MatchToken(), Com_StartupVariable(), Cvar_List_f(), G_Find(), MatchToken(), StringsMatch(), SV_RankJoinGameCBF(), SV_RankNewGameCBF(), SV_RankReportInt(), SV_RankReportStr(), trap_BotFindMatch(), and trap_BotMatchVariable().

00027 {
00028     Reg1    unsigned char   *m = (unsigned char *)mask, *n = (unsigned char *)name;
00029     char    *ma = mask, *na = name;
00030     int wild = 0, q = 0;
00031 
00032     while (1)
00033         {
00034         if (*m == '*')
00035            {
00036             while (*m == '*')
00037                 m++;
00038             wild = 1;
00039             ma = (char *)m;
00040             na = (char *)n;
00041             }
00042 
00043         if (!*m)
00044             {
00045             if (!*n)
00046                 return 0;
00047             for (m--; (m > (unsigned char *)mask) && (*m == '?'); m--)
00048                 ;
00049             if ((*m == '*') && (m > (unsigned char *)mask) &&
00050                 (m[-1] != '\\'))
00051                 return 0;
00052             if (!wild) 
00053                 return 1;
00054             m = (unsigned char *)ma;
00055             n = (unsigned char *)++na;
00056             }
00057         else if (!*n)
00058             {
00059             while(*m == '*')
00060                 m++;
00061             return (*m != 0);
00062             }
00063         if ((*m == '\\') && ((m[1] == '*') || (m[1] == '?')))
00064             {
00065             m++;
00066             q = 1;
00067             }
00068         else
00069             q = 0;
00070 
00071         if ((tolower(*m) != tolower(*n)) && ((*m != '?') || q))
00072             {
00073             if (!wild)
00074                 return 1;
00075             m = (unsigned char *)ma;
00076             n = (unsigned char *)++na;
00077             }
00078         else
00079             {
00080             if (*m)
00081                 m++;
00082             if (*n)
00083                 n++;
00084             }
00085         }
00086 }

Here is the call graph for this function:


Generated on Thu Aug 25 17:36:26 2005 for Quake III Arena by  doxygen 1.3.9.1