Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

module.h File Reference

Module API. More...

#include <libpackman/package.h>
#include <libpackman/db.h>
#include <libpackman/script.h>

Go to the source code of this file.

Data Structures

struct  _PmDatabaseOps
 Database operations structure. More...

struct  _PmModule
 A package or database module. More...

struct  _PmPackageOps
 Package operations structure. More...


Defines

#define PM_INIT_DB_MODULE(modname, initfunc, dbops)
 Handles the initialization of modules.

#define PM_INIT_PKG_MODULE(modname, initfunc, pkgops)

Typedefs

typedef enum _PmModuleType PmModuleType
 Module types.

typedef _PmDatabaseOps PmDatabaseOps
 Database operations.

typedef _PmPackageOps PmPackageOps
 Package operations.

typedef _PmModule PmModule
 A loadable module.


Enumerations

enum  _PmModuleType { PM_MODULE_PACKAGE, PM_MODULE_DATABASE }
 A module type. More...


Functions

PmModulepmRegisterModule (const char *name, void *ops, PmModuleType type)
 Registers a module.

PmModulepmLoadModule (const char *name, PmModuleType type)
 Loads the module of the specified name and type.

void pmUnloadModule (PmModule *module)
 Unloads the specified module.

PmModulepmGetModule (const char *name, PmModuleType type)
 Returns the specified module.

void pmLinkModule (PmModule **ptr)
 Notifies libpackman that the module is being used.

void pmUnlinkModule (PmModule **ptr)
 Notifies libpackman that the module is no longer being used.

PmModulepmGetFirstModule (PmModuleType type)
 Returns the first module in the list.

void pmCleanupModules (void)
 Unloads all modules.

void pmCleanup (void)
 Cleans up the entire library.


Detailed Description

Module API.

Id:
module.h,v 1.38 2002/06/05 17:02:29 chipx86 Exp
Copyright:
(C) 1999-2002 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 PM_INIT_DB_MODULE modname,
initfunc,
dbops   
 

Value:

PmModule *initPackmanModule(void) { \
        initfunc(PM_MODULE_DATABASE); \
        return pmRegisterModule(#modname, &(dbops), PM_MODULE_DATABASE); \
    }
Handles the initialization of modules.

#define PM_INIT_PKG_MODULE modname,
initfunc,
pkgops   
 

Value:

PmModule *initPackmanModule(void) { \
        initfunc(PM_MODULE_PACKAGE); \
        return pmRegisterModule(#modname, &(pkgops), PM_MODULE_PACKAGE); \
    }


Typedef Documentation

typedef struct _PmDatabaseOps PmDatabaseOps
 

Database operations.

typedef struct _PmModule PmModule
 

A loadable module.

typedef enum _PmModuleType PmModuleType
 

Module types.

typedef struct _PmPackageOps PmPackageOps
 

Package operations.


Enumeration Type Documentation

enum _PmModuleType
 

A module type.

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

Enumeration values:
PM_MODULE_PACKAGE  Package handler module.
PM_MODULE_DATABASE  Database access module.


Function Documentation

void pmCleanup void   
 

Cleans up the entire library.

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

This will call pmCleanupModules() automatically.

See also:
pmCleanupModules()

void pmCleanupModules void   
 

Unloads all modules.

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

This will be automatically called by pmCleanup().

See also:
pmCleanup()

PmModule* pmGetFirstModule PmModuleType    type
 

Returns the first module in the list.

This will probably only be useful inside libpackman.

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

PmModule* pmGetModule const char *    name,
PmModuleType    type
 

Returns the specified module.

The module will be automatically loaded if it's not already loaded.

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

void pmLinkModule PmModule **    ptr
 

Notifies libpackman that the module is being used.

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

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

PmModule* pmLoadModule const char *    name,
PmModuleType    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 PmModule structure representing the module.
See also:
pmUnloadModule() , pmGetModule()

PmModule* pmRegisterModule const char *    name,
void *    ops,
PmModuleType    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 pmUnlinkModule PmModule **    ptr
 

Notifies libpackman that the module is no longer being used.

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

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

void pmUnloadModule PmModule   module
 

Unloads the specified module.

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


Generated on Tue Jul 2 03:15:24 2002 for libpackman by doxygen1.2.15-20020430