1 /************************************************************************* 2 * 3 * $Id: triostr.h,v 1.18 2010/01/26 13:02:02 breese Exp $ 4 * 5 * Copyright (C) 2001 Bjorn Reese and Daniel Stenberg. 6 * 7 * Permission to use, copy, modify, and distribute this software for any 8 * purpose with or without fee is hereby granted, provided that the above 9 * copyright notice and this permission notice appear in all copies. 10 * 11 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 12 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 13 * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND 14 * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER. 15 * 16 ************************************************************************/ 17 18 #ifndef TRIO_TRIOSTR_H 19 #define TRIO_TRIOSTR_H 20 21 /* 22 * Documentation is located in triostr.c 23 */ 24 25 #include <assert.h> 26 #include <stdlib.h> 27 #include <string.h> 28 #include <time.h> 29 #include "triodef.h" 30 #include "triop.h" 31 32 #ifdef __cplusplus 33 extern "C" { 34 #endif 35 36 enum { 37 TRIO_HASH_NONE = 0, 38 TRIO_HASH_PLAIN, 39 TRIO_HASH_TWOSIGNED 40 }; 41 42 #if !defined(TRIO_PUBLIC_STRING) 43 # if !defined(TRIO_PUBLIC) 44 # define TRIO_PUBLIC 45 # endif 46 # define TRIO_PUBLIC_STRING TRIO_PUBLIC 47 #endif 48 49 /************************************************************************* 50 * Dependencies 51 */ 52 53 #if defined(TRIO_EMBED_STRING) 54 55 /* 56 * The application that triostr is embedded in must define which functions 57 * it uses. 58 * 59 * The following resolves internal dependencies. 60 */ 61 62 # if defined(TRIO_FUNC_XSTRING_SET) 63 # if !defined(TRIO_FUNC_DUPLICATE) 64 # define TRIO_FUNC_DUPLICATE 65 # endif 66 # endif 67 68 # if defined(TRIO_FUNC_DUPLICATE) \ 69 || defined(TRIO_FUNC_DUPLICATE_MAX) \ 70 || defined(TRIO_FUNC_STRING_DUPLICATE) \ 71 || defined(TRIO_FUNC_XSTRING_DUPLICATE) 72 # if !defined(TRIO_FUNC_CREATE) 73 # define TRIO_FUNC_CREATE 74 # endif 75 # if !defined(TRIO_FUNC_COPY_MAX) 76 # define TRIO_FUNC_COPY_MAX 77 # endif 78 # endif 79 80 # if defined(TRIO_FUNC_STRING_CREATE) 81 # if !defined(TRIO_FUNC_STRING_DESTROY) 82 # define TRIO_FUNC_STRING_DESTROY 83 # endif 84 # endif 85 86 # if defined(TRIO_FUNC_STRING_DESTROY) \ 87 || defined(TRIO_FUNC_XSTRING_SET) 88 # if !defined(TRIO_FUNC_DESTROY) 89 # define TRIO_FUNC_DESTROY 90 # endif 91 # endif 92 93 # if defined(TRIO_FUNC_EQUAL_LOCALE) \ 94 || defined(TRIO_FUNC_STRING_EQUAL) \ 95 || defined(TRIO_FUNC_XSTRING_EQUAL) 96 # if !defined(TRIO_FUNC_EQUAL) 97 # define TRIO_FUNC_EQUAL 98 # endif 99 # endif 100 101 # if defined(TRIO_FUNC_EQUAL_CASE) \ 102 || defined(TRIO_FUNC_STRING_EQUAL_CASE) \ 103 || defined(TRIO_FUNC_XSTRING_EQUAL_CASE) 104 # if !defined(TRIO_FUNC_EQUAL_CASE) 105 # define TRIO_FUNC_EQUAL_CASE 106 # endif 107 # endif 108 109 # if defined(TRIO_FUNC_SUBSTRING_MAX) \ 110 || defined(TRIO_FUNC_STRING_EQUAL_MAX) \ 111 || defined(TRIO_FUNC_XSTRING_EQUAL_MAX) 112 # if !defined(TRIO_FUNC_EQUAL_MAX) 113 # define TRIO_FUNC_EQUAL_MAX 114 # endif 115 # endif 116 117 # if defined(TRIO_FUNC_TO_DOUBLE) \ 118 || defined(TRIO_FUNC_TO_FLOAT) 119 # if !defined(TRIO_FUNC_TO_LONG_DOUBLE) 120 # define TRIO_FUNC_TO_LONG_DOUBLE 121 # endif 122 # endif 123 124 # if defined(TRIO_FUNC_STRING_TERMINATE) 125 # if !defined(TRIO_FUNC_XSTRING_APPEND_CHAR) 126 # define TRIO_FUNC_XSTRING_APPEND_CHAR 127 # endif 128 # endif 129 130 # if defined(TRIO_FUNC_XSTRING_APPEND_CHAR) 131 # if !defined(TRIO_FUNC_STRING_SIZE) 132 # define TRIO_FUNC_STRING_SIZE 133 # endif 134 # endif 135 136 #else 137 138 /* 139 * When triostr is not embedded all functions are defined. 140 */ 141 142 # define TRIO_FUNC_APPEND 143 # define TRIO_FUNC_APPEND_MAX 144 # define TRIO_FUNC_CONTAINS 145 # define TRIO_FUNC_COPY 146 # define TRIO_FUNC_COPY_MAX 147 # define TRIO_FUNC_CREATE 148 # define TRIO_FUNC_DESTROY 149 # define TRIO_FUNC_DUPLICATE 150 # define TRIO_FUNC_DUPLICATE_MAX 151 # define TRIO_FUNC_EQUAL 152 # define TRIO_FUNC_EQUAL_CASE 153 # define TRIO_FUNC_EQUAL_CASE_MAX 154 # define TRIO_FUNC_EQUAL_LOCALE 155 # define TRIO_FUNC_EQUAL_MAX 156 # define TRIO_FUNC_ERROR 157 # if !defined(TRIO_PLATFORM_WINCE) 158 # define TRIO_FUNC_FORMAT_DATE_MAX 159 # endif 160 # define TRIO_FUNC_HASH 161 # define TRIO_FUNC_INDEX 162 # define TRIO_FUNC_INDEX_LAST 163 # define TRIO_FUNC_LENGTH 164 # define TRIO_FUNC_LENGTH_MAX 165 # define TRIO_FUNC_LOWER 166 # define TRIO_FUNC_MATCH 167 # define TRIO_FUNC_MATCH_CASE 168 # define TRIO_FUNC_SPAN_FUNCTION 169 # define TRIO_FUNC_SUBSTRING 170 # define TRIO_FUNC_SUBSTRING_MAX 171 # define TRIO_FUNC_TO_DOUBLE 172 # define TRIO_FUNC_TO_FLOAT 173 # define TRIO_FUNC_TO_LONG 174 # define TRIO_FUNC_TO_LONG_DOUBLE 175 # define TRIO_FUNC_TO_LOWER 176 # define TRIO_FUNC_TO_UNSIGNED_LONG 177 # define TRIO_FUNC_TO_UPPER 178 # define TRIO_FUNC_TOKENIZE 179 # define TRIO_FUNC_UPPER 180 181 # define TRIO_FUNC_STRING_APPEND 182 # define TRIO_FUNC_STRING_CONTAINS 183 # define TRIO_FUNC_STRING_COPY 184 # define TRIO_FUNC_STRING_CREATE 185 # define TRIO_FUNC_STRING_DESTROY 186 # define TRIO_FUNC_STRING_DUPLICATE 187 # define TRIO_FUNC_STRING_EQUAL 188 # define TRIO_FUNC_STRING_EQUAL_CASE 189 # define TRIO_FUNC_STRING_EQUAL_CASE_MAX 190 # define TRIO_FUNC_STRING_EQUAL_MAX 191 # define TRIO_FUNC_STRING_EXTRACT 192 # if !defined(TRIO_PLATFORM_WINCE) 193 # define TRIO_FUNC_STRING_FORMAT_DATE_MAX 194 # endif 195 # define TRIO_FUNC_STRING_GET 196 # define TRIO_FUNC_STRING_INDEX 197 # define TRIO_FUNC_STRING_INDEX_LAST 198 # define TRIO_FUNC_STRING_LENGTH 199 # define TRIO_FUNC_STRING_LOWER 200 # define TRIO_FUNC_STRING_MATCH 201 # define TRIO_FUNC_STRING_MATCH_CASE 202 # define TRIO_FUNC_STRING_SIZE 203 # define TRIO_FUNC_STRING_SUBSTRING 204 # define TRIO_FUNC_STRING_TERMINATE 205 # define TRIO_FUNC_STRING_UPPER 206 207 # define TRIO_FUNC_XSTRING_APPEND 208 # define TRIO_FUNC_XSTRING_APPEND_CHAR 209 # define TRIO_FUNC_XSTRING_APPEND_MAX 210 # define TRIO_FUNC_XSTRING_CONTAINS 211 # define TRIO_FUNC_XSTRING_COPY 212 # define TRIO_FUNC_XSTRING_DUPLICATE 213 # define TRIO_FUNC_XSTRING_EQUAL 214 # define TRIO_FUNC_XSTRING_EQUAL_CASE 215 # define TRIO_FUNC_XSTRING_EQUAL_CASE_MAX 216 # define TRIO_FUNC_XSTRING_EQUAL_MAX 217 # define TRIO_FUNC_XSTRING_MATCH 218 # define TRIO_FUNC_XSTRING_MATCH_CASE 219 # define TRIO_FUNC_XSTRING_SET 220 # define TRIO_FUNC_XSTRING_SUBSTRING 221 222 #endif 223 224 225 /************************************************************************* 226 * String functions 227 */ 228 229 #if defined(TRIO_FUNC_APPEND) 230 TRIO_PUBLIC_STRING int 231 trio_append 232 TRIO_PROTO((char *target, TRIO_CONST char *source)); 233 #endif 234 235 #if defined(TRIO_FUNC_APPEND_MAX) 236 TRIO_PUBLIC_STRING int 237 trio_append_max 238 TRIO_PROTO((char *target, size_t max, TRIO_CONST char *source)); 239 #endif 240 241 #if defined(TRIO_FUNC_CONTAINS) 242 TRIO_PUBLIC_STRING int 243 trio_contains 244 TRIO_PROTO((TRIO_CONST char *string, TRIO_CONST char *substring)); 245 #endif 246 247 #if defined(TRIO_FUNC_COPY) 248 TRIO_PUBLIC_STRING int 249 trio_copy 250 TRIO_PROTO((char *target, TRIO_CONST char *source)); 251 #endif 252 253 #if defined(TRIO_FUNC_COPY_MAX) 254 TRIO_PUBLIC_STRING int 255 trio_copy_max 256 TRIO_PROTO((char *target, size_t max, TRIO_CONST char *source)); 257 #endif 258 259 #if defined(TRIO_FUNC_CREATE) 260 TRIO_PUBLIC_STRING char * 261 trio_create 262 TRIO_PROTO((size_t size)); 263 #endif 264 265 #if defined(TRIO_FUNC_DESTROY) 266 TRIO_PUBLIC_STRING void 267 trio_destroy 268 TRIO_PROTO((char *string)); 269 #endif 270 271 #if defined(TRIO_FUNC_DUPLICATE) 272 TRIO_PUBLIC_STRING char * 273 trio_duplicate 274 TRIO_PROTO((TRIO_CONST char *source)); 275 #endif 276 277 #if defined(TRIO_FUNC_DUPLICATE_MAX) 278 TRIO_PUBLIC_STRING char * 279 trio_duplicate_max 280 TRIO_PROTO((TRIO_CONST char *source, size_t max)); 281 #endif 282 283 #if defined(TRIO_FUNC_EQUAL) 284 TRIO_PUBLIC_STRING int 285 trio_equal 286 TRIO_PROTO((TRIO_CONST char *first, TRIO_CONST char *second)); 287 #endif 288 289 #if defined(TRIO_FUNC_EQUAL_CASE) 290 TRIO_PUBLIC_STRING int 291 trio_equal_case 292 TRIO_PROTO((TRIO_CONST char *first, TRIO_CONST char *second)); 293 #endif 294 295 #if defined(TRIO_FUNC_EQUAL_CASE_MAX) 296 TRIO_PUBLIC_STRING int 297 trio_equal_case_max 298 TRIO_PROTO((TRIO_CONST char *first, size_t max, TRIO_CONST char *second)); 299 #endif 300 301 #if defined(TRIO_FUNC_EQUAL_LOCALE) 302 TRIO_PUBLIC_STRING int 303 trio_equal_locale 304 TRIO_PROTO((TRIO_CONST char *first, TRIO_CONST char *second)); 305 #endif 306 307 #if defined(TRIO_FUNC_EQUAL_MAX) 308 TRIO_PUBLIC_STRING int 309 trio_equal_max 310 TRIO_PROTO((TRIO_CONST char *first, size_t max, TRIO_CONST char *second)); 311 #endif 312 313 #if defined(TRIO_FUNC_ERROR) 314 TRIO_PUBLIC_STRING TRIO_CONST char * 315 trio_error 316 TRIO_PROTO((int)); 317 #endif 318 319 #if defined(TRIO_FUNC_FORMAT_DATE_MAX) 320 TRIO_PUBLIC_STRING size_t 321 trio_format_date_max 322 TRIO_PROTO((char *target, size_t max, TRIO_CONST char *format, TRIO_CONST struct tm *datetime)); 323 #endif 324 325 #if defined(TRIO_FUNC_HASH) 326 TRIO_PUBLIC_STRING unsigned long 327 trio_hash 328 TRIO_PROTO((TRIO_CONST char *string, int type)); 329 #endif 330 331 #if defined(TRIO_FUNC_INDEX) 332 TRIO_PUBLIC_STRING char * 333 trio_index 334 TRIO_PROTO((TRIO_CONST char *string, int character)); 335 #endif 336 337 #if defined(TRIO_FUNC_INDEX_LAST) 338 TRIO_PUBLIC_STRING char * 339 trio_index_last 340 TRIO_PROTO((TRIO_CONST char *string, int character)); 341 #endif 342 343 #if defined(TRIO_FUNC_LENGTH) 344 TRIO_PUBLIC_STRING size_t 345 trio_length 346 TRIO_PROTO((TRIO_CONST char *string)); 347 #endif 348 349 #if defined(TRIO_FUNC_LENGTH_MAX) 350 TRIO_PUBLIC_STRING size_t 351 trio_length_max 352 TRIO_PROTO((TRIO_CONST char *string, size_t max)); 353 #endif 354 355 #if defined(TRIO_FUNC_LOWER) 356 TRIO_PUBLIC_STRING int 357 trio_lower 358 TRIO_PROTO((char *target)); 359 #endif 360 361 #if defined(TRIO_FUNC_MATCH) 362 TRIO_PUBLIC_STRING int 363 trio_match 364 TRIO_PROTO((TRIO_CONST char *string, TRIO_CONST char *pattern)); 365 #endif 366 367 #if defined(TRIO_FUNC_MATCH_CASE) 368 TRIO_PUBLIC_STRING int 369 trio_match_case 370 TRIO_PROTO((TRIO_CONST char *string, TRIO_CONST char *pattern)); 371 #endif 372 373 #if defined(TRIO_FUNC_SPAN_FUNCTION) 374 TRIO_PUBLIC_STRING size_t 375 trio_span_function 376 TRIO_PROTO((char *target, TRIO_CONST char *source, int (*Function) TRIO_PROTO((int)))); 377 #endif 378 379 #if defined(TRIO_FUNC_SUBSTRING) 380 TRIO_PUBLIC_STRING char * 381 trio_substring 382 TRIO_PROTO((TRIO_CONST char *string, TRIO_CONST char *substring)); 383 #endif 384 385 #if defined(TRIO_FUNC_SUBSTRING_MAX) 386 TRIO_PUBLIC_STRING char * 387 trio_substring_max 388 TRIO_PROTO((TRIO_CONST char *string, size_t max, TRIO_CONST char *substring)); 389 #endif 390 391 #if defined(TRIO_FUNC_TO_DOUBLE) 392 TRIO_PUBLIC_STRING double 393 trio_to_double 394 TRIO_PROTO((TRIO_CONST char *source, char **endp)); 395 #endif 396 397 #if defined(TRIO_FUNC_TO_FLOAT) 398 TRIO_PUBLIC_STRING float 399 trio_to_float 400 TRIO_PROTO((TRIO_CONST char *source, char **endp)); 401 #endif 402 403 #if defined(TRIO_FUNC_TO_LONG) 404 TRIO_PUBLIC_STRING long 405 trio_to_long 406 TRIO_PROTO((TRIO_CONST char *source, char **endp, int base)); 407 #endif 408 409 #if defined(TRIO_FUNC_TO_LOWER) 410 TRIO_PUBLIC_STRING int 411 trio_to_lower 412 TRIO_PROTO((int source)); 413 #endif 414 415 #if defined(TRIO_FUNC_TO_LONG_DOUBLE) 416 TRIO_PUBLIC_STRING trio_long_double_t 417 trio_to_long_double 418 TRIO_PROTO((TRIO_CONST char *source, char **endp)); 419 #endif 420 421 #if defined(TRIO_FUNC_TO_UNSIGNED_LONG) 422 TRIO_PUBLIC_STRING unsigned long 423 trio_to_unsigned_long 424 TRIO_PROTO((TRIO_CONST char *source, char **endp, int base)); 425 #endif 426 427 #if defined(TRIO_FUNC_TO_UPPER) 428 TRIO_PUBLIC_STRING int 429 trio_to_upper 430 TRIO_PROTO((int source)); 431 #endif 432 433 #if defined(TRIO_FUNC_TOKENIZE) 434 TRIO_PUBLIC_STRING char * 435 trio_tokenize 436 TRIO_PROTO((char *string, TRIO_CONST char *delimiters)); 437 #endif 438 439 #if defined(TRIO_FUNC_UPPER) 440 TRIO_PUBLIC_STRING int 441 trio_upper 442 TRIO_PROTO((char *target)); 443 #endif 444 445 /************************************************************************* 446 * Dynamic string functions 447 */ 448 449 /* 450 * Opaque type for dynamic strings 451 */ 452 453 typedef struct _trio_string_t trio_string_t; 454 455 #if defined(TRIO_FUNC_STRING_APPEND) 456 TRIO_PUBLIC_STRING int 457 trio_string_append 458 TRIO_PROTO((trio_string_t *self, trio_string_t *other)); 459 #endif 460 461 #if defined(TRIO_FUNC_STRING_CONTAINS) 462 TRIO_PUBLIC_STRING int 463 trio_string_contains 464 TRIO_PROTO((trio_string_t *self, trio_string_t *other)); 465 #endif 466 467 #if defined(TRIO_FUNC_STRING_COPY) 468 TRIO_PUBLIC_STRING int 469 trio_string_copy 470 TRIO_PROTO((trio_string_t *self, trio_string_t *other)); 471 #endif 472 473 #if defined(TRIO_FUNC_STRING_CREATE) 474 TRIO_PUBLIC_STRING trio_string_t * 475 trio_string_create 476 TRIO_PROTO((int initial_size)); 477 #endif 478 479 #if defined(TRIO_FUNC_STRING_DESTROY) 480 TRIO_PUBLIC_STRING void 481 trio_string_destroy 482 TRIO_PROTO((trio_string_t *self)); 483 #endif 484 485 #if defined(TRIO_FUNC_STRING_DUPLICATE) 486 TRIO_PUBLIC_STRING trio_string_t * 487 trio_string_duplicate 488 TRIO_PROTO((trio_string_t *other)); 489 #endif 490 491 #if defined(TRIO_FUNC_STRING_EQUAL) 492 TRIO_PUBLIC_STRING int 493 trio_string_equal 494 TRIO_PROTO((trio_string_t *self, trio_string_t *other)); 495 #endif 496 497 #if defined(TRIO_FUNC_STRING_EQUAL_MAX) 498 TRIO_PUBLIC_STRING int 499 trio_string_equal_max 500 TRIO_PROTO((trio_string_t *self, size_t max, trio_string_t *second)); 501 #endif 502 503 #if defined(TRIO_FUNC_STRING_EQUAL_CASE) 504 TRIO_PUBLIC_STRING int 505 trio_string_equal_case 506 TRIO_PROTO((trio_string_t *self, trio_string_t *other)); 507 #endif 508 509 #if defined(TRIO_FUNC_STRING_EQUAL_CASE_MAX) 510 TRIO_PUBLIC_STRING int 511 trio_string_equal_case_max 512 TRIO_PROTO((trio_string_t *self, size_t max, trio_string_t *other)); 513 #endif 514 515 #if defined(TRIO_FUNC_STRING_EXTRACT) 516 TRIO_PUBLIC_STRING char * 517 trio_string_extract 518 TRIO_PROTO((trio_string_t *self)); 519 #endif 520 521 #if defined(TRIO_FUNC_STRING_FORMAT_DATE_MAX) 522 TRIO_PUBLIC_STRING size_t 523 trio_string_format_date_max 524 TRIO_PROTO((trio_string_t *self, size_t max, TRIO_CONST char *format, TRIO_CONST struct tm *datetime)); 525 #endif 526 527 #if defined(TRIO_FUNC_STRING_GET) 528 TRIO_PUBLIC_STRING char * 529 trio_string_get 530 TRIO_PROTO((trio_string_t *self, int offset)); 531 #endif 532 533 #if defined(TRIO_FUNC_STRING_INDEX) 534 TRIO_PUBLIC_STRING char * 535 trio_string_index 536 TRIO_PROTO((trio_string_t *self, int character)); 537 #endif 538 539 #if defined(TRIO_FUNC_STRING_INDEX_LAST) 540 TRIO_PUBLIC_STRING char * 541 trio_string_index_last 542 TRIO_PROTO((trio_string_t *self, int character)); 543 #endif 544 545 #if defined(TRIO_FUNC_STRING_LENGTH) 546 TRIO_PUBLIC_STRING int 547 trio_string_length 548 TRIO_PROTO((trio_string_t *self)); 549 #endif 550 551 #if defined(TRIO_FUNC_STRING_LOWER) 552 TRIO_PUBLIC_STRING int 553 trio_string_lower 554 TRIO_PROTO((trio_string_t *self)); 555 #endif 556 557 #if defined(TRIO_FUNC_STRING_MATCH) 558 TRIO_PUBLIC_STRING int 559 trio_string_match 560 TRIO_PROTO((trio_string_t *self, trio_string_t *other)); 561 #endif 562 563 #if defined(TRIO_FUNC_STRING_MATCH_CASE) 564 TRIO_PUBLIC_STRING int 565 trio_string_match_case 566 TRIO_PROTO((trio_string_t *self, trio_string_t *other)); 567 #endif 568 569 #if defined(TRIO_FUNC_STRING_SIZE) 570 TRIO_PUBLIC_STRING int 571 trio_string_size 572 TRIO_PROTO((trio_string_t *self)); 573 #endif 574 575 #if defined(TRIO_FUNC_STRING_SUBSTRING) 576 TRIO_PUBLIC_STRING char * 577 trio_string_substring 578 TRIO_PROTO((trio_string_t *self, trio_string_t *other)); 579 #endif 580 581 #if defined(TRIO_FUNC_STRING_TERMINATE) 582 TRIO_PUBLIC_STRING void 583 trio_string_terminate 584 TRIO_PROTO((trio_string_t *self)); 585 #endif 586 587 #if defined(TRIO_FUNC_STRING_UPPER) 588 TRIO_PUBLIC_STRING int 589 trio_string_upper 590 TRIO_PROTO((trio_string_t *self)); 591 #endif 592 593 #if defined(TRIO_FUNC_XSTRING_APPEND) 594 TRIO_PUBLIC_STRING int 595 trio_xstring_append 596 TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); 597 #endif 598 599 #if defined(TRIO_FUNC_XSTRING_APPEND_CHAR) 600 TRIO_PUBLIC_STRING int 601 trio_xstring_append_char 602 TRIO_PROTO((trio_string_t *self, char character)); 603 #endif 604 605 #if defined(TRIO_FUNC_XSTRING_APPEND_MAX) 606 TRIO_PUBLIC_STRING int 607 trio_xstring_append_max 608 TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other, size_t max)); 609 #endif 610 611 #if defined(TRIO_FUNC_XSTRING_CONTAINS) 612 TRIO_PUBLIC_STRING int 613 trio_xstring_contains 614 TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); 615 #endif 616 617 #if defined(TRIO_FUNC_XSTRING_COPY) 618 TRIO_PUBLIC_STRING int 619 trio_xstring_copy 620 TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); 621 #endif 622 623 #if defined(TRIO_FUNC_XSTRING_DUPLICATE) 624 TRIO_PUBLIC_STRING trio_string_t * 625 trio_xstring_duplicate 626 TRIO_PROTO((TRIO_CONST char *other)); 627 #endif 628 629 #if defined(TRIO_FUNC_XSTRING_EQUAL) 630 TRIO_PUBLIC_STRING int 631 trio_xstring_equal 632 TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); 633 #endif 634 635 #if defined(TRIO_FUNC_XSTRING_EQUAL_MAX) 636 TRIO_PUBLIC_STRING int 637 trio_xstring_equal_max 638 TRIO_PROTO((trio_string_t *self, size_t max, TRIO_CONST char *other)); 639 #endif 640 641 #if defined(TRIO_FUNC_XSTRING_EQUAL_CASE) 642 TRIO_PUBLIC_STRING int 643 trio_xstring_equal_case 644 TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); 645 #endif 646 647 #if defined(TRIO_FUNC_XSTRING_EQUAL_CASE_MAX) 648 TRIO_PUBLIC_STRING int 649 trio_xstring_equal_case_max 650 TRIO_PROTO((trio_string_t *self, size_t max, TRIO_CONST char *other)); 651 #endif 652 653 #if defined(TRIO_FUNC_XSTRING_MATCH) 654 TRIO_PUBLIC_STRING int 655 trio_xstring_match 656 TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); 657 #endif 658 659 #if defined(TRIO_FUNC_XSTRING_MATCH_CASE) 660 TRIO_PUBLIC_STRING int 661 trio_xstring_match_case 662 TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); 663 #endif 664 665 #if defined(TRIO_FUNC_XSTRING_SET) 666 TRIO_PUBLIC_STRING void 667 trio_xstring_set 668 TRIO_PROTO((trio_string_t *self, char *buffer)); 669 #endif 670 671 #if defined(TRIO_FUNC_XSTRING_SUBSTRING) 672 TRIO_PUBLIC_STRING char * 673 trio_xstring_substring 674 TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); 675 #endif 676 677 #ifdef __cplusplus 678 } 679 #endif 680 681 #endif /* TRIO_TRIOSTR_H */ 682