Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

module.h File Reference

Module API. More...

#include <stdio.h>
#include <libcomprex/types.h>
#include <libcomprex/fsnode.h>
#include <libcomprex/fp.h>
#include <libcomprex/directory.h>

Go to the source code of this file.

Data Structures

struct  _CxArchiveOps
 File operations structure. More...

struct  _CxModule
 A file or scheme module. More...

struct  _CxSchemeOps
 Scheme operations structure. More...


Defines

#define CX_INIT_ARCHIVE_MODULE(modname, initfunc, archiveops)
 Handles the initialization of modules.

#define CX_INIT_SCHEME_MODULE(modname, initfunc, schemeops)

Typedefs

typedef enum _CxModuleType CxModuleType
 Module types.

typedef _CxArchiveOps CxArchiveOps
 File operations.

typedef _CxSchemeOps CxSchemeOps
 URI scheme operations.

typedef _CxModule CxModule
 A loadable module.


Enumerations

enum  _CxModuleType { CX_MODULE_ARCHIVE, CX_MODULE_SCHEME }
 A module type. More...


Functions

CxModule * cxRegisterModule (const char *name, void *ops, CxModuleType type)
 Registers a module.

CxModule * cxLoadModule (const char *name, CxModuleType type)
 Loads the module of the specified name and type.

void cxUnloadModule (CxModule *module)
 Unloads the specified module.

CxModule * cxGetModule (const char *name, CxModuleType type)
 Returns the specified module.

void cxLinkModule (CxModule **ptr)
 Notifies libcomprex that the module is being used.

void cxUnlinkModule (CxModule **ptr)
 Notifies libcomprex that the module is no longer being used.

CxModule * cxGetFirstModule (CxModuleType type)
 Returns the first module in the list.

void cxCleanupModules ()
 Unloads all modules.

void cxCleanup (void)
 Cleans up the entire library.


Detailed Description

Module API.

Copyright:
(C) 2001-2003 The GNUpdate Project.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library 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 Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


Define Documentation

#define CX_INIT_ARCHIVE_MODULE (  modname,
initfunc,
archiveops    ) 
 

Value:

CxModule *initComprexModule(void) { \
        initfunc(CX_MODULE_ARCHIVE); \
        return cxRegisterModule(#modname, &(archiveops), CX_MODULE_ARCHIVE); \
    }
Handles the initialization of modules.

#define CX_INIT_SCHEME_MODULE (  modname,
initfunc,
schemeops    ) 
 

Value:

CxModule *initComprexModule(void) { \
        initfunc(CX_MODULE_SCHEME); \
        return cxRegisterModule(#modname, &(schemeops), CX_MODULE_SCHEME); \
    }


Typedef Documentation

typedef struct _CxArchiveOps CxArchiveOps
 

File operations.

typedef struct _CxModule CxModule
 

A loadable module.

typedef enum _CxModuleType CxModuleType
 

Module types.

typedef struct _CxSchemeOps CxSchemeOps
 

URI scheme operations.


Enumeration Type Documentation

enum _CxModuleType
 

A module type.

These are the types of modules that libcomprex can dynamically load.

Enumeration values:
CX_MODULE_ARCHIVE  File handler module.
CX_MODULE_SCHEME  URI scheme module.


Function Documentation

void cxCleanup (  void    ) 
 

Cleans up the entire library.

This should only be called when you are absolutely done with this library.

This will call cxCleanupModules() automatically.

See also:
cxCleanupModules()

void cxCleanupModules (    ) 
 

Unloads all modules.

This should only be called when you are absolutely done with this library.

This will be automatically called by cxCleanup().

See also:
cxCleanup()

CxModule* cxGetFirstModule (  CxModuleType    type ) 
 

Returns the first module in the list.

This will probably only be useful inside libcomprex.

Parameters:
type The type of module.
Returns:
The first module in the list.
See also:
cxGetModule()

CxModule* cxGetModule (  const char *    name,
CxModuleType    type
) 
 

Returns the specified module.

The module

Parameters:
name The name of the module.
type The type of the module.
Returns:
A CxModule structure representing the module.
See also:
cxLoadModule()

void cxLinkModule (  CxModule **    ptr ) 
 

Notifies libcomprex that the module is being used.

This is used to increment the module's reference count.

Parameters:
ptr The module.
See also:
cxUnlinkModule()

CxModule* cxLoadModule (  const char *    name,
CxModuleType    type
) 
 

Loads the module of the specified name and type.

Parameters:
name The name of the module (without ".so")
type The type of module.
Returns:
A CxModule structure representing the module.
See also:
cxUnloadModule()

cxGetModule()

CxModule* cxRegisterModule (  const char *    name,
void *    ops,
CxModuleType    type
) 
 

Registers a module.

Parameters:
name The name of the module.
ops The operations structure.
type The type of module.
Returns:
The module structure, or NULL on failure.

void cxUnlinkModule (  CxModule **    ptr ) 
 

Notifies libcomprex that the module is no longer being used.

This is used to decrement the module's reference count.

See also:
ptr The module.

cxLinkModule()

void cxUnloadModule (  CxModule *    module ) 
 

Unloads the specified module.

Parameters:
module The module to unload.
See also:
cxLoadModule()


Generated on Wed Mar 5 20:47:44 2003 for libcomprex by doxygen1.2.18-20021020