Blame winpr/libwinpr/utils/trio/triostr.h

Packit Service fa4841
/*************************************************************************
Packit Service fa4841
 *
Packit Service fa4841
 * $Id: triostr.h,v 1.18 2010/01/26 13:02:02 breese Exp $
Packit Service fa4841
 *
Packit Service fa4841
 * Copyright (C) 2001 Bjorn Reese and Daniel Stenberg.
Packit Service fa4841
 *
Packit Service fa4841
 * Permission to use, copy, modify, and distribute this software for any
Packit Service fa4841
 * purpose with or without fee is hereby granted, provided that the above
Packit Service fa4841
 * copyright notice and this permission notice appear in all copies.
Packit Service fa4841
 *
Packit Service fa4841
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
Packit Service fa4841
 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
Packit Service fa4841
 * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
Packit Service fa4841
 * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
Packit Service fa4841
 *
Packit Service fa4841
 ************************************************************************/
Packit Service fa4841
Packit Service fa4841
#ifndef TRIO_TRIOSTR_H
Packit Service fa4841
#define TRIO_TRIOSTR_H
Packit Service fa4841
Packit Service fa4841
/*
Packit Service fa4841
 * Documentation is located in triostr.c
Packit Service fa4841
 */
Packit Service fa4841
Packit Service fa4841
#include <assert.h>
Packit Service fa4841
#include <stdlib.h>
Packit Service fa4841
#include <string.h>
Packit Service fa4841
#include <time.h>
Packit Service fa4841
#include "triodef.h"
Packit Service fa4841
#include "triop.h"
Packit Service fa4841
Packit Service fa4841
#ifdef __cplusplus
Packit Service b1ea74
extern "C"
Packit Service b1ea74
{
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service b1ea74
	enum
Packit Service b1ea74
	{
Packit Service b1ea74
		TRIO_HASH_NONE = 0,
Packit Service b1ea74
		TRIO_HASH_PLAIN,
Packit Service b1ea74
		TRIO_HASH_TWOSIGNED
Packit Service b1ea74
	};
Packit Service fa4841
Packit Service fa4841
#if !defined(TRIO_PUBLIC_STRING)
Packit Service b1ea74
#if !defined(TRIO_PUBLIC)
Packit Service b1ea74
#define TRIO_PUBLIC
Packit Service b1ea74
#endif
Packit Service b1ea74
#define TRIO_PUBLIC_STRING TRIO_PUBLIC
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service b1ea74
	/*************************************************************************
Packit Service b1ea74
	 * Dependencies
Packit Service b1ea74
	 */
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_EMBED_STRING)
Packit Service fa4841
Packit Service b1ea74
	/*
Packit Service b1ea74
	 * The application that triostr is embedded in must define which functions
Packit Service b1ea74
	 * it uses.
Packit Service b1ea74
	 *
Packit Service b1ea74
	 * The following resolves internal dependencies.
Packit Service b1ea74
	 */
Packit Service fa4841
Packit Service b1ea74
#if defined(TRIO_FUNC_XSTRING_SET)
Packit Service b1ea74
#if !defined(TRIO_FUNC_DUPLICATE)
Packit Service b1ea74
#define TRIO_FUNC_DUPLICATE
Packit Service b1ea74
#endif
Packit Service b1ea74
#endif
Packit Service fa4841
Packit Service b1ea74
#if defined(TRIO_FUNC_DUPLICATE) || defined(TRIO_FUNC_DUPLICATE_MAX) || \
Packit Service b1ea74
    defined(TRIO_FUNC_STRING_DUPLICATE) || defined(TRIO_FUNC_XSTRING_DUPLICATE)
Packit Service b1ea74
#if !defined(TRIO_FUNC_CREATE)
Packit Service b1ea74
#define TRIO_FUNC_CREATE
Packit Service b1ea74
#endif
Packit Service b1ea74
#if !defined(TRIO_FUNC_COPY_MAX)
Packit Service b1ea74
#define TRIO_FUNC_COPY_MAX
Packit Service b1ea74
#endif
Packit Service b1ea74
#endif
Packit Service fa4841
Packit Service b1ea74
#if defined(TRIO_FUNC_STRING_CREATE)
Packit Service b1ea74
#if !defined(TRIO_FUNC_STRING_DESTROY)
Packit Service b1ea74
#define TRIO_FUNC_STRING_DESTROY
Packit Service b1ea74
#endif
Packit Service b1ea74
#endif
Packit Service fa4841
Packit Service b1ea74
#if defined(TRIO_FUNC_STRING_DESTROY) || defined(TRIO_FUNC_XSTRING_SET)
Packit Service b1ea74
#if !defined(TRIO_FUNC_DESTROY)
Packit Service b1ea74
#define TRIO_FUNC_DESTROY
Packit Service b1ea74
#endif
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service b1ea74
#if defined(TRIO_FUNC_EQUAL_LOCALE) || defined(TRIO_FUNC_STRING_EQUAL) || \
Packit Service b1ea74
    defined(TRIO_FUNC_XSTRING_EQUAL)
Packit Service b1ea74
#if !defined(TRIO_FUNC_EQUAL)
Packit Service b1ea74
#define TRIO_FUNC_EQUAL
Packit Service b1ea74
#endif
Packit Service b1ea74
#endif
Packit Service fa4841
Packit Service b1ea74
#if defined(TRIO_FUNC_EQUAL_CASE) || defined(TRIO_FUNC_STRING_EQUAL_CASE) || \
Packit Service b1ea74
    defined(TRIO_FUNC_XSTRING_EQUAL_CASE)
Packit Service b1ea74
#if !defined(TRIO_FUNC_EQUAL_CASE)
Packit Service b1ea74
#define TRIO_FUNC_EQUAL_CASE
Packit Service b1ea74
#endif
Packit Service b1ea74
#endif
Packit Service b1ea74
Packit Service b1ea74
#if defined(TRIO_FUNC_SUBSTRING_MAX) || defined(TRIO_FUNC_STRING_EQUAL_MAX) || \
Packit Service b1ea74
    defined(TRIO_FUNC_XSTRING_EQUAL_MAX)
Packit Service b1ea74
#if !defined(TRIO_FUNC_EQUAL_MAX)
Packit Service b1ea74
#define TRIO_FUNC_EQUAL_MAX
Packit Service b1ea74
#endif
Packit Service b1ea74
#endif
Packit Service b1ea74
Packit Service b1ea74
#if defined(TRIO_FUNC_TO_DOUBLE) || defined(TRIO_FUNC_TO_FLOAT)
Packit Service b1ea74
#if !defined(TRIO_FUNC_TO_LONG_DOUBLE)
Packit Service b1ea74
#define TRIO_FUNC_TO_LONG_DOUBLE
Packit Service b1ea74
#endif
Packit Service b1ea74
#endif
Packit Service b1ea74
Packit Service b1ea74
#if defined(TRIO_FUNC_STRING_TERMINATE)
Packit Service b1ea74
#if !defined(TRIO_FUNC_XSTRING_APPEND_CHAR)
Packit Service b1ea74
#define TRIO_FUNC_XSTRING_APPEND_CHAR
Packit Service b1ea74
#endif
Packit Service b1ea74
#endif
Packit Service b1ea74
Packit Service b1ea74
#if defined(TRIO_FUNC_XSTRING_APPEND_CHAR)
Packit Service b1ea74
#if !defined(TRIO_FUNC_STRING_SIZE)
Packit Service b1ea74
#define TRIO_FUNC_STRING_SIZE
Packit Service b1ea74
#endif
Packit Service b1ea74
#endif
Packit Service b1ea74
Packit Service b1ea74
#else
Packit Service b1ea74
Packit Service b1ea74
/*
Packit Service b1ea74
 * When triostr is not embedded all functions are defined.
Packit Service fa4841
 */
Packit Service fa4841
Packit Service b1ea74
#define TRIO_FUNC_APPEND
Packit Service b1ea74
#define TRIO_FUNC_APPEND_MAX
Packit Service b1ea74
#define TRIO_FUNC_CONTAINS
Packit Service b1ea74
#define TRIO_FUNC_COPY
Packit Service b1ea74
#define TRIO_FUNC_COPY_MAX
Packit Service b1ea74
#define TRIO_FUNC_CREATE
Packit Service b1ea74
#define TRIO_FUNC_DESTROY
Packit Service b1ea74
#define TRIO_FUNC_DUPLICATE
Packit Service b1ea74
#define TRIO_FUNC_DUPLICATE_MAX
Packit Service b1ea74
#define TRIO_FUNC_EQUAL
Packit Service b1ea74
#define TRIO_FUNC_EQUAL_CASE
Packit Service b1ea74
#define TRIO_FUNC_EQUAL_CASE_MAX
Packit Service b1ea74
#define TRIO_FUNC_EQUAL_LOCALE
Packit Service b1ea74
#define TRIO_FUNC_EQUAL_MAX
Packit Service b1ea74
#define TRIO_FUNC_ERROR
Packit Service b1ea74
#if !defined(TRIO_PLATFORM_WINCE)
Packit Service b1ea74
#define TRIO_FUNC_FORMAT_DATE_MAX
Packit Service b1ea74
#endif
Packit Service b1ea74
#define TRIO_FUNC_HASH
Packit Service b1ea74
#define TRIO_FUNC_INDEX
Packit Service b1ea74
#define TRIO_FUNC_INDEX_LAST
Packit Service b1ea74
#define TRIO_FUNC_LENGTH
Packit Service b1ea74
#define TRIO_FUNC_LENGTH_MAX
Packit Service b1ea74
#define TRIO_FUNC_LOWER
Packit Service b1ea74
#define TRIO_FUNC_MATCH
Packit Service b1ea74
#define TRIO_FUNC_MATCH_CASE
Packit Service b1ea74
#define TRIO_FUNC_SPAN_FUNCTION
Packit Service b1ea74
#define TRIO_FUNC_SUBSTRING
Packit Service b1ea74
#define TRIO_FUNC_SUBSTRING_MAX
Packit Service b1ea74
#define TRIO_FUNC_TO_DOUBLE
Packit Service b1ea74
#define TRIO_FUNC_TO_FLOAT
Packit Service b1ea74
#define TRIO_FUNC_TO_LONG
Packit Service b1ea74
#define TRIO_FUNC_TO_LONG_DOUBLE
Packit Service b1ea74
#define TRIO_FUNC_TO_LOWER
Packit Service b1ea74
#define TRIO_FUNC_TO_UNSIGNED_LONG
Packit Service b1ea74
#define TRIO_FUNC_TO_UPPER
Packit Service b1ea74
#define TRIO_FUNC_TOKENIZE
Packit Service b1ea74
#define TRIO_FUNC_UPPER
Packit Service b1ea74
Packit Service b1ea74
#define TRIO_FUNC_STRING_APPEND
Packit Service b1ea74
#define TRIO_FUNC_STRING_CONTAINS
Packit Service b1ea74
#define TRIO_FUNC_STRING_COPY
Packit Service b1ea74
#define TRIO_FUNC_STRING_CREATE
Packit Service b1ea74
#define TRIO_FUNC_STRING_DESTROY
Packit Service b1ea74
#define TRIO_FUNC_STRING_DUPLICATE
Packit Service b1ea74
#define TRIO_FUNC_STRING_EQUAL
Packit Service b1ea74
#define TRIO_FUNC_STRING_EQUAL_CASE
Packit Service b1ea74
#define TRIO_FUNC_STRING_EQUAL_CASE_MAX
Packit Service b1ea74
#define TRIO_FUNC_STRING_EQUAL_MAX
Packit Service b1ea74
#define TRIO_FUNC_STRING_EXTRACT
Packit Service b1ea74
#if !defined(TRIO_PLATFORM_WINCE)
Packit Service b1ea74
#define TRIO_FUNC_STRING_FORMAT_DATE_MAX
Packit Service b1ea74
#endif
Packit Service b1ea74
#define TRIO_FUNC_STRING_GET
Packit Service b1ea74
#define TRIO_FUNC_STRING_INDEX
Packit Service b1ea74
#define TRIO_FUNC_STRING_INDEX_LAST
Packit Service b1ea74
#define TRIO_FUNC_STRING_LENGTH
Packit Service b1ea74
#define TRIO_FUNC_STRING_LOWER
Packit Service b1ea74
#define TRIO_FUNC_STRING_MATCH
Packit Service b1ea74
#define TRIO_FUNC_STRING_MATCH_CASE
Packit Service b1ea74
#define TRIO_FUNC_STRING_SIZE
Packit Service b1ea74
#define TRIO_FUNC_STRING_SUBSTRING
Packit Service b1ea74
#define TRIO_FUNC_STRING_TERMINATE
Packit Service b1ea74
#define TRIO_FUNC_STRING_UPPER
Packit Service b1ea74
Packit Service b1ea74
#define TRIO_FUNC_XSTRING_APPEND
Packit Service b1ea74
#define TRIO_FUNC_XSTRING_APPEND_CHAR
Packit Service b1ea74
#define TRIO_FUNC_XSTRING_APPEND_MAX
Packit Service b1ea74
#define TRIO_FUNC_XSTRING_CONTAINS
Packit Service b1ea74
#define TRIO_FUNC_XSTRING_COPY
Packit Service b1ea74
#define TRIO_FUNC_XSTRING_DUPLICATE
Packit Service b1ea74
#define TRIO_FUNC_XSTRING_EQUAL
Packit Service b1ea74
#define TRIO_FUNC_XSTRING_EQUAL_CASE
Packit Service b1ea74
#define TRIO_FUNC_XSTRING_EQUAL_CASE_MAX
Packit Service b1ea74
#define TRIO_FUNC_XSTRING_EQUAL_MAX
Packit Service b1ea74
#define TRIO_FUNC_XSTRING_MATCH
Packit Service b1ea74
#define TRIO_FUNC_XSTRING_MATCH_CASE
Packit Service b1ea74
#define TRIO_FUNC_XSTRING_SET
Packit Service b1ea74
#define TRIO_FUNC_XSTRING_SUBSTRING
Packit Service b1ea74
Packit Service b1ea74
#endif
Packit Service b1ea74
Packit Service b1ea74
	/*************************************************************************
Packit Service b1ea74
	 * String functions
Packit Service b1ea74
	 */
Packit Service b1ea74
Packit Service fa4841
#if defined(TRIO_FUNC_APPEND)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_append TRIO_PROTO((char* target, TRIO_CONST char* source));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_APPEND_MAX)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_append_max TRIO_PROTO((char* target, size_t max,
Packit Service b1ea74
	                                                   TRIO_CONST char* source));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_CONTAINS)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_contains TRIO_PROTO((TRIO_CONST char* string,
Packit Service b1ea74
	                                                 TRIO_CONST char* substring));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_COPY)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_copy TRIO_PROTO((char* target, TRIO_CONST char* source));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_COPY_MAX)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_copy_max TRIO_PROTO((char* target, size_t max,
Packit Service b1ea74
	                                                 TRIO_CONST char* source));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_CREATE)
Packit Service b1ea74
	TRIO_PUBLIC_STRING char* trio_create TRIO_PROTO((size_t size));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_DESTROY)
Packit Service b1ea74
	TRIO_PUBLIC_STRING void trio_destroy TRIO_PROTO((char* string));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_DUPLICATE)
Packit Service b1ea74
	TRIO_PUBLIC_STRING char* trio_duplicate TRIO_PROTO((TRIO_CONST char* source));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_DUPLICATE_MAX)
Packit Service b1ea74
	TRIO_PUBLIC_STRING char* trio_duplicate_max TRIO_PROTO((TRIO_CONST char* source, size_t max));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_EQUAL)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_equal TRIO_PROTO((TRIO_CONST char* first, TRIO_CONST char* second));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_EQUAL_CASE)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_equal_case TRIO_PROTO((TRIO_CONST char* first,
Packit Service b1ea74
	                                                   TRIO_CONST char* second));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_EQUAL_CASE_MAX)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_equal_case_max TRIO_PROTO((TRIO_CONST char* first, size_t max,
Packit Service b1ea74
	                                                       TRIO_CONST char* second));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_EQUAL_LOCALE)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_equal_locale TRIO_PROTO((TRIO_CONST char* first,
Packit Service b1ea74
	                                                     TRIO_CONST char* second));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_EQUAL_MAX)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_equal_max TRIO_PROTO((TRIO_CONST char* first, size_t max,
Packit Service b1ea74
	                                                  TRIO_CONST char* second));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_ERROR)
Packit Service b1ea74
	TRIO_PUBLIC_STRING TRIO_CONST char* trio_error TRIO_PROTO((int));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_FORMAT_DATE_MAX)
Packit Service b1ea74
	TRIO_PUBLIC_STRING size_t trio_format_date_max TRIO_PROTO((char* target, size_t max,
Packit Service b1ea74
	                                                           TRIO_CONST char* format,
Packit Service b1ea74
	                                                           TRIO_CONST struct tm* datetime));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_HASH)
Packit Service b1ea74
	TRIO_PUBLIC_STRING unsigned long trio_hash TRIO_PROTO((TRIO_CONST char* string, int type));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_INDEX)
Packit Service b1ea74
	TRIO_PUBLIC_STRING char* trio_index TRIO_PROTO((TRIO_CONST char* string, int character));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_INDEX_LAST)
Packit Service b1ea74
	TRIO_PUBLIC_STRING char* trio_index_last TRIO_PROTO((TRIO_CONST char* string, int character));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_LENGTH)
Packit Service b1ea74
	TRIO_PUBLIC_STRING size_t trio_length TRIO_PROTO((TRIO_CONST char* string));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_LENGTH_MAX)
Packit Service b1ea74
	TRIO_PUBLIC_STRING size_t trio_length_max TRIO_PROTO((TRIO_CONST char* string, size_t max));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_LOWER)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_lower TRIO_PROTO((char* target));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_MATCH)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_match TRIO_PROTO((TRIO_CONST char* string,
Packit Service b1ea74
	                                              TRIO_CONST char* pattern));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_MATCH_CASE)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_match_case TRIO_PROTO((TRIO_CONST char* string,
Packit Service b1ea74
	                                                   TRIO_CONST char* pattern));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_SPAN_FUNCTION)
Packit Service b1ea74
	TRIO_PUBLIC_STRING size_t trio_span_function TRIO_PROTO((char* target, TRIO_CONST char* source,
Packit Service b1ea74
	                                                         int(*Function) TRIO_PROTO((int))));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_SUBSTRING)
Packit Service b1ea74
	TRIO_PUBLIC_STRING char* trio_substring TRIO_PROTO((TRIO_CONST char* string,
Packit Service b1ea74
	                                                    TRIO_CONST char* substring));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_SUBSTRING_MAX)
Packit Service b1ea74
	TRIO_PUBLIC_STRING char* trio_substring_max TRIO_PROTO((TRIO_CONST char* string, size_t max,
Packit Service b1ea74
	                                                        TRIO_CONST char* substring));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_TO_DOUBLE)
Packit Service b1ea74
	TRIO_PUBLIC_STRING double trio_to_double TRIO_PROTO((TRIO_CONST char* source, char** endp));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_TO_FLOAT)
Packit Service b1ea74
	TRIO_PUBLIC_STRING float trio_to_float TRIO_PROTO((TRIO_CONST char* source, char** endp));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_TO_LONG)
Packit Service b1ea74
	TRIO_PUBLIC_STRING long trio_to_long TRIO_PROTO((TRIO_CONST char* source, char** endp,
Packit Service b1ea74
	                                                 int base));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_TO_LOWER)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_to_lower TRIO_PROTO((int source));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_TO_LONG_DOUBLE)
Packit Service b1ea74
	TRIO_PUBLIC_STRING trio_long_double_t trio_to_long_double TRIO_PROTO((TRIO_CONST char* source,
Packit Service b1ea74
	                                                                      char** endp));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_TO_UNSIGNED_LONG)
Packit Service b1ea74
	TRIO_PUBLIC_STRING unsigned long trio_to_unsigned_long TRIO_PROTO((TRIO_CONST char* source,
Packit Service b1ea74
	                                                                   char** endp, int base));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_TO_UPPER)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_to_upper TRIO_PROTO((int source));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_TOKENIZE)
Packit Service b1ea74
	TRIO_PUBLIC_STRING char* trio_tokenize TRIO_PROTO((char* string, TRIO_CONST char* delimiters));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_UPPER)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_upper TRIO_PROTO((char* target));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service b1ea74
	/*************************************************************************
Packit Service b1ea74
	 * Dynamic string functions
Packit Service b1ea74
	 */
Packit Service fa4841
Packit Service b1ea74
	/*
Packit Service b1ea74
	 * Opaque type for dynamic strings
Packit Service b1ea74
	 */
Packit Service fa4841
Packit Service b1ea74
	typedef struct _trio_string_t trio_string_t;
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_APPEND)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_string_append TRIO_PROTO((trio_string_t * self,
Packit Service b1ea74
	                                                      trio_string_t* other));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_CONTAINS)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_string_contains TRIO_PROTO((trio_string_t * self,
Packit Service b1ea74
	                                                        trio_string_t* other));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_COPY)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_string_copy TRIO_PROTO((trio_string_t * self,
Packit Service b1ea74
	                                                    trio_string_t* other));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_CREATE)
Packit Service b1ea74
	TRIO_PUBLIC_STRING trio_string_t* trio_string_create TRIO_PROTO((int initial_size));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_DESTROY)
Packit Service b1ea74
	TRIO_PUBLIC_STRING void trio_string_destroy TRIO_PROTO((trio_string_t * self));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_DUPLICATE)
Packit Service b1ea74
	TRIO_PUBLIC_STRING trio_string_t* trio_string_duplicate TRIO_PROTO((trio_string_t * other));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_EQUAL)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_string_equal TRIO_PROTO((trio_string_t * self,
Packit Service b1ea74
	                                                     trio_string_t* other));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_EQUAL_MAX)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_string_equal_max TRIO_PROTO((trio_string_t * self, size_t max,
Packit Service b1ea74
	                                                         trio_string_t* second));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_EQUAL_CASE)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_string_equal_case TRIO_PROTO((trio_string_t * self,
Packit Service b1ea74
	                                                          trio_string_t* other));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_EQUAL_CASE_MAX)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_string_equal_case_max TRIO_PROTO((trio_string_t * self, size_t max,
Packit Service b1ea74
	                                                              trio_string_t* other));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_EXTRACT)
Packit Service b1ea74
	TRIO_PUBLIC_STRING char* trio_string_extract TRIO_PROTO((trio_string_t * self));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_FORMAT_DATE_MAX)
Packit Service b1ea74
	TRIO_PUBLIC_STRING size_t trio_string_format_date_max TRIO_PROTO((
Packit Service b1ea74
	    trio_string_t * self, size_t max, TRIO_CONST char* format, TRIO_CONST struct tm* datetime));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_GET)
Packit Service b1ea74
	TRIO_PUBLIC_STRING char* trio_string_get TRIO_PROTO((trio_string_t * self, int offset));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_INDEX)
Packit Service b1ea74
	TRIO_PUBLIC_STRING char* trio_string_index TRIO_PROTO((trio_string_t * self, int character));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_INDEX_LAST)
Packit Service b1ea74
	TRIO_PUBLIC_STRING char* trio_string_index_last TRIO_PROTO((trio_string_t * self,
Packit Service b1ea74
	                                                            int character));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_LENGTH)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_string_length TRIO_PROTO((trio_string_t * self));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_LOWER)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_string_lower TRIO_PROTO((trio_string_t * self));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_MATCH)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_string_match TRIO_PROTO((trio_string_t * self,
Packit Service b1ea74
	                                                     trio_string_t* other));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_MATCH_CASE)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_string_match_case TRIO_PROTO((trio_string_t * self,
Packit Service b1ea74
	                                                          trio_string_t* other));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_SIZE)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_string_size TRIO_PROTO((trio_string_t * self));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_SUBSTRING)
Packit Service b1ea74
	TRIO_PUBLIC_STRING char* trio_string_substring TRIO_PROTO((trio_string_t * self,
Packit Service b1ea74
	                                                           trio_string_t* other));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_TERMINATE)
Packit Service b1ea74
	TRIO_PUBLIC_STRING void trio_string_terminate TRIO_PROTO((trio_string_t * self));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_STRING_UPPER)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_string_upper TRIO_PROTO((trio_string_t * self));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_XSTRING_APPEND)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_xstring_append TRIO_PROTO((trio_string_t * self,
Packit Service b1ea74
	                                                       TRIO_CONST char* other));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_XSTRING_APPEND_CHAR)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_xstring_append_char TRIO_PROTO((trio_string_t * self,
Packit Service b1ea74
	                                                            char character));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_XSTRING_APPEND_MAX)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_xstring_append_max TRIO_PROTO((trio_string_t * self,
Packit Service b1ea74
	                                                           TRIO_CONST char* other, size_t max));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_XSTRING_CONTAINS)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_xstring_contains TRIO_PROTO((trio_string_t * self,
Packit Service b1ea74
	                                                         TRIO_CONST char* other));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_XSTRING_COPY)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_xstring_copy TRIO_PROTO((trio_string_t * self,
Packit Service b1ea74
	                                                     TRIO_CONST char* other));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_XSTRING_DUPLICATE)
Packit Service b1ea74
	TRIO_PUBLIC_STRING trio_string_t* trio_xstring_duplicate TRIO_PROTO((TRIO_CONST char* other));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_XSTRING_EQUAL)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_xstring_equal TRIO_PROTO((trio_string_t * self,
Packit Service b1ea74
	                                                      TRIO_CONST char* other));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_XSTRING_EQUAL_MAX)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_xstring_equal_max TRIO_PROTO((trio_string_t * self, size_t max,
Packit Service b1ea74
	                                                          TRIO_CONST char* other));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_XSTRING_EQUAL_CASE)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_xstring_equal_case TRIO_PROTO((trio_string_t * self,
Packit Service b1ea74
	                                                           TRIO_CONST char* other));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_XSTRING_EQUAL_CASE_MAX)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_xstring_equal_case_max TRIO_PROTO((trio_string_t * self, size_t max,
Packit Service b1ea74
	                                                               TRIO_CONST char* other));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_XSTRING_MATCH)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_xstring_match TRIO_PROTO((trio_string_t * self,
Packit Service b1ea74
	                                                      TRIO_CONST char* other));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_XSTRING_MATCH_CASE)
Packit Service b1ea74
	TRIO_PUBLIC_STRING int trio_xstring_match_case TRIO_PROTO((trio_string_t * self,
Packit Service b1ea74
	                                                           TRIO_CONST char* other));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_XSTRING_SET)
Packit Service b1ea74
	TRIO_PUBLIC_STRING void trio_xstring_set TRIO_PROTO((trio_string_t * self, char* buffer));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#if defined(TRIO_FUNC_XSTRING_SUBSTRING)
Packit Service b1ea74
	TRIO_PUBLIC_STRING char* trio_xstring_substring TRIO_PROTO((trio_string_t * self,
Packit Service b1ea74
	                                                            TRIO_CONST char* other));
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#ifdef __cplusplus
Packit Service fa4841
}
Packit Service fa4841
#endif
Packit Service fa4841
Packit Service fa4841
#endif /* TRIO_TRIOSTR_H */