Filled out more license headers

Completed lots of missing documentation
Fixed /** on one-liners, must be /**<

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40377
This commit is contained in:
David Anderson
2007-01-26 01:55:06 +00:00
parent e281a27c14
commit 676a6ea760
25 changed files with 1215 additions and 381 deletions
+6 -1
View File
@@ -1,5 +1,10 @@
#include "extension.h"
Sample g_Sample;
/**
* @file extension.cpp
* @brief Implement extension code here.
*/
Sample g_Sample; /**< Global singleton for your extension's main interface */
SMEXT_LINK(&g_Sample);
+7
View File
@@ -1,8 +1,15 @@
#ifndef _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
#define _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
/**
* @file extension.h
* @brief Sample extension code header.
*/
#include "smsdk_ext.h"
/**
* @brief Sample implementation of the SDK Extension.
* Note: Uncomment one of the pre-defined virtual functions in order to use it.
+5
View File
@@ -1,6 +1,11 @@
#ifndef _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_
#define _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_
/**
* @file smsdk_config.h
* @brief Contains macros for configuring basic extension information.
*/
/* Basic information exposed publically */
#define SMEXT_CONF_NAME "Sample Extension"
#define SMEXT_CONF_DESCRIPTION "Sample extension to help developers"
+32 -11
View File
@@ -1,13 +1,33 @@
/**
* ===============================================================
* SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
* ===============================================================
*
* This file is part of the SourceMod/SourcePawn SDK. This file may only be used
* or modified under the Terms and Conditions of its License Agreement, which is found
* in LICENSE.txt. The Terms and Conditions for making SourceMod extensions/plugins
* may change at any time. To view the latest information, see:
* http://www.sourcemod.net/license.php
*
* Version: $Id$
*/
#include <stdio.h>
#include <malloc.h>
#include "smsdk_ext.h"
IShareSys *g_pShareSys = NULL;
IExtension *myself = NULL;
IHandleSys *g_pHandleSys = NULL;
ISourceMod *g_pSM = NULL;
IForwardManager *g_pForwards = NULL;
/**
* @file smsdk_ext.cpp
* @brief Contains wrappers for making Extensions easier to write.
*/
IShareSys *g_pShareSys = NULL; /**< Share system */
IExtension *myself = NULL; /**< Ourself */
IHandleSys *g_pHandleSys = NULL; /**< Handle system */
ISourceMod *g_pSM = NULL; /**< SourceMod helpers */
IForwardManager *g_pForwards = NULL; /**< Forward system */
/** Exports the main interface */
PLATFORM_EXTERN_C IExtensionInterface *GetSMExtAPI()
{
return g_pExtensionIface;
@@ -139,14 +159,15 @@ void SDKExtension::SDK_OnAllLoaded()
#if defined SMEXT_CONF_METAMOD
PluginId g_PLID = 0;
ISmmPlugin *g_PLAPI = NULL;
SourceHook::ISourceHook *g_SHPtr = NULL;
ISmmAPI *g_SMAPI = NULL;
PluginId g_PLID = 0; /**< Metamod plugin ID */
ISmmPlugin *g_PLAPI = NULL; /**< Metamod plugin API */
SourceHook::ISourceHook *g_SHPtr = NULL; /**< SourceHook pointer */
ISmmAPI *g_SMAPI = NULL; /**< SourceMM API pointer */
IVEngineServer *engine = NULL;
IServerGameDLL *gamedll = NULL;
IVEngineServer *engine = NULL; /**< IVEngineServer pointer */
IServerGameDLL *gamedll = NULL; /**< IServerGameDLL pointer */
/** Exposes the extension to Metamod */
SMM_API void *PL_EXPOSURE(const char *name, int *code)
{
if (name && !strcmp(name, PLAPI_NAME))
+50
View File
@@ -1,6 +1,25 @@
/**
* ===============================================================
* SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
* ===============================================================
*
* This file is part of the SourceMod/SourcePawn SDK. This file may only be used
* or modified under the Terms and Conditions of its License Agreement, which is found
* in LICENSE.txt. The Terms and Conditions for making SourceMod extensions/plugins
* may change at any time. To view the latest information, see:
* http://www.sourcemod.net/license.php
*
* Version: $Id$
*/
#ifndef _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
#define _INCLUDE_SOURCEMOD_EXTENSION_BASESDK_H_
/**
* @file smsdk_ext.h
* @brief Contains wrappers for making Extensions easier to write.
*/
#include "smsdk_config.h"
#include <IExtensionSys.h>
#include <IHandleSys.h>
@@ -24,6 +43,7 @@ class SDKExtension :
public IExtensionInterface
{
public:
/** Constructor */
SDKExtension();
public:
/**
@@ -88,28 +108,56 @@ public: //IExtensionInterface
virtual bool OnExtensionLoad(IExtension *me, IShareSys *sys, char *error, size_t err_max, bool late);
virtual void OnExtensionUnload();
virtual void OnExtensionsAllLoaded();
/** Returns whether or not this is a Metamod-based extension */
virtual bool IsMetamodExtension();
/**
* @brief Called when the pause state changes.
*
* @param state True if being paused, false if being unpaused.
*/
virtual void OnExtensionPauseChange(bool state);
/** Returns name */
virtual const char *GetExtensionName();
/** Returns URL */
virtual const char *GetExtensionURL();
/** Returns log tag */
virtual const char *GetExtensionTag();
/** Returns author */
virtual const char *GetExtensionAuthor();
/** Returns version string */
virtual const char *GetExtensionVerString();
/** Returns description string */
virtual const char *GetExtensionDescription();
/** Returns date string */
virtual const char *GetExtensionDateString();
#if defined SMEXT_CONF_METAMOD
public: //ISmmPlugin
/** Called when the extension is attached to Metamod. */
virtual bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlength, bool late);
/** Returns the author to MM */
virtual const char *GetAuthor();
/** Returns the name to MM */
virtual const char *GetName();
/** Returns the description to MM */
virtual const char *GetDescription();
/** Returns the URL to MM */
virtual const char *GetURL();
/** Returns the license to MM */
virtual const char *GetLicense();
/** Returns the version string to MM */
virtual const char *GetVersion();
/** Returns the date string to MM */
virtual const char *GetDate();
/** Returns the logtag to MM */
virtual const char *GetLogTag();
/** Called on unload */
virtual bool Unload(char *error, size_t maxlen);
/** Called on pause */
virtual bool Pause(char *error, size_t maxlen);
/** Called on unpause */
virtual bool Unpause(char *error, size_t maxlen);
private:
bool m_SourceMMLoaded;
@@ -132,7 +180,9 @@ extern IVEngineServer *engine;
extern IServerGameDLL *gamedll;
#endif
/** Creates a SourceMod interface macro pair */
#define SM_MKIFACE(name) SMINTERFACE_##name##_NAME, SMINTERFACE_##name##_VERSION
/** Automates retrieving SourceMod interfaces */
#define SM_GET_IFACE(prefix,addr) \
if (!g_pShareSys->RequestInterface(SM_MKIFACE(prefix), myself, (SMInterface **)&addr)) { \
if (error) { \