File: srvmultibyte.h

package info (click to toggle)
virtuoso-opensource 6.1.6+dfsg2-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 260,992 kB
  • ctags: 125,220
  • sloc: ansic: 652,748; sql: 458,419; xml: 282,834; java: 61,031; sh: 40,031; cpp: 36,890; cs: 25,240; php: 12,692; yacc: 9,523; lex: 7,018; makefile: 6,157; jsp: 4,484; awk: 1,643; perl: 1,013; ruby: 1,003; python: 326
file content (71 lines) | stat: -rw-r--r-- 3,819 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
 *  srvmultibyte.h
 *
 *  $Id$
 *
 *  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
 *  project.
 *
 *  Copyright (C) 1998-2012 OpenLink Software
 *
 *  This project is free software; you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License as published by the
 *  Free Software Foundation; only version 2 of the License, dated June 1991.
 *
 *  This program is distributed in the hope that it will be useful, but
 *  WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *  General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 *
 */

#ifndef _SRVMULTIBYTE_H
#define _SRVMULTIBYTE_H

#include "multibyte.h"

void row_print_wide (caddr_t thing, dk_session_t * ses, dbe_column_t * col,
    caddr_t * err_ret, dtp_t dtp, wcharset_t *wcharset);
dk_set_t bh_string_list_w (/* this was before 3.0: index_space_t * isp, */ lock_trx_t * lt, blob_handle_t * bh,
    long get_chars, int omit, long blob_type); /* if omit!=0, it just run through blob part */
dk_session_t *bh_string_output_w (/* this was before 3.0: index_space_t * isp, */ lock_trx_t * lt, blob_handle_t * bh, int omit); /* if omit!=0, it just run through blob part */
int compare_utf8_with_collation (caddr_t dv1, long n1, caddr_t dv2, long n2, collation_t *collation);

caddr_t box_wide_char_string (caddr_t data, size_t len, dtp_t dtp);

caddr_t box_narrow_string_as_wide (unsigned char *str, caddr_t wide, long max_len, wcharset_t *charset, caddr_t * err_ret, int isbox);
caddr_t box_wide_string_as_narrow (caddr_t str, caddr_t narrow, long max_len, wcharset_t *charset);
caddr_t box_utf8_string_as_narrow (ccaddr_t _str, caddr_t narrow, long max_len, wcharset_t *charset);
caddr_t t_box_utf8_string_as_narrow (ccaddr_t _str, caddr_t narrow, long max_len, wcharset_t *charset);
caddr_t DBG_NAME (box_narrow_string_as_utf8) (DBG_PARAMS caddr_t _str, caddr_t narrow, long max_len, wcharset_t *charset, caddr_t * err_ret, int isbox);
#ifdef MALLOC_DEBUG
#define box_narrow_string_as_utf8(s,n,m,c,e,i) dbg_box_narrow_string_as_utf8 (__FILE__, __LINE__, (s), (n), (m), (c), (e), (i))
#endif
int parse_wide_string_literal (unsigned char **str_ptr, caddr_t box, wcharset_t *charset);

extern id_hash_t * global_wide_charsets;
extern wcharset_t * default_charset;
extern caddr_t default_charset_name;

caddr_t complete_charset_name (caddr_t qi, char *cs_name);

int compare_wide_to_latin1 (wchar_t *wbox1, long wbox1_wcharcount, unsigned char *box2, long box2_bytes);
int compare_wide_to_utf8_with_collation (wchar_t *wbox1, long wbox1_wcharcount, utf8char *box2, long box2_bytes, collation_t *collation);

extern wcharset_t *sch_name_to_charset (const char *name);
extern wcharset_t * wcharset_by_name_or_dflt (ccaddr_t cs_name, query_instance_t *qi);

wchar_t * reverse_wide_string (wchar_t * str);
caddr_t strstr_utf8_with_collation (caddr_t dv1, long n1,
	    caddr_t dv2, long n2, caddr_t *next, collation_t *collation);

struct encoding_handler_s;
/*! Translates a \c narrow string from charset or encding named \c cs1_uppercase to charset named \c cs2_upperase. \c qi is optional and used for _WS_ name */
extern caddr_t charset_recode_from_named_to_named (query_instance_t *qi, caddr_t narrow, const char *cs1_uppercase, const char *cs2_uppercase, int *res_is_new_ret, caddr_t *err_ret);
extern caddr_t charset_recode_from_cs_or_eh_to_cs (caddr_t narrow, int bom_skip_offset, struct encoding_handler_s *eh_cs1, wcharset_t *cs1, wcharset_t *cs2, int *res_is_new_ret, caddr_t *err_ret);

#endif /* _SRVMULTIBYTE_H */