资源简介
wifidog官网最新的,开源包,名称wifidog-20090925.trz.gz
代码片段和文件信息
/*
** Copyright (c) 2002 Hughes Technologies Pty Ltd. All rights
** reserved.
**
** Terms under which this software may be used or copied are
** provided in the specific license associated with this product.
**
** Hughes Technologies disclaims all warranties with regard to this
** software including all implied warranties of merchantability and
** fitness in no event shall Hughes Technologies be liable for any
** special indirect or consequential damages or any damages whatsoever
** resulting from loss of use data or profits whether in an action of
** contract negligence or other tortious action arising out of or in
** connection with the use or performance of this software.
**
**
** $Id: api.c 1371 2008-09-30 09:17:21Z wichert $
**
*/
#include
#include
#include
#include
#include
#include
#include
#if defined(_WIN32)
#include
#else
#include
#include
#include
#include
#include
#include
#include
#endif
#include “config.h“
#include “httpd.h“
#include “httpd_priv.h“
#ifdef HAVE_STDARG_H
# include
#else
# include
#endif
char *httpdUrlEncode(str)
const char *str;
{
char *new
*cp;
new = (char *)_httpd_escape(str);
if (new == NULL)
{
return(NULL);
}
cp = new;
while(*cp)
{
if (*cp == ‘ ‘)
*cp = ‘+‘;
cp++;
}
return(new);
}
char *httpdRequestMethodName(request *r)
{
static char tmpBuf[255];
switch(r->request.method)
{
case HTTP_GET: return(“GET“);
case HTTP_POST: return(“POST“);
default:
snprintf(tmpBuf255“Invalid method ‘%d‘“
r->request.method);
return(tmpBuf);
}
}
httpVar *httpdGetVariableByName(request *r const char *name)
{
httpVar *curVar;
curVar = r->variables;
while(curVar)
{
if (strcmp(curVar->name name) == 0)
return(curVar);
curVar = curVar->nextVariable;
}
return(NULL);
}
httpVar *httpdGetVariableByPrefix(request *r const char *prefix)
{
httpVar *curVar;
if (prefix == NULL)
return(r->variables);
curVar = r->variables;
while(curVar)
{
if (strncmp(curVar->name prefix strlen(prefix)) == 0)
return(curVar);
curVar = curVar->nextVariable;
}
return(NULL);
}
httpVar *httpdGetVariableByPrefixedName(request *r const char *prefix const char *name)
{
httpVar *curVar;
int prefixLen;
if (prefix == NULL)
return(r->variables);
curVar = r->variables;
prefixLen = strlen(prefix);
while(curVar)
{
if (strncmp(curVar->name prefix prefixLen) == 0 &&
strcmp(curVar->name + prefixLen name) == 0)
{
return(curVar);
}
curVar = curVar->nextVariable;
}
return(NULL);
}
httpVar *httpdGetNextVariableByPrefix(curVar prefix)
httpVar *curVar;
const char *prefix;
{
if(curVar)
curVar = curVar->nextVariable;
while(curVar)
{
- 上一篇:多频连续波二次相差法测距
- 下一篇:VoiceRecorder.rar
评论
共有 条评论