133 size_t *data_len_return)
137 unsigned char data[64];
138 unsigned char *p, *mb;
160 if (WS_INT8_MIN <= bc->constants[ui].
u.v_int
168 }
else if (WS_INT16_MIN <= bc->constants[ui].
u.v_int
208 ws_fatal(
"ws_bc_encode(): internal inconsistency");
420 *data_len_return = 0;
443 #define WS_UPDATE_DATA \ 449 #define WS_CHECK_STRING(idx) \ 450 if ((idx) >= bc->num_constants \ 451 || ((bc->constants[(idx)].type \ 452 != WS_BC_CONST_TYPE_UTF8_STRING) \ 453 && (bc->constants[(idx)].type \ 454 != WS_BC_CONST_TYPE_EMPTY_STRING))) \ 464 WsUInt8 ui8, num_functions, k, l;
480 || ui32 != data_len - decoded)
621 ws_fatal(
"external character encoding not implemented yet");
771 for (l = 0; l < ui8; l++) {
772 unsigned int ch = (
unsigned char) n->
name[l];
774 if ((
'a' <= ch && ch <=
'z')
775 || (
'A' <= ch && ch <=
'Z')
777 || (l > 0 && (
'0' <= ch && ch <=
'9')))
786 if (n->
index >= num_functions)
913 const unsigned char *data,
size_t len)
1012 const unsigned char *
name,
1014 const unsigned char *property,
1015 size_t property_len)
1032 const unsigned char *
name,
1034 const unsigned char *property,
1035 size_t property_len,
1036 const unsigned char *scheme,
unsigned char ws_ieee754_nan[4]
void error(int err, const char *fmt,...)
void ws_fatal(char *fmt,...)
void * ws_calloc(size_t num, size_t size)
#define WS_PUT_UINT8(buf, val)
#define WS_BC_CONST_EMPTY_STRING
WsUInt32 ws_decode_mb_uint32(const unsigned char *buffer, size_t *len)
WsIeee754Result ws_ieee754_decode_single(unsigned char *buf, double *value_return)
#define WS_BC_CONST_UTF8_STRING
WsBcStringEncoding string_encoding
WsBool ws_bc_add_pragma_access_domain(WsBc *bc, const unsigned char *domain, size_t domain_len)
#define WS_BC_PRAGMA_ACCESS_DOMAIN
WsBc * ws_bc_alloc(WsBcStringEncoding string_encoding)
#define WS_BC_CONST_INT32
#define WS_BC_CONST_FLOAT32
size_t ws_buffer_len(WsBuffer *buffer)
#define WS_MB_UINT32_MAX_ENCODED_LEN
WsBool ws_bc_add_pragma_access_path(WsBc *bc, const unsigned char *path, size_t path_len)
void * ws_realloc(void *ptr, size_t size)
WsIeee754Result ws_ieee754_encode_single(double value, unsigned char *buf)
size_t ws_decode_buffer(const unsigned char *buffer, size_t buffer_len,...)
void ws_utf8_free(WsUtf8String *string)
#define WS_BC_CONST_EXT_ENC_STRING
WsBcFunctionName * function_names
#define WS_BC_PRAGMA_USER_AGENT_PROPERTY_AND_SCHEME
unsigned char ws_ieee754_positive_inf[4]
#define WS_BC_CONST_INT16
WsBool ws_bc_encode(WsBc *bc, unsigned char **data_return, size_t *data_len_return)
unsigned char * ws_encode_mb_uint32(WsUInt32 value, unsigned char *buffer, size_t *len_return)
#define WS_BC_PRAGMA_ACCESS_PATH
static WsBcPragma * add_pragma(WsBc *bc, WsBcPragmaType type)
union WsAsmInsRec::@113 u
WsUInt8 num_function_names
WsUtf8String * ws_utf8_alloc()
int ws_utf8_set_data(WsUtf8String *string, const unsigned char *data, size_t len)
void ws_bc_free(WsBc *bc)
void ws_utf8_free_data(unsigned char *data)
WsBool ws_bc_add_const_empty_string(WsBc *bc, WsUInt16 *index_return)
void ws_buffer_init(WsBuffer *buffer)
void * ws_memdup(const void *ptr, size_t size)
#define WS_CHECK_STRING(idx)
WsBool ws_bc_add_const_float(WsBc *bc, WsUInt16 *index_return, WsFloat value)
void ws_bc_data_free(unsigned char *data)
void ws_buffer_uninit(WsBuffer *buffer)
WsBool ws_encode_buffer(WsBuffer *buffer,...)
#define WS_BC_MAX_HEADER_LEN
WsBool ws_bc_add_const_int(WsBc *bc, WsUInt16 *index_return, WsInt32 value)
int ws_utf8_verify(const unsigned char *data, size_t len, size_t *strlen_return)
WsBool ws_bc_add_pragma_user_agent_property(WsBc *bc, const unsigned char *name, size_t name_len, const unsigned char *property, size_t property_len)
#define WS_BC_PRAGMA_USER_AGENT_PROPERTY
WsBool ws_bc_add_const_utf8_string(WsBc *bc, WsUInt16 *index_return, const unsigned char *data, size_t len)
WsBool ws_buffer_append_space(WsBuffer *buffer, unsigned char **p, size_t size)
union WsBcConstantRec::@116 u
void * ws_strdup(const char *str)
WsBool ws_bc_add_pragma_user_agent_property_and_scheme(WsBc *bc, const unsigned char *name, size_t name_len, const unsigned char *property, size_t property_len, const unsigned char *scheme, size_t scheme_len)
WsBool ws_bc_add_function(WsBc *bc, WsUInt8 *index_return, char *name, WsUInt8 num_arguments, WsUInt8 num_locals, WsUInt32 code_size, unsigned char *code)
WsBc * ws_bc_decode(const unsigned char *data, size_t data_len)
unsigned char * ws_buffer_ptr(WsBuffer *buffer)
unsigned char ws_ieee754_negative_inf[4]
unsigned char * ws_utf8_to_latin1(const WsUtf8String *string, unsigned char unknown_char, size_t *len_return)