📄 ws_defs.h
字号:
/************************************************************************
*
* CopyrIght (c) 1993 - 2000 Accelerated Technology, Inc.
*
* PROPRIETARY RIGHTS of Accelerated Technology are involved in the subject
* matter of this material. All manufacturing, reproduction, use and sales
* rights pertaining to this subject matter are governed by the license
* agreement. The recipient of this software implicity accepts the terms
* of the license.
*
*************************************************************************/
/************************************************************************
*
* FILE NAME VERSION
*
* ws_defs.h - WebServ Definitions 1.5
*
* COMPONENT
*
* Nucleus WebServ
*
* DESCRIPTION
*
*
*
* DATA STRUCTURES
*
*
*
* FUNCTIONS
*
* None
*
* DEPENDENCIES
*
* None
*
************************************************************************/
#ifndef _WS_DEFS_H
#define _WS_DEFS_H
#ifdef __cplusplus
extern "C" { /* C declarations in C++ */
#endif
/* GENERAL DEFINITIONS */
#define WS_CRYPT_LEN 8 /* encryption system works in units of this size */
#define WS_IP_SIZE 4 /* bytes in an IP address */
#define WS_NUM_SEED 2
#define WS_MAX_16_BIT 65534ul
/* Defines for Calculating Content Length with WS_Write_To_Net */
#define WS_FILETRNSFR 0 /* Transferring a File */
#define WS_REDIRECTION 1 /* Redirecting a File */
#define WS_PLUGIN_PROTO 2 /* PLUGIN Functiopn Prototype */
#define WS_PLUGIN_DATA 3 /* PLUGIN Store Data and Size */
#define WS_PLUGIN_SEND 4 /* PLUGIN Send Data */
#define SUCCESS 1
#define FAILURE 0
#define ENOFILE 2 /* file not found */
#define WS_FAILURE -1
#define WS_DATA_FILE 0 /* the file contains data to serve */
#define WS_CGI_FORM 1 /* the file is a form handler */
#define WS_CGI_CALL 2 /* the file is a CGI-generator */
#define WS_MAX_CGI_ARGS 32
#define WS_REQ_PROCEED 1 /* function preformed, continue */
#define WS_REQ_ABORTED 2 /* request should be aborted */
#define WS_REQ_NOACTION 3 /* plugin did not preform intended action */
#define WS_REQ_ERROR 4 /* plugin i/o error abort request */
/* Server control defines */
#define WS_SHUTDOWN 1 /* Shutdown the server (after the next command finishes ) */
#define WS_ONLINE 2 /* Make the server go online */
#define WS_PORT 4 /* set the port network port the server operates on */
#define WS_DEFAULT_MIME 0
#define WS_OUTBLEN 1024 /* Used in the dir plugin */
/* HTTP SPECIFIC DEFINITIONS */
#define WS_URL_LEN 100 /* length of a URL 100 */
#define WS_URI_LEN (WS_URL_LEN/2)
#define WS_NUM_LEN 16 /* maximum size of a number */
/* HASH tokens to identify type of HTTP transfer */
#define WS_GET 224
#define WS_HEAD 206
#define WS_POST 242
#define WS_HTTP_10_STRING "HTTP/1.0"
#define WS_HTTP_10 10
#define WS_HTTP_11_STRING "HTTP/1.1"
#define WS_HTTP_11 11
/* HTTP output headers */
#define WS_CONTENT_LENGTH "Content-length: "
#define WS_CONTENT_TYPE "Content-type: "
#define WS_CONTENT_LOCATION "Location: "
#define WS_TYPE_TXT_HTML "text/html"
#define WS_SSI_TOKEN "<!-#" /* ServerSideInclude magic string */
#define WS_SSI_LC_MARKER ".ssi" /* extension for a server side include HTML file */
#define WS_SSI_UC_MARKER ".SSI" /* extension for a server side include HTML file */
/* HTTP return values */
#define WS_PROTO_OK 200 /* OK (success)--- */
#define WS_PROTO_NO_RESPONSE 204 /* OK but no data to be returned to client */
#define WS_PROTO_REDIRECT 302 /* Redirect client to new URL in Location: header */
#define WS_PROTO_NOT_MODIFIED 304 /* URL not modified (in resp to client conditional GET */
#define WS_PROTO_BAD_REQUEST 400 /* Tells clinet she sent a bad request */
#define WS_PROTO_UNAUTHORIZED 401 /* The request requires user authentication */
#define WS_PROTO_FORBIDDEN 403 /* Server forbids this client request */
#define WS_PROTO_NOT_FOUND 404 /* the famous old "404" URL not found error */
#define WS_PROTO_SERVER_ERROR 500 /* Internal Server ERROR */
#define WS_PROTO_NOT_IMPLEMENTED 501 /* Server feature not implemented */
/* FILE SYSTEM DEFINITIONS */
#define WS_FS_PREFIX "\\"
#define WS_FS_LEN 100
#define WS_FBUF_SZ 512
#define WS_MAX_RECV_BYTES 10000
/* incore file system TYPE flags */
#define WS_COMPILED 1 /* file was compiled */
#define WS_DELETED 2 /* file is deleated */
#define WS_COMPRESSED 4 /* file compressed */
/* compression control */
#define WS_DO_OUTPUT 1
#define WS_NET_OUTPUT 2 /* de-compr output to net */
#define WS_DONT_OUTPUT 4
#define WS_CHD_FUD 16 /* fudge factor */
#define WS_CHD_SZ 4 /* size of preamble */
#define WS_CHD "pS$C" /* compression marker*/
/* upload file mode control */
#define WS_NOT_FOUND 0 /* no file found */
#define WS_INCORE 1 /* an incore file...no I/O needed */
#define WS_NORMAL 2 /* a regular file (can do normal I/O ) */
#define WS_FOUND 4 /* file was found */
#define WS_DIRECTORY 8 /* file was found */
#define WS_PLUGIN 5 /* file was a plugin */
/* AUTHENTICAION DEFINITIONS */
#define WS_AUTH_FREE 1 /* auth structure is free */
#define WS_AUTH_GIVEN 2 /* state value for an authenticated user */
#define WS_AUTH_ENABLED 0x80 /* authentication is enabled */
/* auth API */
#define WS_A_ENABLE 1 /* enable authentication */
#define WS_A_DISABLE 2 /* disable authentication */
#define WS_A_CREDS 3 /* change credentials */
#define WS_A_AUTH_URI 4 /* send user who needs authentication here */
#define WS_A_AUTH_ADD 5 /* register the passed ip address as authenticated */
#define WS_A_AUTH_GLOBL 6 /* make this directory available w/o authentication */
#define WS_A_TIMEOUT 7 /* set the authentication timeout value */
#define WS_A_LOGOUT 8 /* logout the selected ip address */
/***********************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -