#ifndef __CPlugInList_h__
#define __CPlugInList_h__ 1
#include "PrivateTypes.h"
#include "DSMutexSemaphore.h"
#include "PluginData.h"
class CServerPlugin;
const sInt32 kPlugInListNoErr = 0;
const sInt32 kInvalidPlugInName = -10128;
const sInt32 kMaxPlugInsLoaded = -10129;
const sInt32 kPlugInFound = -10130;
const sInt32 kPlugInNotFound = -10131;
class CPlugInList {
public:
typedef struct sTableData
{
const char *fName;
const char *fVersion;
const char *fConfigAvail;
const char *fConfigFile;
CServerPlugin *fPluginPtr;
FourCharCode fKey;
uInt32 fState;
} sTableData;
enum {
kMaxPlugIns = 128
};
public:
CPlugInList ( void );
virtual ~CPlugInList ( void );
sInt32 AddPlugIn ( const char *inName, const char *inVersion, const char *inConfigAvail, const char *inConfigFile, FourCharCode inKey, CServerPlugin *inPlugin );
sInt32 DeletePlugIn ( const char *inName );
void InitPlugIns ( void );
sInt32 IsPresent ( const char *inName );
sInt32 GetState ( const char *inName, uInt32 *outState );
sInt32 SetState ( const char *inName, const uInt32 inState );
uInt32 GetPlugInCount ( void );
uInt32 GetActiveCount ( void );
sTableData* GetPlugInInfo ( uInt32 inIndex );
CServerPlugin* Next ( uInt32 *inIndex );
CServerPlugin* GetPlugInPtr ( const char *inName );
CServerPlugin* GetPlugInPtr ( const uInt32 inKey );
private:
uInt32 fPICount;
DSMutexSemaphore fMutex;
sTableData fTable[ kMaxPlugIns ];
};
#endif