dmlite.h File Reference
C wrapper for DMLite.
More...
#include <stdlib.h>
#include <sys/stat.h>
#include <utime.h>
#include "any.h"
#include "../common/errno.h"
Go to the source code of this file.
Detailed Description
C wrapper for DMLite.
- Author:
- Alejandro Álvarez Ayllon <aalvarez@cern.ch>
Typedef Documentation
Handle for a initialized context.
Handle for the plugin manager.
Function Documentation
unsigned dmlite_api_version |
( |
void |
|
) |
|
Destroys the context.
- Parameters:
-
| context | The context to free. |
- Returns:
- 0 on success, error code otherwise.
Returns a usable context from the loaded libraries.
- Parameters:
-
| manager | The plugin manager. |
- Returns:
- NULL on failure. The error code can be checked with dmlite_manager_error.
- Note:
- A context is NOT thread safe.
Returns the error code from the last failure.
- Parameters:
-
| context | The context that was used in the failed function. |
- Returns:
- The error code.
Error string from the last failed function.
- Parameters:
-
| context | The context that was used in the failed function. |
- Returns:
- A string with the error description. Do NOT free it.
Returns the last error code.
- Parameters:
-
| manager | The plugin manager used in the failing function. |
- Returns:
- The last error code.
Returns the string that describes the last error.
- Parameters:
-
| manager | The plugin manager used in the failing function. |
- Returns:
- A pointer to the error string. Do NOT free it.
Destroys the manager.
- Parameters:
-
| manager | The manager to be destroyed. |
int dmlite_manager_load_configuration |
( |
dmlite_manager * |
manager, |
|
|
const char * |
file | |
|
) |
| | |
Loads a configuration file.
- Parameters:
-
| manager | The plugin manager. |
| file | The configuration file |
- Returns:
- 0 on success, error code otherwise.
int dmlite_manager_load_plugin |
( |
dmlite_manager * |
manager, |
|
|
const char * |
lib, |
|
|
const char * |
id | |
|
) |
| | |
Loads a library.
- Parameters:
-
| manager | The plugin manager. |
| lib | The .so file. Usually, (path)/plugin_name.so. |
| id | The plugin ID. Usually, plugin_name. |
- Returns:
- 0 on success, error code otherwise.
Initializes a dmlite_manager.
- Returns:
- NULL on failure.
int dmlite_manager_set |
( |
dmlite_manager * |
manager, |
|
|
const char * |
key, |
|
|
const char * |
value | |
|
) |
| | |
Sets a configuration parameter.
- Parameters:
-
| manager | The plugin manager. |
| key | The parameter to set. |
| value | The value. |
- Returns:
- 0 on success, error code otherwise.
Sets a configuration parameter tied to a context.
This can be used to pass advanced parameters to a plugin.
- Parameters:
-
| context | The DM context. |
| k | The configuration key. |
| v | Value. |
- Returns:
- 0 on success, error code otherwise.
Sets the user security credentials.
- Parameters:
-
| context | The DM context. |
| cred | The security credentials. |
- Returns:
- 0 on success, error code otherwise.