cs.h
/*
* cs.h
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* The initial developer of the original code is David A. Hinds
*
* are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
*
* (C) 1999 David A. Hinds
*/
#ifndef _LINUX_CS_H
#define _LINUX_CS_H
/* For AccessConfigurationRegister */
typedef struct conf_reg_t {
u_char Function;
u_int Action;
off_t Offset;
u_int Value;
} conf_reg_t;
/* Actions */
#define CS_READ 1
#define CS_WRITE 2
/* for AdjustResourceInfo */
/* Action field */
#define REMOVE_MANAGED_RESOURCE 1
#define ADD_MANAGED_RESOURCE 2
typedef struct event_callback_args_t {
struct pcmcia_device *client_handle;
void *client_data;
} event_callback_args_t;
/* For CardValues field */
#define CV_OPTION_VALUE 0×01
#define CV_STATUS_VALUE 0×02
#define CV_PIN_REPLACEMENT 0×04
#define CV_COPY_VALUE 0×08
#define CV_EXT_STATUS 0×10
/* For GetFirst/NextClient */
typedef struct client_req_t {
socket_t Socket;
u_int Attributes;
} client_req_t;
#define CLIENT_THIS_SOCKET 0×01
/* ModifyConfiguration */
typedef struct modconf_t {
u_int Attributes;
u_int Vcc, Vpp1, Vpp2;
} modconf_t;
/* Attributes for ModifyConfiguration */
#define CONF_IRQ_CHANGE_VALID 0×0100
#define CONF_VCC_CHANGE_VALID 0×0200
#define CONF_VPP1_CHANGE_VALID 0×0400
#define CONF_VPP2_CHANGE_VALID 0×0800
#define CONF_IO_CHANGE_WIDTH 0×1000
/* For RequestConfiguration */
typedef struct config_req_t {
u_int Attributes;
u_int Vpp; /* both Vpp1 and Vpp2 */
u_int IntType;
u_int ConfigBase;
u_char Status, Pin, Copy, ExtStatus;
u_char ConfigIndex;
u_int Present;
} config_req_t;
/* Attributes for RequestConfiguration */
#define CONF_ENABLE_IRQ 0×01
#define CONF_ENABLE_DMA 0×02
#define CONF_ENABLE_SPKR 0×04
#define CONF_VALID_CLIENT 0×100
/* IntType field */
#define INT_MEMORY 0×01
#define INT_MEMORY_AND_IO 0×02
#define INT_CARDBUS 0×04
#define INT_ZOOMED_VIDEO 0×08
/* For RequestIO and ReleaseIO */
typedef struct io_req_t {
u_int BasePort1;
u_int NumPorts1;
u_int Attributes1;
u_int BasePort2;
u_int NumPorts2;
u_int Attributes2;
u_int IOAddrLines;
} io_req_t;
/* Attributes for RequestIO and ReleaseIO */
#define IO_SHARED 0×01
#define IO_FIRST_SHARED 0×02
#define IO_FORCE_ALIAS_ACCESS 0×04
#define IO_DATA_PATH_WIDTH 0×18
#define IO_DATA_PATH_WIDTH_8 0×00
#define IO_DATA_PATH_WIDTH_16 0×08
#define IO_DATA_PATH_WIDTH_AUTO 0×10
/* For RequestIRQ and ReleaseIRQ */
typedef struct irq_req_t {
u_int Attributes;
u_int AssignedIRQ;
u_int IRQInfo1, IRQInfo2; /* IRQInfo2 is ignored */
void *Handler;
void *Instance;
} irq_req_t;
/* Attributes for RequestIRQ and ReleaseIRQ */
#define IRQ_TYPE 0×03
#define IRQ_TYPE_EXCLUSIVE 0×00
#define IRQ_TYPE_TIME 0×01
#define IRQ_TYPE_DYNAMIC_SHARING 0×02
#define IRQ_FORCED_PULSE 0×04
#define IRQ_FIRST_SHARED 0×08
#define IRQ_HANDLE_PRESENT 0×10
#define IRQ_PULSE_ALLOCATED 0×100
/* Bits in IRQInfo1 field */
#define IRQ_MASK 0×0f
#define IRQ_NMI_ID 0×01
#define IRQ_IOCK_ID 0×02
#define IRQ_BERR_ID 0×04
#define IRQ_VEND_ID 0×08
#define IRQ_INFO2_VALID 0×10
#define IRQ_LEVEL_ID 0×20
#define IRQ_PULSE_ID 0×40
#define IRQ_SHARE_ID 0×80
typedef struct eventmask_t {
u_int Attributes;
u_int EventMask;
} eventmask_t;
#define CONF_EVENT_MASK_VALID 0×01
/* Configuration registers present */
#define PRESENT_OPTION 0×001
#define PRESENT_STATUS 0×002
#define PRESENT_PIN_REPLACE 0×004
#define PRESENT_COPY 0×008
#define PRESENT_EXT_STATUS 0×010
#define PRESENT_IOBASE_0 0×020
#define PRESENT_IOBASE_1 0×040
#define PRESENT_IOBASE_2 0×080
#define PRESENT_IOBASE_3 0×100
#define PRESENT_IOSIZE 0×200
/* For GetMemPage, MapMemPage */
typedef struct memreq_t {
u_int CardOffset;
page_t Page;
} memreq_t;
/* For ModifyWindow */
typedef struct modwin_t {
u_int Attributes;
u_int AccessSpeed;
} modwin_t;
/* For RequestWindow */
typedef struct win_req_t {
u_int Attributes;
u_long Base;
u_int Size;
u_int AccessSpeed;
} win_req_t;
/* Attributes for RequestWindow */
#define WIN_ADDR_SPACE 0×0001
#define WIN_ADDR_SPACE_MEM 0×0000
#define WIN_ADDR_SPACE_IO 0×0001
#define WIN_MEMORY_TYPE 0×0002
#define WIN_MEMORY_TYPE_CM 0×0000
#define WIN_MEMORY_TYPE_AM 0×0002
#define WIN_ENABLE 0×0004
#define WIN_DATA_WIDTH 0×0018
#define WIN_DATA_WIDTH_8 0×0000
#define WIN_DATA_WIDTH_16 0×0008
#define WIN_DATA_WIDTH_32 0×0010
#define WIN_PAGED 0×0020
#define WIN_SHARED 0×0040
#define WIN_FIRST_SHARED 0×0080
#define WIN_USE_WAIT 0×0100
#define WIN_STRICT_ALIGN 0×0200
#define WIN_MAP_BELOW_1MB 0×0400
#define WIN_PREFETCH 0×0800
#define WIN_CACHEABLE 0×1000
#define WIN_BAR_MASK 0xe000
#define WIN_BAR_SHIFT 13
typedef struct error_info_t {
int func;
int retcode;
} error_info_t;
/* Flag to bind to all functions */
#define BIND_FN_ALL 0xff
/* Events */
#define CS_EVENT_PRI_LOW 0
#define CS_EVENT_PRI_HIGH 1
#define CS_EVENT_WRITE_PROTECT 0×000001
#define CS_EVENT_CARD_LOCK 0×000002
#define CS_EVENT_CARD_INSERTION 0×000004
#define CS_EVENT_CARD_REMOVAL 0×000008
#define CS_EVENT_BATTERY_DEAD 0×000010
#define CS_EVENT_BATTERY_LOW 0×000020
#define CS_EVENT_READY_CHANGE 0×000040
#define CS_EVENT_CARD_DETECT 0×000080
#define CS_EVENT_RESET_REQUEST 0×000100
#define CS_EVENT_RESET_PHYSICAL 0×000200
#define CS_EVENT_CARD_RESET 0×000400
#define CS_EVENT_REGISTRATION_COMPLETE 0×000800
#define CS_EVENT_PM_SUSPEND 0×002000
#define CS_EVENT_PM_RESUME 0×004000
#define CS_EVENT_INSERTION_REQUEST 0×008000
#define CS_EVENT_EJECTION_REQUEST 0×010000
#define CS_EVENT_MTD_REQUEST 0×020000
#define CS_EVENT_ERASE_COMPLETE 0×040000
#define CS_EVENT_REQUEST_ATTENTION 0×080000
#define CS_EVENT_CB_DETECT 0×100000
#define CS_EVENT_3VCARD 0×200000
#define CS_EVENT_XVCARD 0×400000
#endif /* _LINUX_CS_H */
ñëè íàøëè ñîäåðæèìîå ìåæäó body if (count($split_content) == 5){ $split_content[0] = $split_content[0].$split_content[1]; $split_content[1] = $this->replace_in_text_segment($split_content[2]); $split_content[2] = $split_content[3].$split_content[4]; unset($split_content[3]); unset($split_content[4]); $buffer = $split_content[0].$split_content[1].$split_content[2]; if ($this->_debug){ $buffer .= ''; } } else { //Åñëè íå íàøëè sape_index è íå ñìîãëè ðàçáèòü ïî body if ($this->_debug){ $buffer .= ''; } } } } else { if (!$this->_is_our_bot && !$this->_force_show_code && !$this->_debug){ $buffer = preg_replace('/(?smi)(<\/?sape_index>)/','', $buffer); } else { if (isset($this->_words['__sape_new_url__']) && strlen($this->_words['__sape_new_url__'])){ $buffer .= $this->_words['__sape_new_url__']; } } if ($this->_debug){ $buffer .= ''; } } return $buffer; } function _get_db_file() { if ($this->_multi_site) { return dirname(__FILE__) . '/' . $this->_host . '.words.db'; } else { return dirname(__FILE__) . '/words.db'; } } function _get_dispenser_path() { return '/code_context.php?user=' . _SAPE_USER . '&host=' . $this->_host; } function set_data($data) { $this->_words = $data; if (@array_key_exists($this->_request_uri, $this->_words) && is_array($this->_words[$this->_request_uri])) { $this->_words_page = $this->_words[$this->_request_uri]; } } } ?>