core/sm_stringutil.h
author David Anderson <dvander@alliedmods.net>
Wed Aug 01 02:12:47 2007 +0000 (2007-08-01)
changeset 1231 17badaf66ce4
parent 833 732bedfcbe3e
child 1330 ab94316bb52b
permissions -rw-r--r--
updated more header files (mostly internal now)
dvander@370
     1
/**
ds@653
     2
 * vim: set ts=4 :
dvander@1231
     3
 * ================================================================
dvander@1231
     4
 * SourceMod
dvander@1231
     5
 * Copyright (C) 2004-2007 AlliedModders LLC.  All rights reserved.
dvander@1231
     6
 * ================================================================
dvander@370
     7
 *
dvander@1231
     8
 * This program is free software; you can redistribute it and/or 
dvander@1231
     9
 * modify it under the terms of the GNU General Public License, 
dvander@1231
    10
 * version 3.0, as published by the Free Software Foundation.
dvander@1231
    11
 * 
dvander@1231
    12
 * This program is distributed in the hope that it will be useful,
dvander@1231
    13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
dvander@1231
    14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dvander@1231
    15
 * GNU General Public License for more details.
dvander@1231
    16
 *
dvander@1231
    17
 * You should have received a copy of the GNU General Public License
dvander@1231
    18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
dvander@1231
    19
 *
dvander@1231
    20
 * As a special exception, AlliedModders LLC gives you permission to 
dvander@1231
    21
 * link the code of this program (as well as its derivative works) to 
dvander@1231
    22
 * "Half-Life 2," the "Source Engine," the "SourcePawn JIT," and any 
dvander@1231
    23
 * Game MODs that run on software by the Valve Corporation.  You must 
dvander@1231
    24
 * obey the GNU General Public License in all respects for all other 
dvander@1231
    25
 * code used. Additionally, AlliedModders LLC grants this exception 
dvander@1231
    26
 * to all derivative works. AlliedModders LLC defines further 
dvander@1231
    27
 * exceptions, found in LICENSE.txt (as of this writing, version 
dvander@1231
    28
 * JULY-31-2007), or <http://www.sourcemod.net/license.php>.
dvander@370
    29
 *
dvander@370
    30
 * Version: $Id$
dvander@370
    31
 */
dvander@370
    32
faluco@227
    33
#ifndef _INCLUDE_SOURCEMOD_STRINGUTIL_H_
faluco@227
    34
#define _INCLUDE_SOURCEMOD_STRINGUTIL_H_
faluco@227
    35
faluco@227
    36
#include <math.h>
faluco@227
    37
#include "sp_vm_api.h"
dvander@233
    38
#include "sp_typeutil.h"
faluco@227
    39
faluco@227
    40
using namespace SourcePawn;
faluco@227
    41
faluco@389
    42
#define LANG_SERVER		0
faluco@389
    43
ds@582
    44
#define IS_STR_FILLED(var) (var[0] != '\0')
ds@582
    45
faluco@227
    46
size_t atcprintf(char *buffer, size_t maxlen, const char *format, IPluginContext *pCtx, const cell_t *params, int *param);
faluco@230
    47
const char *stristr(const char *str, const char *substr);
dvander@233
    48
unsigned int strncopy(char *dest, const char *src, size_t count);
dvander@276
    49
size_t gnprintf(char *buffer, size_t maxlen, const char *format, void **args);
faluco@274
    50
size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...);
dvander@663
    51
size_t UTIL_FormatArgs(char *buffer, size_t maxlength, const char *fmt, va_list ap);
ds@504
    52
char *sm_strdup(const char *str);
dvander@728
    53
size_t CorePlayerTranslate(int client, char *buffer, size_t maxlength, const char *phrase, void **params);
dvander@833
    54
unsigned int UTIL_ReplaceAll(char *subject, size_t maxlength, const char *search, const char *replace);
dvander@833
    55
char *UTIL_ReplaceEx(char *subject, size_t maxLen, const char *search, size_t searchLen, const char *replace, size_t replaceLen);
faluco@227
    56
faluco@227
    57
#endif // _INCLUDE_SOURCEMOD_STRINGUTIL_H_