⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 triostr.h

📁 一个C语言写的快速贝叶斯垃圾邮件过滤工具
💻 H
📖 第 1 页 / 共 2 页
字号:
/************************************************************************* * * $Id: triostr.h,v 1.15 2005/05/29 11:56:01 breese Exp $ * * Copyright (C) 2001 Bjorn Reese and Daniel Stenberg. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER. * ************************************************************************/#ifndef TRIO_TRIOSTR_H#define TRIO_TRIOSTR_H/* * Documentation is located in triostr.c */#include <assert.h>#include <stdlib.h>#include <string.h>#include <time.h>#include "triodef.h"#include "triop.h"#ifdef __cplusplusextern "C" {#endifenum {  TRIO_HASH_NONE = 0,  TRIO_HASH_PLAIN,  TRIO_HASH_TWOSIGNED};#if !defined(TRIO_PUBLIC_STRING)# if !defined(TRIO_PUBLIC)#  define TRIO_PUBLIC# endif# define TRIO_PUBLIC_STRING TRIO_PUBLIC#endif/************************************************************************* * Dependencies */#if defined(TRIO_EMBED_STRING)/* * The application that triostr is embedded in must define which functions * it uses. * * The following resolves internal dependencies. */  # if defined(TRIO_FUNC_XSTRING_SET)#  if !defined(TRIO_FUNC_DUPLICATE)#   define TRIO_FUNC_DUPLICATE#  endif# endif# if defined(TRIO_FUNC_DUPLICATE) \  || defined(TRIO_FUNC_DUPLICATE_MAX) \  || defined(TRIO_FUNC_STRING_DUPLICATE) \  || defined(TRIO_FUNC_XSTRING_DUPLICATE)#  if !defined(TRIO_FUNC_CREATE)#   define TRIO_FUNC_CREATE#  endif#  if !defined(TRIO_FUNC_COPY_MAX)#   define TRIO_FUNC_COPY_MAX#  endif# endif# if defined(TRIO_FUNC_STRING_CREATE)#  if !defined(TRIO_FUNC_STRING_DESTROY)#   define TRIO_FUNC_STRING_DESTROY#  endif# endif# if defined(TRIO_FUNC_STRING_DESTROY) \  || defined(TRIO_FUNC_XSTRING_SET)#  if !defined(TRIO_FUNC_DESTROY)#   define TRIO_FUNC_DESTROY#  endif# endif# if defined(TRIO_FUNC_EQUAL_LOCALE) \  || defined(TRIO_FUNC_STRING_EQUAL) \  || defined(TRIO_FUNC_XSTRING_EQUAL)#  if !defined(TRIO_FUNC_EQUAL)#   define TRIO_FUNC_EQUAL#  endif# endif# if defined(TRIO_FUNC_EQUAL_CASE) \  || defined(TRIO_FUNC_STRING_EQUAL_CASE) \  || defined(TRIO_FUNC_XSTRING_EQUAL_CASE)#  if !defined(TRIO_FUNC_EQUAL_CASE)#   define TRIO_FUNC_EQUAL_CASE#  endif# endif# if defined(TRIO_FUNC_SUBSTRING_MAX) \  || defined(TRIO_FUNC_STRING_EQUAL_MAX) \  || defined(TRIO_FUNC_XSTRING_EQUAL_MAX)#  if !defined(TRIO_FUNC_EQUAL_MAX)#   define TRIO_FUNC_EQUAL_MAX#  endif# endif# if defined(TRIO_FUNC_TO_DOUBLE) \  || defined(TRIO_FUNC_TO_FLOAT)#  if !defined(TRIO_FUNC_TO_LONG_DOUBLE)#   define TRIO_FUNC_TO_LONG_DOUBLE#  endif# endif# if defined(TRIO_FUNC_STRING_TERMINATE)#  if !defined(TRIO_FUNC_XSTRING_APPEND_CHAR)#   define TRIO_FUNC_XSTRING_APPEND_CHAR#  endif# endif# if defined(TRIO_FUNC_XSTRING_APPEND_CHAR)#  if !defined(TRIO_FUNC_STRING_SIZE)#   define TRIO_FUNC_STRING_SIZE#  endif# endif#else/* * When triostr is not embedded all all functions are defined. */# define TRIO_FUNC_APPEND# define TRIO_FUNC_APPEND_MAX# define TRIO_FUNC_CONTAINS# define TRIO_FUNC_COPY# define TRIO_FUNC_COPY_MAX# define TRIO_FUNC_CREATE# define TRIO_FUNC_DESTROY# define TRIO_FUNC_DUPLICATE# define TRIO_FUNC_DUPLICATE_MAX# define TRIO_FUNC_EQUAL# define TRIO_FUNC_EQUAL_CASE# define TRIO_FUNC_EQUAL_CASE_MAX# define TRIO_FUNC_EQUAL_LOCALE# define TRIO_FUNC_EQUAL_MAX# define TRIO_FUNC_ERROR# define TRIO_FUNC_FORMAT_DATE_MAX# define TRIO_FUNC_HASH# define TRIO_FUNC_INDEX# define TRIO_FUNC_INDEX_LAST# define TRIO_FUNC_LENGTH# define TRIO_FUNC_LOWER# define TRIO_FUNC_MATCH# define TRIO_FUNC_MATCH_CASE# define TRIO_FUNC_SPAN_FUNCTION# define TRIO_FUNC_SUBSTRING# define TRIO_FUNC_SUBSTRING_MAX# define TRIO_FUNC_TO_DOUBLE# define TRIO_FUNC_TO_FLOAT# define TRIO_FUNC_TO_LONG# define TRIO_FUNC_TO_LONG_DOUBLE# define TRIO_FUNC_TO_LOWER# define TRIO_FUNC_TO_UNSIGNED_LONG# define TRIO_FUNC_TO_UPPER# define TRIO_FUNC_TOKENIZE# define TRIO_FUNC_UPPER# define TRIO_FUNC_STRING_APPEND# define TRIO_FUNC_STRING_CONTAINS# define TRIO_FUNC_STRING_COPY# define TRIO_FUNC_STRING_CREATE# define TRIO_FUNC_STRING_DESTROY# define TRIO_FUNC_STRING_DUPLICATE# define TRIO_FUNC_STRING_EQUAL# define TRIO_FUNC_STRING_EQUAL_CASE# define TRIO_FUNC_STRING_EQUAL_CASE_MAX# define TRIO_FUNC_STRING_EQUAL_MAX# define TRIO_FUNC_STRING_EXTRACT# define TRIO_FUNC_STRING_FORMAT_DATE_MAX# define TRIO_FUNC_STRING_GET# define TRIO_FUNC_STRING_INDEX# define TRIO_FUNC_STRING_INDEX_LAST# define TRIO_FUNC_STRING_LENGTH# define TRIO_FUNC_STRING_LOWER# define TRIO_FUNC_STRING_MATCH# define TRIO_FUNC_STRING_MATCH_CASE# define TRIO_FUNC_STRING_SIZE# define TRIO_FUNC_STRING_SUBSTRING# define TRIO_FUNC_STRING_TERMINATE# define TRIO_FUNC_STRING_UPPER# define TRIO_FUNC_XSTRING_APPEND# define TRIO_FUNC_XSTRING_APPEND_CHAR# define TRIO_FUNC_XSTRING_CONTAINS# define TRIO_FUNC_XSTRING_COPY# define TRIO_FUNC_XSTRING_DUPLICATE# define TRIO_FUNC_XSTRING_EQUAL# define TRIO_FUNC_XSTRING_EQUAL_CASE# define TRIO_FUNC_XSTRING_EQUAL_CASE_MAX# define TRIO_FUNC_XSTRING_EQUAL_MAX# define TRIO_FUNC_XSTRING_MATCH# define TRIO_FUNC_XSTRING_MATCH_CASE# define TRIO_FUNC_XSTRING_SET# define TRIO_FUNC_XSTRING_SUBSTRING#endif/************************************************************************* * String functions */#if defined(TRIO_FUNC_APPEND)TRIO_PUBLIC_STRING inttrio_appendTRIO_PROTO((char *target, TRIO_CONST char *source));#endif#if defined(TRIO_FUNC_APPEND_MAX)TRIO_PUBLIC_STRING inttrio_append_maxTRIO_PROTO((char *target, size_t max, TRIO_CONST char *source));#endif#if defined(TRIO_FUNC_CONTAINS)TRIO_PUBLIC_STRING inttrio_containsTRIO_PROTO((TRIO_CONST char *string, TRIO_CONST char *substring));#endif#if defined(TRIO_FUNC_COPY)TRIO_PUBLIC_STRING inttrio_copyTRIO_PROTO((char *target, TRIO_CONST char *source));#endif#if defined(TRIO_FUNC_COPY_MAX)TRIO_PUBLIC_STRING inttrio_copy_maxTRIO_PROTO((char *target, size_t max, TRIO_CONST char *source));#endif#if defined(TRIO_FUNC_CREATE)TRIO_PUBLIC_STRING char *trio_createTRIO_PROTO((size_t size));#endif#if defined(TRIO_FUNC_DESTROY)TRIO_PUBLIC_STRING voidtrio_destroyTRIO_PROTO((char *string));#endif#if defined(TRIO_FUNC_DUPLICATE)TRIO_PUBLIC_STRING char *trio_duplicateTRIO_PROTO((TRIO_CONST char *source));#endif#if defined(TRIO_FUNC_DUPLICATE_MAX)TRIO_PUBLIC_STRING char *trio_duplicate_maxTRIO_PROTO((TRIO_CONST char *source, size_t max));#endif#if defined(TRIO_FUNC_EQUAL)TRIO_PUBLIC_STRING inttrio_equalTRIO_PROTO((TRIO_CONST char *first, TRIO_CONST char *second));#endif#if defined(TRIO_FUNC_EQUAL_CASE)TRIO_PUBLIC_STRING inttrio_equal_caseTRIO_PROTO((TRIO_CONST char *first, TRIO_CONST char *second));#endif#if defined(TRIO_FUNC_EQUAL_CASE_MAX)TRIO_PUBLIC_STRING inttrio_equal_case_maxTRIO_PROTO((TRIO_CONST char *first, size_t max, TRIO_CONST char *second));#endif#if defined(TRIO_FUNC_EQUAL_LOCALE)TRIO_PUBLIC_STRING inttrio_equal_localeTRIO_PROTO((TRIO_CONST char *first, TRIO_CONST char *second));#endif#if defined(TRIO_FUNC_EQUAL_MAX)TRIO_PUBLIC_STRING inttrio_equal_maxTRIO_PROTO((TRIO_CONST char *first, size_t max, TRIO_CONST char *second));#endif#if defined(TRIO_FUNC_ERROR)TRIO_PUBLIC_STRING TRIO_CONST char *trio_errorTRIO_PROTO((int));#endif#if defined(TRIO_FUNC_FORMAT_DATE_MAX)TRIO_PUBLIC_STRING size_ttrio_format_date_maxTRIO_PROTO((char *target, size_t max, TRIO_CONST char *format, TRIO_CONST struct tm *datetime));#endif#if defined(TRIO_FUNC_HASH)TRIO_PUBLIC_STRING unsigned longtrio_hashTRIO_PROTO((TRIO_CONST char *string, int type));#endif#if defined(TRIO_FUNC_INDEX)TRIO_PUBLIC_STRING char *trio_indexTRIO_PROTO((TRIO_CONST char *string, int character));#endif#if defined(TRIO_FUNC_INDEX_LAST)TRIO_PUBLIC_STRING char *

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -