2022-07-29 17:30:05 +02:00
|
|
|
|
//====== Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ======//
|
|
|
|
|
//
|
|
|
|
|
// Purpose:
|
|
|
|
|
//
|
|
|
|
|
// $Workfile: $
|
|
|
|
|
// $Date: $
|
|
|
|
|
//
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
// $Log: $
|
|
|
|
|
//
|
|
|
|
|
// $NoKeywords: $
|
|
|
|
|
//=============================================================================
|
|
|
|
|
|
2023-05-10 00:05:38 +02:00
|
|
|
|
#include "tier0_pch.h"
|
2023-04-06 23:50:48 +02:00
|
|
|
|
#include "tier1/characterset.h"
|
2022-07-29 17:30:05 +02:00
|
|
|
|
|
|
|
|
|
// memdbgon must be the last include file in a .cpp file!!!
|
2023-04-08 18:28:39 +02:00
|
|
|
|
#include "tier0/memdbgon.h"
|
2022-07-29 17:30:05 +02:00
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
// Purpose: builds a simple lookup table of a group of important characters
|
|
|
|
|
// Input : *pParseGroup - pointer to the buffer for the group
|
|
|
|
|
// *pGroupString - null terminated list of characters to flag
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
void CharacterSetBuild(characterset_t* pSetBuffer, const char* pszSetString)
|
|
|
|
|
{
|
2023-04-08 18:28:39 +02:00
|
|
|
|
unsigned int i = 0;
|
2022-07-29 17:30:05 +02:00
|
|
|
|
|
|
|
|
|
// Test our pointers
|
|
|
|
|
if (!pSetBuffer || !pszSetString)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
memset(pSetBuffer->set, 0, sizeof(pSetBuffer->set));
|
|
|
|
|
|
|
|
|
|
while (pszSetString[i])
|
|
|
|
|
{
|
2023-04-08 18:28:39 +02:00
|
|
|
|
unsigned char ch = (unsigned char)pszSetString[i];
|
|
|
|
|
pSetBuffer->set[ch] = 1;
|
2022-07-29 17:30:05 +02:00
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
}
|