⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uemf.h

📁 嵌入式Linux系统用的web server,开源代码,非常好用
💻 H
📖 第 1 页 / 共 3 页
字号:
/*
 * uemf.h -- GoAhead Micro Embedded Management Framework Header
 *
 * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
 *
 * See the file "license.txt" for usage and redistribution license requirements
 *
 * $Id: uemf.h,v 1.8 2003/11/25 21:48:13 hwolff Exp $
 */

#ifndef _h_UEMF
#define _h_UEMF 1

/******************************** Description *********************************/

/* 
 *	GoAhead Web Server header. This defines the Web public APIs
 */

/******************************* Per O/S Includes *****************************/

#ifdef WIN
	#include	<direct.h>
	#include	<io.h>
	#include	<sys/stat.h>
	#include	<limits.h>
	#include	<tchar.h>
	#include	<windows.h>
	#include	<winnls.h>
	#include	<time.h>
	#include	<sys/types.h>
	#include	<stdio.h>
	#include	<stdlib.h>
	#include	<fcntl.h>
	#include	<errno.h>
#endif /* WIN */

#ifdef CE
	/*#include	<errno.h>*/
	#include	<limits.h>
	#include	<tchar.h>
	#include	<windows.h>
	#include	<winsock.h>
	#include	<winnls.h>
	#include	"CE/wincompat.h"
	#include	<winsock.h>
#endif /* CE */

#ifdef NW
	#include	<direct.h>
	#include	<io.h>
	#include	<sys/stat.h>
	#include	<time.h>
	#include	<sys/types.h>
	#include	<stdio.h>
	#include	<stdlib.h>
	#include	<fcntl.h>
	#include	<errno.h>
	#include	<niterror.h>
	#define		EINTR EINUSE
	#define		 WEBS	1
	#include	<limits.h>
	#include	<netdb.h>
	#include	<process.h>
	#include	<tiuser.h>
	#include	<sys/time.h>
	#include	<arpa/inet.h>
	#include	<sys/types.h>
	#include	<sys/socket.h>
	#include	<sys/filio.h>
	#include	<netinet/in.h>
#endif /* NW */

#ifdef SCOV5 
	#include	<sys/types.h>
	#include	<stdio.h>
	#include	"sys/socket.h"
	#include	"sys/select.h"
	#include	"netinet/in.h"
	#include 	"arpa/inet.h"
	#include 	"netdb.h"
#endif /* SCOV5 */

#ifdef UNIX
	#include	<stdio.h>
#endif /* UNIX */

#ifdef LINUX
	#include	<sys/types.h>
	#include	<sys/stat.h>
	#include	<sys/param.h>
	#include	<limits.h>
	#include	<stdio.h>
	#include	<stdlib.h>
	#include	<unistd.h>
	#include	<sys/socket.h>
	#include	<sys/select.h>
	#include	<netinet/in.h>
	#include 	<arpa/inet.h>
	#include 	<netdb.h>
	#include	<time.h>
	#include	<fcntl.h>
	#include	<errno.h>
#endif /* LINUX */

#ifdef LYNX
	#include	<limits.h>
	#include	<stdarg.h>
	#include	<stdio.h>
	#include	<stdlib.h>
	#include	<unistd.h>
	#include	<socket.h>
	#include	<netinet/in.h>
	#include 	<arpa/inet.h>
	#include 	<netdb.h>
	#include	<time.h>
	#include	<fcntl.h>
	#include	<errno.h>
#endif /* LYNX */

#ifdef MACOSX
	#include	<sys/stat.h>
	#include	<stdio.h>
	#include	<stdlib.h>
	#include	<unistd.h>
	#include	<sys/socket.h>
	#include	<netinet/in.h>
	#include 	<arpa/inet.h>
	#include 	<netdb.h>
	#include	<fcntl.h>
	#include	<errno.h>
#endif /* MACOSX */

#ifdef UW
	#include	<stdio.h>
#endif /* UW */

#ifdef VXWORKS
	#include	<vxWorks.h>
	#include	<sockLib.h>
	#include	<selectLib.h>
	#include	<inetLib.h>
	#include	<ioLib.h>
	#include	<stdio.h>
	#include	<stat.h>
	#include	<time.h>
	#include	<usrLib.h>
	#include	<fcntl.h>
	#include	<errno.h>
#endif /* VXWORKS */

#ifdef sparc
# define __NO_PACK
#endif /* sparc */

#ifdef SOLARIS
	#include	<sys/types.h>
	#include	<limits.h>
	#include	<stdio.h>
	#include	<stdlib.h>
	#include	<unistd.h>
	#include	<socket.h>
	#include	<sys/select.h>
	#include	<netinet/in.h>
	#include 	<arpa/inet.h>
	#include 	<netdb.h>
	#include	<time.h>
	#include	<fcntl.h>
	#include	<errno.h>
#endif /* SOLARIS */

#ifdef QNX4
	#include	<sys/types.h>
	#include	<stdio.h>
	#include	<sys/socket.h>
	#include	<sys/select.h>
	#include	<netinet/in.h>
	#include 	<arpa/inet.h>
	#include 	<netdb.h>
    #include    <stdlib.h>
    #include    <unistd.h>
    #include    <sys/uio.h>
    #include    <sys/wait.h>
#endif /* QNX4 */

#ifdef ECOS
	#include	<limits.h>
	#include	<cyg/infra/cyg_type.h>
	#include	<cyg/kernel/kapi.h>
	#include	<time.h>
	#include	<network.h>
	#include	<errno.h>
#endif /* ECOS */

/********************************** Includes **********************************/

#include	<ctype.h>
#include	<stdarg.h>
#include	<string.h>

#ifndef WEBS
#include	"messages.h"
#endif /* ! WEBS */

/******************************* Per O/S Defines *****************************/

#ifdef UW
	#define		__NO_PACK		1
#endif /* UW */

#if (defined (SCOV5) || defined (VXWORKS) || defined (LINUX) || defined (LYNX) || defined (MACOSX))
#ifndef O_BINARY
#define O_BINARY 		0
#endif /* O_BINARY */
#define	SOCKET_ERROR	-1
#endif /* SCOV5 || VXWORKS || LINUX || LYNX || MACOSX */

#if (defined (WIN) || defined (CE))
/*
 *	__NO_FCNTL means can't access fcntl function.  Fcntl.h is still available.
 */
#define		__NO_FCNTL		1

#undef R_OK
#define R_OK	4
#undef W_OK
#define W_OK	2
#undef X_OK
#define X_OK	1
#undef F_OK
#define F_OK	0
#endif /* WIN || CE */

#if (defined (LINUX) && !defined (_STRUCT_TIMEVAL))
struct timeval
{
	time_t	tv_sec;		/* Seconds.  */
	time_t	tv_usec;	/* Microseconds.  */
};
#define _STRUCT_TIMEVAL 1
#endif /* LINUX && ! _STRUCT_TIMEVAL */

#ifdef ECOS
	#define		O_RDONLY		1
	#define		O_BINARY		2

	#define		__NO_PACK		1
	#define		__NO_EJ_FILE	1
	#define		__NO_CGI_BIN	1
	#define		__NO_FCNTL		1

/*
 *	#define LIBKERN_INLINE to avoid kernel inline functions
 */
	#define		LIBKERN_INLINE

#endif /* ECOS */

#ifdef QNX4
    typedef long        fd_mask;
    #define NFDBITS (sizeof (fd_mask) * NBBY)   /* bits per mask */
#endif /* QNX4 */

#ifdef NW
	#define fd_mask			fd_set
	#define INADDR_NONE		-1l
	#define Sleep			delay

	#define __NO_FCNTL		1

	#undef R_OK
	#define R_OK    4
	#undef W_OK
	#define W_OK    2
	#undef X_OK
	#define X_OK    1
	#undef F_OK
	#define F_OK    0
#endif /* NW */

/********************************** Unicode ***********************************/
/* 
 *	Constants and limits. Also FNAMESIZE and PATHSIZE are currently defined 
 *	in param.h to be 128 and 512
 */
#define TRACE_MAX			(4096 - 48)
#define VALUE_MAX_STRING	(4096 - 48)
#define SYM_MAX				(512)
#define XML_MAX				4096			/* Maximum size for tags/tokens */
#define BUF_MAX				4096			/* General sanity check for bufs */
#define FMT_STATIC_MAX		256				/* Maximum for fmtStatic calls */

#if (defined (LITTLEFOOT) || defined (WEBS))
#define LF_BUF_MAX		(510)
#define LF_PATHSIZE		LF_BUF_MAX
#else
#define	LF_BUF_MAX		BUF_MAX
#define LF_PATHSIZE		PATHSIZE
#define UPPATHSIZE		PATHSIZE
#endif /* LITTLEFOOT || WEBS */

#ifndef CHAR_T_DEFINED
#define CHAR_T_DEFINED 1
#ifdef UNICODE
/*
 *	To convert strings to UNICODE. We have a level of indirection so things
 *	like T(__FILE__) will expand properly.
 */
#define	T(x)				__TXT(x)
#define	__TXT(s)			L ## s
typedef unsigned short 		char_t;
typedef unsigned short		uchar_t;

/*
 *	Text size of buffer macro. A buffer bytes will hold (size / char size) 
 *	characters. 
 */
#define	TSZ(x)				(sizeof(x) / sizeof(char_t))

/*
 *	How many ASCII bytes are required to represent this UNICODE string?
 */
#define	TASTRL(x)			((wcslen(x) + 1) * sizeof(char_t))

#else
#define	T(s) 				s
typedef char				char_t;
#define	TSZ(x)				(sizeof(x))
#define	TASTRL(x)			(strlen(x) + 1)
#ifdef WIN
typedef unsigned char		uchar_t;
#endif /* WIN */

#endif /* UNICODE */

#endif /* ! CHAR_T_DEFINED */

/*
 *	"Boolean" constants
 */

#ifndef TRUE
#define TRUE 1
#endif

#ifndef FALSE
#define FALSE 0
#endif

/*
 *	GoAhead Copyright.
 */
#define GOAHEAD_COPYRIGHT \
	T("Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.")

/*
 *	The following include has to be after the unicode defines.  By putting it
 *	here, many modules in various parts of the tree are cleaner.
 */
#if (defined (LITTLEFOOT) && defined (INMEM))
	#include	"lf/inmem.h"
#endif /* LITTLEFOOT && INMEM */

/*
 *	Type for unicode systems

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -