Changeset View
Changeset View
Standalone View
Standalone View
lib/libcasper/libcasper/libcasper.h
Show First 20 Lines • Show All 117 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* The functions to communicate with service. | * The functions to communicate with service. | ||||
*/ | */ | ||||
#ifdef WITH_CASPER | #ifdef WITH_CASPER | ||||
cap_channel_t *cap_service_open(const cap_channel_t *chan, const char *name); | cap_channel_t *cap_service_open(const cap_channel_t *chan, const char *name); | ||||
int cap_service_limit(const cap_channel_t *chan, | int cap_service_limit(const cap_channel_t *chan, | ||||
const char * const *names, size_t nnames); | const char * const *names, size_t nnames); | ||||
#else | #else | ||||
#define cap_service_open(chan, name) (cap_init()) | static inline cap_channel_t * | ||||
#define cap_service_limit(chan, names, nnames) (0) | cap_service_open(const cap_channel_t *chan __unused, | ||||
const char *name __unused) | |||||
{ | |||||
return (cap_init()); | |||||
} | |||||
static inline int | |||||
cap_service_limit(const cap_channel_t *chan __unused, | |||||
const char * const *names __unused, size_t nnames __unused) | |||||
{ | |||||
return (0); | |||||
} | |||||
#endif | #endif | ||||
/* | /* | ||||
* The function creates cap_channel_t based on the given socket. | * The function creates cap_channel_t based on the given socket. | ||||
*/ | */ | ||||
#ifdef WITH_CASPER | #ifdef WITH_CASPER | ||||
cap_channel_t *cap_wrap(int sock, int flags); | cap_channel_t *cap_wrap(int sock, int flags); | ||||
#else | #else | ||||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* The function limits the given capability. | * The function limits the given capability. | ||||
* It always destroys 'limits' on return. | * It always destroys 'limits' on return. | ||||
*/ | */ | ||||
#ifdef WITH_CASPER | #ifdef WITH_CASPER | ||||
int cap_limit_set(const cap_channel_t *chan, nvlist_t *limits); | int cap_limit_set(const cap_channel_t *chan, nvlist_t *limits); | ||||
#else | #else | ||||
#define cap_limit_set(chan, limits) (0) | static inline int | ||||
cap_limit_set(const cap_channel_t *chan __unused, | |||||
nvlist_t *limits __unused) | |||||
{ | |||||
return (0); | |||||
} | |||||
#endif | #endif | ||||
/* | /* | ||||
* The function returns current limits of the given capability. | * The function returns current limits of the given capability. | ||||
*/ | */ | ||||
#ifdef WITH_CASPER | #ifdef WITH_CASPER | ||||
int cap_limit_get(const cap_channel_t *chan, nvlist_t **limitsp); | int cap_limit_get(const cap_channel_t *chan, nvlist_t **limitsp); | ||||
#else | #else | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |