mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-08 10:58:36 +00:00
commit1e5213d43fAuthor: David Anderson <dvander@alliedmods.net> Date: Sat Jun 21 04:09:27 2014 -0700 Quell MSVC C99 bugs. commitf2e166c592Author: David Anderson <dvander@alliedmods.net> Date: Sat Jun 21 03:59:23 2014 -0700 Fix varying levels of stupid memory errors. commitb0773d7be4Author: David Anderson <dvander@alliedmods.net> Date: Sat Jun 21 03:36:39 2014 -0700 Fix memory leak in parsing some control flow structures. commit5aca55713cAuthor: David Anderson <dvander@alliedmods.net> Date: Sat Jun 21 03:35:17 2014 -0700 Fix memory leak in struct parsing. commitb46ec5cd28Author: David Anderson <dvander@alliedmods.net> Date: Sat Jun 21 03:32:03 2014 -0700 Fix build. commit17bbbb9a46Merge:c0834092107599Author: David Anderson <dvander@alliedmods.net> Date: Sat Jun 21 01:26:27 2014 -0700 Merge branch 'master' into methodmaps commitc083409b56Author: David Anderson <dvander@alliedmods.net> Date: Fri Jun 20 23:49:36 2014 -0700 Add VS2k13 support. commitb799377849Author: David Anderson <dvander@alliedmods.net> Date: Fri Jun 20 01:28:08 2014 -0700 Implement destructors. commit1a340dec26Author: David Anderson <dvander@alliedmods.net> Date: Fri Jun 20 00:08:04 2014 -0700 Add some tests. commit12db52ee64Author: David Anderson <dvander@alliedmods.net> Date: Fri Jun 20 00:05:49 2014 -0700 Initial implementation of constructors. commit074669a658Author: David Anderson <dvander@alliedmods.net> Date: Thu Jun 19 22:42:35 2014 -0700 Add simple test harness. commit27c1e3cf14Author: David Anderson <dvander@alliedmods.net> Date: Thu Jun 19 22:15:42 2014 -0700 Big refactoring for new syntax. commitf3c37fdc91Author: David Anderson <dvander@alliedmods.net> Date: Thu Jun 19 22:12:54 2014 -0700 Refactor tests for the new syntax. commit6211f392f8Author: David Anderson <dvander@alliedmods.net> Date: Wed Jun 18 22:25:48 2014 -0700 Make lexer tokens an enum. commit5210b01375Author: David Anderson <dvander@alliedmods.net> Date: Tue Jun 17 06:48:15 2014 -0700 Add comment. commit06688ff4acAuthor: David Anderson <dvander@alliedmods.net> Date: Tue Jun 17 06:46:10 2014 -0700 Allow |this| to be a base type of the methodmap. commit05cf368202Author: David Anderson <dvander@alliedmods.net> Date: Mon Jun 16 22:11:58 2014 -0700 Unify duplicate typesymbol checking. commit09161bf269Author: David Anderson <dvander@alliedmods.net> Date: Mon Jun 16 19:53:36 2014 -0700 Close loophole that allowed methodmaps for enums. commit5bb4aeba89Author: David Anderson <dvander@alliedmods.net> Date: Mon Jun 16 01:50:42 2014 -0700 Add tests and dbi/handle changes. commitb9203e2491Author: David Anderson <dvander@alliedmods.net> Date: Mon Jun 16 01:38:29 2014 -0700 Ensure methodmap tags are fixed. commit878b80fd87Author: David Anderson <dvander@alliedmods.net> Date: Mon Jun 16 01:36:04 2014 -0700 Implement inheritance. commit6ba9e004fbAuthor: David Anderson <dvander@alliedmods.net> Date: Mon Jun 16 01:31:00 2014 -0700 Refactor matchtag() to not be insane. commit4ede6343b0Author: David Anderson <dvander@alliedmods.net> Date: Mon Jun 16 01:20:50 2014 -0700 Fix indenting. commite3ddef8916Author: David Anderson <dvander@alliedmods.net> Date: Mon Jun 16 01:20:27 2014 -0700 Initial prototype.
105 lines
4.1 KiB
SourcePawn
105 lines
4.1 KiB
SourcePawn
/**
|
|
* vim: set ts=4 :
|
|
* =============================================================================
|
|
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
|
|
* =============================================================================
|
|
*
|
|
* This file is part of the SourceMod/SourcePawn SDK.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it under
|
|
* the terms of the GNU General Public License, version 3.0, as published by the
|
|
* Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
* details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along with
|
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
* As a special exception, AlliedModders LLC gives you permission to link the
|
|
* code of this program (as well as its derivative works) to "Half-Life 2," the
|
|
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
|
|
* by the Valve Corporation. You must obey the GNU General Public License in
|
|
* all respects for all other code used. Additionally, AlliedModders LLC grants
|
|
* this exception to all derivative works. AlliedModders LLC defines further
|
|
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
|
|
* or <http://www.sourcemod.net/license.php>.
|
|
*
|
|
* Version: $Id$
|
|
*/
|
|
|
|
#if defined _handles_included
|
|
#endinput
|
|
#endif
|
|
#define _handles_included
|
|
|
|
/**
|
|
* Preset Handle values.
|
|
*/
|
|
enum Handle: // Tag disables introducing "Handle" as a symbol.
|
|
{
|
|
INVALID_HANDLE = 0,
|
|
};
|
|
|
|
|
|
/**
|
|
* Closes a Handle. If the handle has multiple copies open,
|
|
* it is not destroyed unless all copies are closed.
|
|
*
|
|
* @note Closing a Handle has a different meaning for each Handle type. Make
|
|
* sure you read the documentation on whatever provided the Handle.
|
|
*
|
|
* @param hndl Handle to close.
|
|
* @error Invalid handles will cause a run time error.
|
|
*/
|
|
native CloseHandle(Handle:hndl);
|
|
|
|
/**
|
|
* Clones a Handle. When passing handles in between plugins, caching handles
|
|
* can result in accidental invalidation when one plugin releases the Handle, or is its owner
|
|
* is unloaded from memory. To prevent this, the Handle may be "cloned" with a new owner.
|
|
*
|
|
* @note Usually, you will be cloning Handles for other plugins. This means that if you clone
|
|
* the Handle without specifying the new owner, it will assume the identity of your original calling
|
|
* plugin, which is not very useful. You should either specify that the receiving plugin should
|
|
* clone the handle on its own, or you should explicitly clone the Handle using the receiving plugin's
|
|
* identity Handle.
|
|
*
|
|
* @param hndl Handle to clone/duplicate.
|
|
* @param plugin Optional Handle to another plugin to mark as the new owner.
|
|
* If no owner is passed, the owner becomes the calling plugin.
|
|
* @return Handle on success, INVALID_HANDLE if not cloneable.
|
|
* @error Invalid handles will cause a run time error.
|
|
*/
|
|
native Handle:CloneHandle(Handle:hndl, Handle:plugin=INVALID_HANDLE);
|
|
|
|
/**
|
|
* Helper for object-oriented syntax.
|
|
*/
|
|
methodmap Handle
|
|
{
|
|
public Clone() = CloneHandle;
|
|
public ~Handle() = CloseHandle;
|
|
};
|
|
|
|
/**
|
|
* Do not use this function. Returns if a Handle and its contents
|
|
* are readable, whereas INVALID_HANDLE only checks for the absence
|
|
* of a Handle.
|
|
*
|
|
* This function is intended only for tests where the validity of a
|
|
* Handle can absolutely not be known.
|
|
*
|
|
* Do not use this to check the return values of functions, or to
|
|
* check if timers should be closed (except in very rare cases).
|
|
* This function is for very specific usage and using it for general
|
|
* purpose routines can and will hide very subtle bugs.
|
|
*
|
|
* @param hndl Handle to test for validity.
|
|
* @return True if handle is valid, false otherwise.
|
|
*/
|
|
#pragma deprecated Do not use this function.
|
|
native bool:IsValidHandle(Handle:hndl);
|