utils.h - Man Page

C wrapper for DMLite utils.

Synopsis

#include 'any.h'
#include 'dmlite/common/config.h'
#include <limits.h>
#include <stdint.h>

Data Structures

struct dmlite_url
Handles URL.
struct dmlite_aclentry
Handles ACL entries.

Macros

#define ACL_ENTRIES_MAX   300
#define ACL_SIZE   13
#define CSUMTYPE_MAX   3
#define CSUMVALUE_MAX   33
#define GUID_MAX   36
#define HOST_NAME_MAX   _POSIX_HOST_NAME_MAX
#define QUERY_MAX   1024
#define SCHEME_MAX   7
#define URL_MAX   8192
#define ACL_USER_OBJ   1
#define ACL_USER   2
#define ACL_GROUP_OBJ   3
#define ACL_GROUP   4
#define ACL_MASK   5
#define ACL_OTHER   6
#define ACL_DEFAULT   0x20

Typedefs

typedef struct dmlite_url dmlite_url
Handles URL.
typedef struct dmlite_aclentry dmlite_aclentry
Handles ACL entries.

Functions

dmlite_url * dmlite_url_new (void)
Creates a new dmlite_url.
dmlite_url * dmlite_parse_url (const char *source)
Parses a URL.
void dmlite_url_free (dmlite_url *url)
Frees the given url.
char * dmlite_url_serialize (dmlite_url *url, char *buffer, size_t bsize)
Serializes a URL.
void dmlite_serialize_acls (unsigned nEntries, dmlite_aclentry *acl, char *buffer, size_t bsize)
Serializes into a string a set of ACL entries.
void dmlite_deserialize_acl (const char *buffer, unsigned *nEntries, dmlite_aclentry **acl)
Deserializes a string into an array of ACL entries.
void dmlite_acl_free (unsigned nEntries, dmlite_aclentry *acl)
Frees an array of ACL entries as returned by dm_deserialize_acls.

Detailed Description

C wrapper for DMLite utils.

Author

Alejandro Álvarez Ayllon aalvarez@cern.ch

Macro Definition Documentation

#define ACL_DEFAULT   0x20

#define ACL_ENTRIES_MAX   300

#define ACL_GROUP   4

#define ACL_GROUP_OBJ   3

#define ACL_MASK   5

#define ACL_OTHER   6

#define ACL_SIZE   13

#define ACL_USER   2

#define ACL_USER_OBJ   1

#define CSUMTYPE_MAX   3

#define CSUMVALUE_MAX   33

#define GUID_MAX   36

#define HOST_NAME_MAX   _POSIX_HOST_NAME_MAX

#define QUERY_MAX   1024

#define SCHEME_MAX   7

#define URL_MAX   8192

Typedef Documentation

typedef struct dmlite_aclentry dmlite_aclentry

Handles ACL entries.

typedef struct dmlite_url dmlite_url

Handles URL.

Function Documentation

void dmlite_acl_free (unsigned nEntries, dmlite_aclentry * acl)

Frees an array of ACL entries as returned by dm_deserialize_acls.

Parameters

nEntries The number of entries in the array.
acl The ACL.

void dmlite_deserialize_acl (const char * buffer, unsigned * nEntries, dmlite_aclentry ** acl)

Deserializes a string into an array of ACL entries.

Parameters

buffer The string.
nEntries The resulting number of ACL entries.
acl The resulting ACL.

dmlite_url* dmlite_parse_url (const char * source)

Parses a URL.

Parameters

source Original URL.

Returns

Parsed URL.

Note

dest->query must be NULL for the first call, so it is internally allocated.

void dmlite_serialize_acls (unsigned nEntries, dmlite_aclentry * acl, char * buffer, size_t bsize)

Serializes into a string a set of ACL entries.

Parameters

nEntries The number of ACL entries in the array.
acl The ACL.
buffer Where to put the resulting string.
bsize The buffer size.

void dmlite_url_free (dmlite_url * url)

Frees the given url.

Parameters

url The url to free.

dmlite_url* dmlite_url_new (void)

Creates a new dmlite_url.

char* dmlite_url_serialize (dmlite_url * url, char * buffer, size_t bsize)

Serializes a URL.

Parameters

url The url to serialize.
buffer Where to put the serialized version.
bsize The buffer size.

Returns

Buffer, NULL on error.

Author

Generated automatically by Doxygen for dmlite from the source code.

Info

Sun Mar 28 2021 Version 0.6 dmlite