/* Copyright 2009, UCAR/Unidata and OPeNDAP, Inc. See the COPYRIGHT file for more information. */ #include "config.h" #include "ocinternal.h" #include "ocdebug.h" #define LBRACKET '[' #define RBRACKET ']' /* Client parameters are assumed to be one or more instances of bracketed pairs: e.g "[...][...]...". The bracket content in turn is assumed to be a comma separated list of = pairs. e.g. x=y,z=,a=b. If the same parameter is specifed more than once, then the first occurrence is used; this is so that is possible to forcibly override user specified parameters by prefixing. IMPORTANT: client parameter string is assumed to have blanks compress out. */ int ocparamdecode(OCstate* state) { int i; i = ocuridecodeparams(state->uri); return i?OC_NOERR:OC_EBADURL; } const char* ocparamlookup(OCstate* state, const char* key) { const char* value = NULL; if(state == NULL || key == NULL || state->uri == NULL) return NULL; if(!ocurilookup(state->uri,key,&value)) value = NULL; return value; } int ocparamset(OCstate* state, const char* params) { int i; i = ocurisetparams(state->uri,params); return i?OC_NOERR:OC_EBADURL; } #ifdef OCIGNORE void ocparamfree(OClist* params) { int i; if(params == NULL) return; for(i=0;i found and deleted; 0 => param not found */ int ocparamdelete(OClist* params, const char* clientparam) { int i,found = 0; if(params == NULL || clientparam == NULL) return 0; for(i=0;i not already defined 0 => param already defined (no change) */ int ocparaminsert(OClist* params, const char* clientparam, const char* value) { int i; if(params == NULL || clientparam == NULL) return 0; for(i=0;i replacement performed 0 => insertion performed */ int ocparamreplace(OClist* params, const char* clientparam, const char* value) { int i; if(params == NULL || clientparam == NULL) return 0; for(i=0;i