Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/sasl
File: prop.h
/* prop.h -- property request/response management routines
[0] Fix | Delete
*
[1] Fix | Delete
* Author: Chris Newman
[2] Fix | Delete
* Removal of implementation-specific details by: Rob Siemborski
[3] Fix | Delete
*
[4] Fix | Delete
* This is intended to be used to create a list of properties to request,
[5] Fix | Delete
* and _then_ request values for all properties. Any change to the request
[6] Fix | Delete
* list will discard any existing values. This assumption allows a very
[7] Fix | Delete
* efficient and simple memory model. This was designed for SASL API auxiliary
[8] Fix | Delete
* property support, but would be fine for other contexts where this property
[9] Fix | Delete
* model is appropriate.
[10] Fix | Delete
*
[11] Fix | Delete
* The "struct propctx" is allocated by prop_new and is a fixed size structure.
[12] Fix | Delete
* If a prop_init() call were added, it would be reasonable to embed a "struct
[13] Fix | Delete
* propctx" in another structure. prop_new also allocates a pool of memory
[14] Fix | Delete
* (in the vbase field) which will be used for an array of "struct propval"
[15] Fix | Delete
* to list all the requested properties.
[16] Fix | Delete
*
[17] Fix | Delete
* Properties may be multi-valued.
[18] Fix | Delete
*/
[19] Fix | Delete
[20] Fix | Delete
#ifndef PROP_H
[21] Fix | Delete
#define PROP_H 1
[22] Fix | Delete
[23] Fix | Delete
/* The following ifdef block is the standard way of creating macros
[24] Fix | Delete
* which make exporting from a DLL simpler. All files within this DLL
[25] Fix | Delete
* are compiled with the LIBSASL_EXPORTS symbol defined on the command
[26] Fix | Delete
* line. this symbol should not be defined on any project that uses
[27] Fix | Delete
* this DLL. This way any other project whose source files include
[28] Fix | Delete
* this file see LIBSASL_API functions as being imported from a DLL,
[29] Fix | Delete
* wheras this DLL sees symbols defined with this macro as being
[30] Fix | Delete
* exported. */
[31] Fix | Delete
/* Under Unix, life is simpler: we just need to mark library functions
[32] Fix | Delete
* as extern. (Technically, we don't even have to do that.) */
[33] Fix | Delete
#ifdef WIN32
[34] Fix | Delete
# ifdef LIBSASL_EXPORTS
[35] Fix | Delete
# define LIBSASL_API extern __declspec(dllexport)
[36] Fix | Delete
# else /* LIBSASL_EXPORTS */
[37] Fix | Delete
# define LIBSASL_API extern __declspec(dllimport)
[38] Fix | Delete
# endif /* LIBSASL_EXPORTS */
[39] Fix | Delete
#else /* WIN32 */
[40] Fix | Delete
# define LIBSASL_API extern
[41] Fix | Delete
#endif /* WIN32 */
[42] Fix | Delete
[43] Fix | Delete
/* Same as above, but used during a variable declaration. */
[44] Fix | Delete
#ifdef WIN32
[45] Fix | Delete
# ifdef LIBSASL_EXPORTS
[46] Fix | Delete
# define LIBSASL_VAR extern __declspec(dllexport)
[47] Fix | Delete
# else /* LIBSASL_EXPORTS */
[48] Fix | Delete
# define LIBSASL_VAR extern __declspec(dllimport)
[49] Fix | Delete
# endif /* LIBSASL_EXPORTS */
[50] Fix | Delete
#else /* WIN32 */
[51] Fix | Delete
# define LIBSASL_VAR extern
[52] Fix | Delete
#endif /* WIN32 */
[53] Fix | Delete
[54] Fix | Delete
/* the resulting structure for property values
[55] Fix | Delete
*/
[56] Fix | Delete
struct propval {
[57] Fix | Delete
const char *name; /* name of property; NULL = end of list */
[58] Fix | Delete
/* same pointer used in request will be used here */
[59] Fix | Delete
const char **values; /* list of strings, values == NULL if property not
[60] Fix | Delete
* found, *values == NULL if property found with
[61] Fix | Delete
* no values */
[62] Fix | Delete
unsigned nvalues; /* total number of value strings */
[63] Fix | Delete
unsigned valsize; /* total size in characters of all value strings */
[64] Fix | Delete
};
[65] Fix | Delete
[66] Fix | Delete
/*
[67] Fix | Delete
* private internal structure
[68] Fix | Delete
*/
[69] Fix | Delete
#define PROP_DEFAULT 4 /* default number of propvals to assume */
[70] Fix | Delete
struct propctx;
[71] Fix | Delete
[72] Fix | Delete
#ifdef __cplusplus
[73] Fix | Delete
extern "C" {
[74] Fix | Delete
#endif
[75] Fix | Delete
[76] Fix | Delete
/* create a property context
[77] Fix | Delete
* estimate -- an estimate of the storage needed for requests & responses
[78] Fix | Delete
* 0 will use module default
[79] Fix | Delete
* returns a new property context on success and NULL on any error
[80] Fix | Delete
*/
[81] Fix | Delete
LIBSASL_API struct propctx *prop_new(unsigned estimate);
[82] Fix | Delete
[83] Fix | Delete
/* create new propctx which duplicates the contents of an existing propctx
[84] Fix | Delete
* returns SASL_OK on success
[85] Fix | Delete
* possible other return values include: SASL_NOMEM, SASL_BADPARAM
[86] Fix | Delete
*/
[87] Fix | Delete
LIBSASL_API int prop_dup(struct propctx *src_ctx, struct propctx **dst_ctx);
[88] Fix | Delete
[89] Fix | Delete
/* Add property names to request
[90] Fix | Delete
* ctx -- context from prop_new()
[91] Fix | Delete
* names -- list of property names; must persist until context freed
[92] Fix | Delete
* or requests cleared (This extends to other contexts that
[93] Fix | Delete
* are dup'ed from this one, and their children, etc)
[94] Fix | Delete
*
[95] Fix | Delete
* NOTE: may clear values from context as side-effect
[96] Fix | Delete
* returns SASL_OK on success
[97] Fix | Delete
* possible other return values include: SASL_NOMEM, SASL_BADPARAM
[98] Fix | Delete
*/
[99] Fix | Delete
LIBSASL_API int prop_request(struct propctx *ctx, const char **names);
[100] Fix | Delete
[101] Fix | Delete
/* return array of struct propval from the context
[102] Fix | Delete
* return value persists until next call to
[103] Fix | Delete
* prop_request, prop_clear or prop_dispose on context
[104] Fix | Delete
*
[105] Fix | Delete
* returns NULL on error
[106] Fix | Delete
*/
[107] Fix | Delete
LIBSASL_API const struct propval *prop_get(struct propctx *ctx);
[108] Fix | Delete
[109] Fix | Delete
/* Fill in an array of struct propval based on a list of property names
[110] Fix | Delete
* return value persists until next call to
[111] Fix | Delete
* prop_request, prop_clear or prop_dispose on context
[112] Fix | Delete
* returns number of matching properties which were found (values != NULL)
[113] Fix | Delete
* if a name requested here was never requested by a prop_request, then
[114] Fix | Delete
* the name field of the associated vals entry will be set to NULL
[115] Fix | Delete
*
[116] Fix | Delete
* The vals array MUST be atleast as long as the names array.
[117] Fix | Delete
*
[118] Fix | Delete
* returns # of matching properties on success
[119] Fix | Delete
* possible other return values include: SASL_BADPARAM
[120] Fix | Delete
*/
[121] Fix | Delete
LIBSASL_API int prop_getnames(struct propctx *ctx, const char **names,
[122] Fix | Delete
struct propval *vals);
[123] Fix | Delete
[124] Fix | Delete
/* clear values and optionally requests from property context
[125] Fix | Delete
* ctx -- property context
[126] Fix | Delete
* requests -- 0 = don't clear requests, 1 = clear requests
[127] Fix | Delete
*/
[128] Fix | Delete
LIBSASL_API void prop_clear(struct propctx *ctx, int requests);
[129] Fix | Delete
[130] Fix | Delete
/* erase the value of a property
[131] Fix | Delete
*/
[132] Fix | Delete
LIBSASL_API void prop_erase(struct propctx *ctx, const char *name);
[133] Fix | Delete
[134] Fix | Delete
/* dispose of property context
[135] Fix | Delete
* ctx -- is disposed and set to NULL; noop if ctx or *ctx is NULL
[136] Fix | Delete
*/
[137] Fix | Delete
LIBSASL_API void prop_dispose(struct propctx **ctx);
[138] Fix | Delete
[139] Fix | Delete
[140] Fix | Delete
/****fetcher interfaces****/
[141] Fix | Delete
[142] Fix | Delete
/* format the requested property names into a string
[143] Fix | Delete
* ctx -- context from prop_new()/prop_request()
[144] Fix | Delete
* sep -- separator between property names (unused if none requested)
[145] Fix | Delete
* seplen -- length of separator, if < 0 then strlen(sep) will be used
[146] Fix | Delete
* outbuf -- output buffer
[147] Fix | Delete
* outmax -- maximum length of output buffer including NUL terminator
[148] Fix | Delete
* outlen -- set to length of output string excluding NUL terminator
[149] Fix | Delete
* returns SASL_OK on success
[150] Fix | Delete
* returns SASL_BADPARAM or amount of additional space needed on failure
[151] Fix | Delete
*/
[152] Fix | Delete
LIBSASL_API int prop_format(struct propctx *ctx, const char *sep, int seplen,
[153] Fix | Delete
char *outbuf, unsigned outmax, unsigned *outlen);
[154] Fix | Delete
[155] Fix | Delete
/* add a property value to the context
[156] Fix | Delete
* ctx -- context from prop_new()/prop_request()
[157] Fix | Delete
* name -- name of property to which value will be added
[158] Fix | Delete
* if NULL, add to the same name as previous prop_set/setvals call
[159] Fix | Delete
* value -- a value for the property; will be copied into context
[160] Fix | Delete
* if NULL, remove existing values
[161] Fix | Delete
* vallen -- length of value, if <= 0 then strlen(value) will be used
[162] Fix | Delete
* returns SASL_OK on success
[163] Fix | Delete
* possible error return values include: SASL_BADPARAM, SASL_NOMEM
[164] Fix | Delete
*/
[165] Fix | Delete
LIBSASL_API int prop_set(struct propctx *ctx, const char *name,
[166] Fix | Delete
const char *value, int vallen);
[167] Fix | Delete
[168] Fix | Delete
/* set the values for a property
[169] Fix | Delete
* ctx -- context from prop_new()/prop_request()
[170] Fix | Delete
* name -- name of property to which value will be added
[171] Fix | Delete
* if NULL, add to the same name as previous prop_set/setvals call
[172] Fix | Delete
* values -- array of values, ending in NULL. Each value is a NUL terminated
[173] Fix | Delete
* string
[174] Fix | Delete
* returns SASL_OK on success
[175] Fix | Delete
* possible error return values include: SASL_BADPARAM, SASL_NOMEM
[176] Fix | Delete
*/
[177] Fix | Delete
LIBSASL_API int prop_setvals(struct propctx *ctx, const char *name,
[178] Fix | Delete
const char **values);
[179] Fix | Delete
[180] Fix | Delete
#ifdef __cplusplus
[181] Fix | Delete
}
[182] Fix | Delete
#endif
[183] Fix | Delete
[184] Fix | Delete
#endif /* PROP_H */
[185] Fix | Delete
[186] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function