X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fparamhandling.h;h=1b2f62d02e65730acad3a972aa568c5d1f4e24e7;hb=HEAD;hp=cd1c16038d24e43a06f513536acfd045b245bf8f;hpb=e61225acc89966c5f4c2243118becb5a3f8de766;p=citadel.git diff --git a/webcit/paramhandling.h b/webcit/paramhandling.h index cd1c16038..1b2f62d02 100644 --- a/webcit/paramhandling.h +++ b/webcit/paramhandling.h @@ -1,3 +1,15 @@ +/* + * Copyright (c) 1996-2013 by the citadel.org team + * + * This program is open source software. You can redistribute it and/or + * modify it under the terms of the GNU General Public License, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + /* URL / Mime Post parsing -> paramhandling.c */ void upload_handler(char *name, char *filename, char *partnum, char *disp, void *content, char *cbtype, char *cbcharset, @@ -8,7 +20,6 @@ void ParseURLParams(StrBuf *url); /* These may return NULL if not foud */ #define sbstr(a) SBstr(a, sizeof(a) - 1) -const StrBuf *SBSTR(const char *key); const StrBuf *SBstr(const char *key, size_t keylen); #define xbstr(a, b) (char*) XBstr(a, sizeof(a) - 1, b) @@ -17,7 +28,6 @@ const char *XBSTR(const char *key, size_t *len); #define lbstr(a) LBstr(a, sizeof(a) - 1) long LBstr(const char *key, size_t keylen); -long LBSTR(const char *key); #define ibstr(a) IBstr(a, sizeof(a) - 1) #define ibcstr(a) IBstr(a.Key, a.len) @@ -26,12 +36,36 @@ int IBSTR(const char *key); #define havebstr(a) HaveBstr(a, sizeof(a) - 1) int HaveBstr(const char *key, size_t keylen); -int HAVEBSTR(const char *key); #define yesbstr(a) YesBstr(a, sizeof(a) - 1) int YesBstr(const char *key, size_t keylen); int YESBSTR(const char *key); +HashList* getSubStruct(const char *key, size_t keylen); + +/* These may return NULL if not foud */ +#define ssubbstr(s, a) SSubBstr(s, a, sizeof(a) - 1) +const StrBuf *SSubBstr(HashList *sub, const char *key, size_t keylen); + +#define xsubbstr(s, a, b) (char*) XSubBstr(s, a, sizeof(a) - 1, b) +const char *XSubBstr(HashList *sub, const char *key, size_t keylen, size_t *len); + +#define lsubbstr(s, a) LSubBstr(s, a, sizeof(a) - 1) +long LSubBstr(HashList *sub, const char *key, size_t keylen); + +#define isubbstr(s, a) ISubBstr(s, a, sizeof(a) - 1) +#define isubbcstr(s, a) ISubBstr(s, a.Key, a.len) +int ISubBstr(HashList *sub, const char *key, size_t keylen); + +#define havesubbstr(s, a) HaveSubBstr(s, a, sizeof(a) - 1) +int HaveSubBstr(HashList *sub, const char *key, size_t keylen); + +#define yessubbstr(s, a) YesSubBstr(s, a, sizeof(a) - 1) +int YesSubBstr(HashList *sub, const char *key, size_t keylen); + + + + /* TODO: get rid of the non-const-typecast */ #define bstr(a) (char*) Bstr(a, sizeof(a) - 1) const char *BSTR(const char *key); @@ -40,3 +74,6 @@ const char *Bstr(const char *key, size_t keylen); #define putbstr(a, b) PutBstr(a, sizeof(a) - 1, b) void PutBstr(const char *key, long keylen, StrBuf *Value); +#define putlbstr(a, b) PutlBstr(a, sizeof(a) - 1, b) +void PutlBstr(const char *key, long keylen, long Value); +