clear trailing spaces in src/strutil.c
Этот коммит содержится в:
родитель
8725fa60a8
Коммит
b617640aab
152
src/strutil.c
152
src/strutil.c
@ -1,8 +1,8 @@
|
|||||||
/* common strings utilities
|
/* common strings utilities
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written 2007 by:
|
Written 2007 by:
|
||||||
Rostislav Benes
|
Rostislav Benes
|
||||||
|
|
||||||
The file_date routine is mostly from GNU's fileutils package,
|
The file_date routine is mostly from GNU's fileutils package,
|
||||||
written by Richard Stallman and David MacKenzie.
|
written by Richard Stallman and David MacKenzie.
|
||||||
@ -11,7 +11,7 @@
|
|||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
@ -57,7 +57,7 @@ static const char *str_8bit_encodings[] = {
|
|||||||
"iso8859",
|
"iso8859",
|
||||||
"koi8",
|
"koi8",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
// terminal encoding
|
// terminal encoding
|
||||||
static char *codeset;
|
static char *codeset;
|
||||||
@ -75,7 +75,7 @@ static int
|
|||||||
str_test_not_convert (const char *enc)
|
str_test_not_convert (const char *enc)
|
||||||
{
|
{
|
||||||
return g_ascii_strcasecmp (enc, codeset) == 0;
|
return g_ascii_strcasecmp (enc, codeset) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
str_conv_t
|
str_conv_t
|
||||||
str_crt_conv_to (const char *to_enc)
|
str_crt_conv_to (const char *to_enc)
|
||||||
@ -102,9 +102,9 @@ struct str_buffer *
|
|||||||
str_get_buffer ()
|
str_get_buffer ()
|
||||||
{
|
{
|
||||||
struct str_buffer *result;
|
struct str_buffer *result;
|
||||||
|
|
||||||
result = buffer_list;
|
result = buffer_list;
|
||||||
|
|
||||||
while (result != NULL) {
|
while (result != NULL) {
|
||||||
if (!result->used) {
|
if (!result->used) {
|
||||||
str_reset_buffer (result);
|
str_reset_buffer (result);
|
||||||
@ -113,21 +113,22 @@ str_get_buffer ()
|
|||||||
}
|
}
|
||||||
result = result->next;
|
result = result->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = g_new (struct str_buffer, 1);
|
result = g_new (struct str_buffer, 1);
|
||||||
result->size = BUF_TINY;
|
result->size = BUF_TINY;
|
||||||
result->data = g_new0 (char, result->size);
|
result->data = g_new0 (char, result->size);
|
||||||
result->data[0] = '\0';
|
result->data[0] = '\0';
|
||||||
result->actual = result->data;
|
result->actual = result->data;
|
||||||
result->remain = result->size;
|
result->remain = result->size;
|
||||||
|
|
||||||
result->next = buffer_list;
|
result->next = buffer_list;
|
||||||
buffer_list = result;
|
buffer_list = result;
|
||||||
|
|
||||||
result->used = 1;
|
result->used = 1;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
str_release_buffer (struct str_buffer *buffer)
|
str_release_buffer (struct str_buffer *buffer)
|
||||||
@ -139,7 +140,7 @@ void
|
|||||||
str_incrase_buffer (struct str_buffer *buffer)
|
str_incrase_buffer (struct str_buffer *buffer)
|
||||||
{
|
{
|
||||||
size_t offset;
|
size_t offset;
|
||||||
|
|
||||||
offset = buffer->actual - buffer->data;
|
offset = buffer->actual - buffer->data;
|
||||||
buffer->remain+= buffer->size;
|
buffer->remain+= buffer->size;
|
||||||
buffer->size*= 2;
|
buffer->size*= 2;
|
||||||
@ -158,19 +159,20 @@ str_reset_buffer (struct str_buffer *buffer)
|
|||||||
static int
|
static int
|
||||||
_str_convert (str_conv_t coder, char *string, struct str_buffer *buffer)
|
_str_convert (str_conv_t coder, char *string, struct str_buffer *buffer)
|
||||||
{
|
{
|
||||||
int state;
|
int state;
|
||||||
|
|
||||||
size_t left;
|
size_t left;
|
||||||
size_t nconv;
|
size_t nconv;
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
|
||||||
if (used_class.is_valid_string (string)) {
|
if (used_class.is_valid_string (string)) {
|
||||||
state = 0;
|
state = 0;
|
||||||
|
|
||||||
left = strlen (string);
|
left = strlen (string);
|
||||||
|
|
||||||
if (coder == (iconv_t) (-1)) return ESTR_FAILURE;
|
if (coder == (iconv_t) (-1)) return ESTR_FAILURE;
|
||||||
|
|
||||||
iconv(coder, NULL, NULL, NULL, NULL);
|
iconv(coder, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
while (((int)left) > 0) {
|
while (((int)left) > 0) {
|
||||||
@ -206,10 +208,10 @@ int
|
|||||||
str_convert (str_conv_t coder, char *string, struct str_buffer *buffer)
|
str_convert (str_conv_t coder, char *string, struct str_buffer *buffer)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
result = _str_convert (coder, string, buffer);
|
result = _str_convert (coder, string, buffer);
|
||||||
buffer->actual[0] = '\0';
|
buffer->actual[0] = '\0';
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,9 +223,9 @@ _str_vfs_convert_from (str_conv_t coder, char *string,
|
|||||||
size_t nconv;
|
size_t nconv;
|
||||||
|
|
||||||
left = strlen (string);
|
left = strlen (string);
|
||||||
|
|
||||||
if (coder == (iconv_t) (-1)) return ESTR_FAILURE;
|
if (coder == (iconv_t) (-1)) return ESTR_FAILURE;
|
||||||
|
|
||||||
iconv(coder, NULL, NULL, NULL, NULL);
|
iconv(coder, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@ -241,7 +243,7 @@ _str_vfs_convert_from (str_conv_t coder, char *string,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (left > 0);
|
} while (left > 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -249,16 +251,16 @@ int
|
|||||||
str_vfs_convert_from (str_conv_t coder, char *string, struct str_buffer *buffer)
|
str_vfs_convert_from (str_conv_t coder, char *string, struct str_buffer *buffer)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
if (coder == str_cnv_not_convert) {
|
if (coder == str_cnv_not_convert) {
|
||||||
str_insert_string (string, buffer);
|
str_insert_string (string, buffer);
|
||||||
result = 0;
|
result = 0;
|
||||||
} else result = _str_vfs_convert_from (coder, string, buffer);
|
} else result = _str_vfs_convert_from (coder, string, buffer);
|
||||||
buffer->actual[0] = '\0';
|
buffer->actual[0] = '\0';
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_vfs_convert_to (str_conv_t coder, const char *string,
|
str_vfs_convert_to (str_conv_t coder, const char *string,
|
||||||
int size, struct str_buffer *buffer)
|
int size, struct str_buffer *buffer)
|
||||||
@ -270,10 +272,10 @@ void
|
|||||||
str_insert_string (const char *string, struct str_buffer *buffer)
|
str_insert_string (const char *string, struct str_buffer *buffer)
|
||||||
{
|
{
|
||||||
size_t s;
|
size_t s;
|
||||||
|
|
||||||
s = strlen (string);
|
s = strlen (string);
|
||||||
while (buffer->remain < s) str_incrase_buffer (buffer);
|
while (buffer->remain < s) str_incrase_buffer (buffer);
|
||||||
|
|
||||||
memcpy (buffer->actual, string, s);
|
memcpy (buffer->actual, string, s);
|
||||||
buffer->actual+= s;
|
buffer->actual+= s;
|
||||||
buffer->remain-= s;
|
buffer->remain-= s;
|
||||||
@ -284,10 +286,10 @@ void
|
|||||||
str_insert_string2 (const char *string, int size, struct str_buffer *buffer)
|
str_insert_string2 (const char *string, int size, struct str_buffer *buffer)
|
||||||
{
|
{
|
||||||
size_t s;
|
size_t s;
|
||||||
|
|
||||||
s = (size >= 0) ? size : strlen (string);
|
s = (size >= 0) ? size : strlen (string);
|
||||||
while (buffer->remain < s) str_incrase_buffer (buffer);
|
while (buffer->remain < s) str_incrase_buffer (buffer);
|
||||||
|
|
||||||
memcpy (buffer->actual, string, s);
|
memcpy (buffer->actual, string, s);
|
||||||
buffer->actual+= s;
|
buffer->actual+= s;
|
||||||
buffer->remain-= s;
|
buffer->remain-= s;
|
||||||
@ -299,7 +301,7 @@ str_printf (struct str_buffer *buffer, const char *format, ...)
|
|||||||
{
|
{
|
||||||
int size;
|
int size;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
va_start (ap, format);
|
va_start (ap, format);
|
||||||
size = vsnprintf (buffer->actual, buffer->remain, format, ap);
|
size = vsnprintf (buffer->actual, buffer->remain, format, ap);
|
||||||
while (buffer->remain <= size) {
|
while (buffer->remain <= size) {
|
||||||
@ -315,7 +317,7 @@ void
|
|||||||
str_insert_char (char ch, struct str_buffer *buffer)
|
str_insert_char (char ch, struct str_buffer *buffer)
|
||||||
{
|
{
|
||||||
if (buffer->remain <= 1) str_incrase_buffer (buffer);
|
if (buffer->remain <= 1) str_incrase_buffer (buffer);
|
||||||
|
|
||||||
buffer->actual[0] = ch;
|
buffer->actual[0] = ch;
|
||||||
buffer->actual++;
|
buffer->actual++;
|
||||||
buffer->remain--;
|
buffer->remain--;
|
||||||
@ -332,7 +334,7 @@ void
|
|||||||
str_backward_buffer (struct str_buffer *buffer, int count)
|
str_backward_buffer (struct str_buffer *buffer, int count)
|
||||||
{
|
{
|
||||||
char *prev;
|
char *prev;
|
||||||
|
|
||||||
while ((count > 0) && (buffer->actual > buffer->data)) {
|
while ((count > 0) && (buffer->actual > buffer->data)) {
|
||||||
prev = str_get_prev_char (buffer->actual);
|
prev = str_get_prev_char (buffer->actual);
|
||||||
buffer->remain+= buffer->actual - prev;
|
buffer->remain+= buffer->actual - prev;
|
||||||
@ -341,19 +343,19 @@ str_backward_buffer (struct str_buffer *buffer, int count)
|
|||||||
count--;
|
count--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
|
int
|
||||||
str_translate_char (str_conv_t conv, char *keys, size_t ch_size,
|
str_translate_char (str_conv_t conv, char *keys, size_t ch_size,
|
||||||
char *output, size_t out_size)
|
char *output, size_t out_size)
|
||||||
{
|
{
|
||||||
size_t left;
|
size_t left;
|
||||||
size_t cnv;
|
size_t cnv;
|
||||||
|
|
||||||
iconv (conv, NULL, NULL, NULL, NULL);
|
iconv (conv, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
left = (ch_size == (size_t)(-1)) ? strlen (keys) : ch_size;
|
left = (ch_size == (size_t)(-1)) ? strlen (keys) : ch_size;
|
||||||
|
|
||||||
cnv = iconv (conv, &keys, &left, &output, &out_size);
|
cnv = iconv (conv, &keys, &left, &output, &out_size);
|
||||||
if (cnv == (size_t)(-1)) {
|
if (cnv == (size_t)(-1)) {
|
||||||
if (errno == EINVAL) return ESTR_PROBLEM; else return ESTR_FAILURE;
|
if (errno == EINVAL) return ESTR_PROBLEM; else return ESTR_FAILURE;
|
||||||
@ -375,12 +377,12 @@ str_test_encoding_class (const char *encoding, const char **table)
|
|||||||
{
|
{
|
||||||
int t;
|
int t;
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
for (t = 0; table[t] != NULL; t++) {
|
for (t = 0; table[t] != NULL; t++) {
|
||||||
result+= (g_ascii_strncasecmp (encoding, table[t],
|
result+= (g_ascii_strncasecmp (encoding, table[t],
|
||||||
strlen (table[t])) == 0);
|
strlen (table[t])) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,9 +396,9 @@ str_choose_str_functions ()
|
|||||||
} else {
|
} else {
|
||||||
used_class = str_ascii_init ();
|
used_class = str_ascii_init ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
str_init_strings (const char *termenc)
|
str_init_strings (const char *termenc)
|
||||||
{
|
{
|
||||||
codeset = g_strdup ((termenc != NULL)
|
codeset = g_strdup ((termenc != NULL)
|
||||||
@ -410,17 +412,17 @@ str_init_strings (const char *termenc)
|
|||||||
codeset = g_strdup (str_detect_termencoding ());
|
codeset = g_strdup (str_detect_termencoding ());
|
||||||
str_cnv_not_convert = iconv_open (codeset, codeset);
|
str_cnv_not_convert = iconv_open (codeset, codeset);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (str_cnv_not_convert == INVALID_CONV) {
|
if (str_cnv_not_convert == INVALID_CONV) {
|
||||||
g_free (codeset);
|
g_free (codeset);
|
||||||
codeset = g_strdup ("ascii");
|
codeset = g_strdup ("ascii");
|
||||||
str_cnv_not_convert = iconv_open (codeset, codeset);
|
str_cnv_not_convert = iconv_open (codeset, codeset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
str_cnv_to_term = str_cnv_not_convert;
|
str_cnv_to_term = str_cnv_not_convert;
|
||||||
str_cnv_from_term = str_cnv_not_convert;
|
str_cnv_from_term = str_cnv_not_convert;
|
||||||
|
|
||||||
str_choose_str_functions ();
|
str_choose_str_functions ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -429,7 +431,7 @@ str_release_buffer_list ()
|
|||||||
{
|
{
|
||||||
struct str_buffer *buffer;
|
struct str_buffer *buffer;
|
||||||
struct str_buffer *next;
|
struct str_buffer *next;
|
||||||
|
|
||||||
buffer = buffer_list;
|
buffer = buffer_list;
|
||||||
while (buffer != NULL) {
|
while (buffer != NULL) {
|
||||||
next = buffer->next;
|
next = buffer->next;
|
||||||
@ -437,16 +439,16 @@ str_release_buffer_list ()
|
|||||||
g_free (buffer);
|
g_free (buffer);
|
||||||
buffer = next;
|
buffer = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
str_uninit_strings ()
|
str_uninit_strings ()
|
||||||
{
|
{
|
||||||
str_release_buffer_list ();
|
str_release_buffer_list ();
|
||||||
|
|
||||||
iconv_close (str_cnv_not_convert);
|
iconv_close (str_cnv_not_convert);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
str_term_form (const char *text)
|
str_term_form (const char *text)
|
||||||
{
|
{
|
||||||
@ -480,7 +482,7 @@ str_term_substring (const char *text, int start, int width)
|
|||||||
char *
|
char *
|
||||||
str_get_next_char (char *text)
|
str_get_next_char (char *text)
|
||||||
{
|
{
|
||||||
|
|
||||||
used_class.cnext_char ((const char **)&text);
|
used_class.cnext_char ((const char **)&text);
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
@ -582,103 +584,103 @@ str_cprev_char_safe (const char **text)
|
|||||||
used_class.cprev_char_safe (text);
|
used_class.cprev_char_safe (text);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_next_noncomb_char (char **text)
|
str_next_noncomb_char (char **text)
|
||||||
{
|
{
|
||||||
return used_class.cnext_noncomb_char ((const char **) text);
|
return used_class.cnext_noncomb_char ((const char **) text);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_cnext_noncomb_char (const char **text)
|
str_cnext_noncomb_char (const char **text)
|
||||||
{
|
{
|
||||||
return used_class.cnext_noncomb_char (text);
|
return used_class.cnext_noncomb_char (text);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_prev_noncomb_char (char **text, const char *begin)
|
str_prev_noncomb_char (char **text, const char *begin)
|
||||||
{
|
{
|
||||||
return used_class.cprev_noncomb_char ((const char **) text, begin);
|
return used_class.cprev_noncomb_char ((const char **) text, begin);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_cprev_noncomb_char (const char **text, const char *begin)
|
str_cprev_noncomb_char (const char **text, const char *begin)
|
||||||
{
|
{
|
||||||
return used_class.cprev_noncomb_char (text, begin);
|
return used_class.cprev_noncomb_char (text, begin);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_is_valid_char (const char *ch, size_t size)
|
str_is_valid_char (const char *ch, size_t size)
|
||||||
{
|
{
|
||||||
return used_class.is_valid_char (ch, size);
|
return used_class.is_valid_char (ch, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_term_width1 (const char *text)
|
str_term_width1 (const char *text)
|
||||||
{
|
{
|
||||||
return used_class.term_width1 (text);
|
return used_class.term_width1 (text);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_term_width2 (const char *text, size_t length)
|
str_term_width2 (const char *text, size_t length)
|
||||||
{
|
{
|
||||||
return used_class.term_width2 (text, length);
|
return used_class.term_width2 (text, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_term_char_width (const char *text)
|
str_term_char_width (const char *text)
|
||||||
{
|
{
|
||||||
return used_class.term_char_width (text);
|
return used_class.term_char_width (text);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_offset_to_pos (const char* text, size_t length)
|
str_offset_to_pos (const char* text, size_t length)
|
||||||
{
|
{
|
||||||
return used_class.offset_to_pos (text, length);
|
return used_class.offset_to_pos (text, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_length (const char* text)
|
str_length (const char* text)
|
||||||
{
|
{
|
||||||
return used_class.length (text);
|
return used_class.length (text);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_length2 (const char* text, int size)
|
str_length2 (const char* text, int size)
|
||||||
{
|
{
|
||||||
return used_class.length2 (text, size);
|
return used_class.length2 (text, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_length_noncomb (const char* text)
|
str_length_noncomb (const char* text)
|
||||||
{
|
{
|
||||||
return used_class.length_noncomb (text);
|
return used_class.length_noncomb (text);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_column_to_pos (const char *text, size_t pos)
|
str_column_to_pos (const char *text, size_t pos)
|
||||||
{
|
{
|
||||||
return used_class.column_to_pos (text, pos);
|
return used_class.column_to_pos (text, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_isspace (const char *ch)
|
str_isspace (const char *ch)
|
||||||
{
|
{
|
||||||
return used_class.isspace (ch);
|
return used_class.isspace (ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_ispunct (const char *ch)
|
str_ispunct (const char *ch)
|
||||||
{
|
{
|
||||||
return used_class.ispunct (ch);
|
return used_class.ispunct (ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_isalnum (const char *ch)
|
str_isalnum (const char *ch)
|
||||||
{
|
{
|
||||||
return used_class.isalnum (ch);
|
return used_class.isalnum (ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_isdigit (const char *ch)
|
str_isdigit (const char *ch)
|
||||||
{
|
{
|
||||||
return used_class.isdigit (ch);
|
return used_class.isdigit (ch);
|
||||||
@ -696,13 +698,13 @@ str_tolower (const char *ch, char **out, size_t *remain)
|
|||||||
return used_class.tolower (ch, out, remain);
|
return used_class.tolower (ch, out, remain);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_isprint (const char *ch)
|
str_isprint (const char *ch)
|
||||||
{
|
{
|
||||||
return used_class.isprint (ch);
|
return used_class.isprint (ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_iscombiningmark (const char *ch)
|
str_iscombiningmark (const char *ch)
|
||||||
{
|
{
|
||||||
return used_class.iscombiningmark (ch);
|
return used_class.iscombiningmark (ch);
|
||||||
@ -725,7 +727,7 @@ void
|
|||||||
str_release_search_needle (char *needle, int case_sen)
|
str_release_search_needle (char *needle, int case_sen)
|
||||||
{
|
{
|
||||||
used_class.release_search_needle (needle, case_sen);
|
used_class.release_search_needle (needle, case_sen);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
str_search_first (const char *text, const char *search, int case_sen)
|
str_search_first (const char *text, const char *search, int case_sen)
|
||||||
@ -739,7 +741,7 @@ str_search_last (const char *text, const char *search, int case_sen)
|
|||||||
return used_class.search_last (text, search, case_sen);
|
return used_class.search_last (text, search, case_sen);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_is_valid_string (const char *text)
|
str_is_valid_string (const char *text)
|
||||||
{
|
{
|
||||||
return used_class.is_valid_string (text);
|
return used_class.is_valid_string (text);
|
||||||
@ -799,13 +801,13 @@ str_create_key_for_filename (const char *text, int case_sen)
|
|||||||
return used_class.create_key_for_filename (text, case_sen);
|
return used_class.create_key_for_filename (text, case_sen);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
str_key_collate (const char *t1, const char *t2, int case_sen)
|
str_key_collate (const char *t1, const char *t2, int case_sen)
|
||||||
{
|
{
|
||||||
return used_class.key_collate (t1, t2, case_sen);
|
return used_class.key_collate (t1, t2, case_sen);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
str_release_key (char *key, int case_sen)
|
str_release_key (char *key, int case_sen)
|
||||||
{
|
{
|
||||||
used_class.release_key (key, case_sen);
|
used_class.release_key (key, case_sen);
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user