plugins/include/core.inc
author Scott Ehlert <ds@alliedmods.net>
Wed Aug 15 06:19:30 2007 +0000 (2007-08-15)
changeset 1330 ab94316bb52b
parent 1093 817cf175650b
child 1378 115ba755bcdf
permissions -rw-r--r--
Updated license headers on virtually all files with extremely minor changes in the name of some sort of strange consistency.
All plugin and include file headers also have been changed to say about GPL3 instead of GPL2.

(This day shall henceforth be known as the Eighty Column Massacre of '07)
dvander@374
     1
/**
ds@475
     2
 * vim: set ts=4 :
ds@1330
     3
 * =============================================================================
dvander@374
     4
 * SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
ds@1330
     5
 * =============================================================================
ds@1330
     6
 *
ds@1330
     7
 * This file is part of the SourceMod/SourcePawn SDK.
dvander@374
     8
 *
ds@1330
     9
 * This program is free software; you can redistribute it and/or modify it under
ds@1330
    10
 * the terms of the GNU General Public License, version 3.0, as published by the
ds@1330
    11
 * Free Software Foundation.
ds@1330
    12
 * 
ds@1330
    13
 * This program is distributed in the hope that it will be useful, but WITHOUT
ds@1330
    14
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
ds@1330
    15
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
ds@1330
    16
 * details.
ds@1330
    17
 *
ds@1330
    18
 * You should have received a copy of the GNU General Public License along with
ds@1330
    19
 * this program.  If not, see <http://www.gnu.org/licenses/>.
ds@1330
    20
 *
ds@1330
    21
 * As a special exception, AlliedModders LLC gives you permission to link the
ds@1330
    22
 * code of this program (as well as its derivative works) to "Half-Life 2," the
ds@1330
    23
 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
ds@1330
    24
 * by the Valve Corporation.  You must obey the GNU General Public License in
ds@1330
    25
 * all respects for all other code used.  Additionally, AlliedModders LLC grants
ds@1330
    26
 * this exception to all derivative works.  AlliedModders LLC defines further
ds@1330
    27
 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
ds@1330
    28
 * or <http://www.sourcemod.net/license.php>.
dvander@374
    29
 *
dvander@374
    30
 * Version: $Id$
dvander@374
    31
 */
dvander@374
    32
dvander@298
    33
#if defined _core_included
dvander@298
    34
 #endinput
dvander@298
    35
#endif
dvander@298
    36
#define _core_included
dvander@298
    37
dvander@572
    38
#include <version>
dvander@572
    39
dvander@572
    40
#define SOURCEMOD_PLUGINAPI_VERSION		2
dvander@298
    41
struct PlVers
dvander@298
    42
{
dvander@298
    43
	version,
dvander@572
    44
	String:filevers[],
dvander@298
    45
};
dvander@298
    46
dvander@483
    47
/**
ds@696
    48
 * Function helper values.
ds@621
    49
 */
ds@621
    50
enum Function
ds@621
    51
{
ds@621
    52
     INVALID_FUNCTION = -1,
ds@621
    53
};
ds@621
    54
ds@621
    55
/**
dvander@483
    56
 * Specifies what to do after a hook completes.
dvander@483
    57
 */
dvander@497
    58
enum Action
dvander@483
    59
{
dvander@483
    60
	Plugin_Continue = 0,	/**< Continue with the original action */
dvander@483
    61
	Plugin_Handled = 3,		/**< Handle the action at the end (don't call it) */
dvander@483
    62
	Plugin_Stop = 4,		/**< Immediately stop the hook chain and handle the original */
dvander@815
    63
};
dvander@483
    64
dvander@298
    65
public PlVers:__version = 
dvander@298
    66
{
dvander@298
    67
	version = SOURCEMOD_PLUGINAPI_VERSION,
dvander@572
    68
	filevers = SOURCEMOD_VERSION
dvander@298
    69
};
dvander@298
    70
dvander@618
    71
/**
dvander@618
    72
 * Plugin status values.
dvander@618
    73
 */
dvander@618
    74
enum PluginStatus
dvander@618
    75
{
dvander@618
    76
	Plugin_Running=0,		/**< Plugin is running */
dvander@618
    77
	/* All states below are "temporarily" unexecutable */
dvander@618
    78
	Plugin_Paused,			/**< Plugin is loaded but paused */
dvander@618
    79
	Plugin_Error,			/**< Plugin is loaded but errored/locked */
dvander@618
    80
	/* All states below do not have all natives */
dvander@618
    81
	Plugin_Loaded,			/**< Plugin has passed loading and can be finalized */
dvander@618
    82
	Plugin_Failed,			/**< Plugin has a fatal failure */
dvander@618
    83
	Plugin_Created,			/**< Plugin is created but not initialized */
dvander@618
    84
	Plugin_Uncompiled,		/**< Plugin is not yet compiled by the JIT */
dvander@618
    85
	Plugin_BadLoad,			/**< Plugin failed to load */
dvander@618
    86
};
dvander@618
    87
dvander@618
    88
/**
dvander@618
    89
 * Plugin information properties.
dvander@618
    90
 */
dvander@618
    91
enum PluginInfo
dvander@618
    92
{
dvander@618
    93
	PlInfo_Name,			/**< Plugin name */
dvander@618
    94
	PlInfo_Author,			/**< Plugin author */
dvander@618
    95
	PlInfo_Description,		/**< Plugin description */
dvander@618
    96
	PlInfo_Version,			/**< Plugin verison */
dvander@618
    97
	PlInfo_URL,				/**< Plugin URL */
dvander@618
    98
};
dvander@618
    99
dvander@619
   100
/**
dvander@619
   101
 * Defines how an extension must expose itself for autoloading.
dvander@619
   102
 */
dvander@298
   103
struct Extension
dvander@298
   104
{
dvander@938
   105
	const String:name[],	/**< Short name */
dvander@938
   106
	const String:file[],	/**< Default file name */
dvander@938
   107
	bool:autoload,			/**< Whether or not to auto-load */
dvander@938
   108
	bool:required,			/**< Whether or not to require */
dvander@298
   109
};
dvander@298
   110
dvander@1092
   111
/**
dvander@1092
   112
 * Defines how a plugin must expose itself for native requiring.
dvander@1092
   113
 */
dvander@1092
   114
struct SharedPlugin
dvander@1092
   115
{
dvander@1092
   116
	const String:name[],	/**< Short name */
dvander@1093
   117
	const String:file[],	/**< File name */
dvander@1092
   118
	bool:required,			/**< Whether or not to require */
dvander@1092
   119
};
dvander@1092
   120
dvander@1000
   121
public Float:NULL_VECTOR[3];		/**< Pass this into certain functions to act as a C++ NULL */
dvander@1000
   122
public const String:NULL_STRING[1];	/**< pass this into certain functions to act as a C++ NULL */
dvander@938
   123
dvander@298
   124
#define AUTOLOAD_EXTENSIONS
dvander@298
   125
#define REQUIRE_EXTENSIONS
dvander@1092
   126
#define REQUIRE_PLUGIN