1 /************************************************************************* 2 * 3 * $Id: triostr.h,v 1.15 2005/05/29 11:56:01 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 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 # define TRIO_FUNC_FORMAT_DATE_MAX 158 # define TRIO_FUNC_HASH 159 # define TRIO_FUNC_INDEX 160 # define TRIO_FUNC_INDEX_LAST 161 # define TRIO_FUNC_LENGTH 162 # define TRIO_FUNC_LOWER 163 # define TRIO_FUNC_MATCH 164 # define TRIO_FUNC_MATCH_CASE 165 # define TRIO_FUNC_SPAN_FUNCTION 166 # define TRIO_FUNC_SUBSTRING 167 # define TRIO_FUNC_SUBSTRING_MAX 168 # define TRIO_FUNC_TO_DOUBLE 169 # define TRIO_FUNC_TO_FLOAT 170 # define TRIO_FUNC_TO_LONG 171 # define TRIO_FUNC_TO_LONG_DOUBLE 172 # define TRIO_FUNC_TO_LOWER 173 # define TRIO_FUNC_TO_UNSIGNED_LONG 174 # define TRIO_FUNC_TO_UPPER 175 # define TRIO_FUNC_TOKENIZE 176 # define TRIO_FUNC_UPPER 177 178 # define TRIO_FUNC_STRING_APPEND 179 # define TRIO_FUNC_STRING_CONTAINS 180 # define TRIO_FUNC_STRING_COPY 181 # define TRIO_FUNC_STRING_CREATE 182 # define TRIO_FUNC_STRING_DESTROY 183 # define TRIO_FUNC_STRING_DUPLICATE 184 # define TRIO_FUNC_STRING_EQUAL 185 # define TRIO_FUNC_STRING_EQUAL_CASE 186 # define TRIO_FUNC_STRING_EQUAL_CASE_MAX 187 # define TRIO_FUNC_STRING_EQUAL_MAX 188 # define TRIO_FUNC_STRING_EXTRACT 189 # define TRIO_FUNC_STRING_FORMAT_DATE_MAX 190 # define TRIO_FUNC_STRING_GET 191 # define TRIO_FUNC_STRING_INDEX 192 # define TRIO_FUNC_STRING_INDEX_LAST 193 # define TRIO_FUNC_STRING_LENGTH 194 # define TRIO_FUNC_STRING_LOWER 195 # define TRIO_FUNC_STRING_MATCH 196 # define TRIO_FUNC_STRING_MATCH_CASE 197 # define TRIO_FUNC_STRING_SIZE 198 # define TRIO_FUNC_STRING_SUBSTRING 199 # define TRIO_FUNC_STRING_TERMINATE 200 # define TRIO_FUNC_STRING_UPPER 201 202 # define TRIO_FUNC_XSTRING_APPEND 203 # define TRIO_FUNC_XSTRING_APPEND_CHAR 204 # define TRIO_FUNC_XSTRING_CONTAINS 205 # define TRIO_FUNC_XSTRING_COPY 206 # define TRIO_FUNC_XSTRING_DUPLICATE 207 # define TRIO_FUNC_XSTRING_EQUAL 208 # define TRIO_FUNC_XSTRING_EQUAL_CASE 209 # define TRIO_FUNC_XSTRING_EQUAL_CASE_MAX 210 # define TRIO_FUNC_XSTRING_EQUAL_MAX 211 # define TRIO_FUNC_XSTRING_MATCH 212 # define TRIO_FUNC_XSTRING_MATCH_CASE 213 # define TRIO_FUNC_XSTRING_SET 214 # define TRIO_FUNC_XSTRING_SUBSTRING 215 216 #endif 217 218 219 /************************************************************************* 220 * String functions 221 */ 222 223 #if defined(TRIO_FUNC_APPEND) 224 TRIO_PUBLIC_STRING int 225 trio_append 226 TRIO_PROTO((char *target, TRIO_CONST char *source)); 227 #endif 228 229 #if defined(TRIO_FUNC_APPEND_MAX) 230 TRIO_PUBLIC_STRING int 231 trio_append_max 232 TRIO_PROTO((char *target, size_t max, TRIO_CONST char *source)); 233 #endif 234 235 #if defined(TRIO_FUNC_CONTAINS) 236 TRIO_PUBLIC_STRING int 237 trio_contains 238 TRIO_PROTO((TRIO_CONST char *string, TRIO_CONST char *substring)); 239 #endif 240 241 #if defined(TRIO_FUNC_COPY) 242 TRIO_PUBLIC_STRING int 243 trio_copy 244 TRIO_PROTO((char *target, TRIO_CONST char *source)); 245 #endif 246 247 #if defined(TRIO_FUNC_COPY_MAX) 248 TRIO_PUBLIC_STRING int 249 trio_copy_max 250 TRIO_PROTO((char *target, size_t max, TRIO_CONST char *source)); 251 #endif 252 253 #if defined(TRIO_FUNC_CREATE) 254 TRIO_PUBLIC_STRING char * 255 trio_create 256 TRIO_PROTO((size_t size)); 257 #endif 258 259 #if defined(TRIO_FUNC_DESTROY) 260 TRIO_PUBLIC_STRING void 261 trio_destroy 262 TRIO_PROTO((char *string)); 263 #endif 264 265 #if defined(TRIO_FUNC_DUPLICATE) 266 TRIO_PUBLIC_STRING char * 267 trio_duplicate 268 TRIO_PROTO((TRIO_CONST char *source)); 269 #endif 270 271 #if defined(TRIO_FUNC_DUPLICATE_MAX) 272 TRIO_PUBLIC_STRING char * 273 trio_duplicate_max 274 TRIO_PROTO((TRIO_CONST char *source, size_t max)); 275 #endif 276 277 #if defined(TRIO_FUNC_EQUAL) 278 TRIO_PUBLIC_STRING int 279 trio_equal 280 TRIO_PROTO((TRIO_CONST char *first, TRIO_CONST char *second)); 281 #endif 282 283 #if defined(TRIO_FUNC_EQUAL_CASE) 284 TRIO_PUBLIC_STRING int 285 trio_equal_case 286 TRIO_PROTO((TRIO_CONST char *first, TRIO_CONST char *second)); 287 #endif 288 289 #if defined(TRIO_FUNC_EQUAL_CASE_MAX) 290 TRIO_PUBLIC_STRING int 291 trio_equal_case_max 292 TRIO_PROTO((TRIO_CONST char *first, size_t max, TRIO_CONST char *second)); 293 #endif 294 295 #if defined(TRIO_FUNC_EQUAL_LOCALE) 296 TRIO_PUBLIC_STRING int 297 trio_equal_locale 298 TRIO_PROTO((TRIO_CONST char *first, TRIO_CONST char *second)); 299 #endif 300 301 #if defined(TRIO_FUNC_EQUAL_MAX) 302 TRIO_PUBLIC_STRING int 303 trio_equal_max 304 TRIO_PROTO((TRIO_CONST char *first, size_t max, TRIO_CONST char *second)); 305 #endif 306 307 #if defined(TRIO_FUNC_ERROR) 308 TRIO_PUBLIC_STRING TRIO_CONST char * 309 trio_error 310 TRIO_PROTO((int)); 311 #endif 312 313 #if defined(TRIO_FUNC_FORMAT_DATE_MAX) 314 TRIO_PUBLIC_STRING size_t 315 trio_format_date_max 316 TRIO_PROTO((char *target, size_t max, TRIO_CONST char *format, TRIO_CONST struct tm *datetime)); 317 #endif 318 319 #if defined(TRIO_FUNC_HASH) 320 TRIO_PUBLIC_STRING unsigned long 321 trio_hash 322 TRIO_PROTO((TRIO_CONST char *string, int type)); 323 #endif 324 325 #if defined(TRIO_FUNC_INDEX) 326 TRIO_PUBLIC_STRING char * 327 trio_index 328 TRIO_PROTO((TRIO_CONST char *string, int character)); 329 #endif 330 331 #if defined(TRIO_FUNC_INDEX_LAST) 332 TRIO_PUBLIC_STRING char * 333 trio_index_last 334 TRIO_PROTO((TRIO_CONST char *string, int character)); 335 #endif 336 337 #if defined(TRIO_FUNC_LENGTH) 338 TRIO_PUBLIC_STRING size_t 339 trio_length 340 TRIO_PROTO((TRIO_CONST char *string)); 341 #endif 342 343 #if defined(TRIO_FUNC_LOWER) 344 TRIO_PUBLIC_STRING int 345 trio_lower 346 TRIO_PROTO((char *target)); 347 #endif 348 349 #if defined(TRIO_FUNC_MATCH) 350 TRIO_PUBLIC_STRING int 351 trio_match 352 TRIO_PROTO((TRIO_CONST char *string, TRIO_CONST char *pattern)); 353 #endif 354 355 #if defined(TRIO_FUNC_MATCH_CASE) 356 TRIO_PUBLIC_STRING int 357 trio_match_case 358 TRIO_PROTO((TRIO_CONST char *string, TRIO_CONST char *pattern)); 359 #endif 360 361 #if defined(TRIO_FUNC_SPAN_FUNCTION) 362 TRIO_PUBLIC_STRING size_t 363 trio_span_function 364 TRIO_PROTO((char *target, TRIO_CONST char *source, int (*Function) TRIO_PROTO((int)))); 365 #endif 366 367 #if defined(TRIO_FUNC_SUBSTRING) 368 TRIO_PUBLIC_STRING char * 369 trio_substring 370 TRIO_PROTO((TRIO_CONST char *string, TRIO_CONST char *substring)); 371 #endif 372 373 #if defined(TRIO_FUNC_SUBSTRING_MAX) 374 TRIO_PUBLIC_STRING char * 375 trio_substring_max 376 TRIO_PROTO((TRIO_CONST char *string, size_t max, TRIO_CONST char *substring)); 377 #endif 378 379 #if defined(TRIO_FUNC_TO_DOUBLE) 380 TRIO_PUBLIC_STRING double 381 trio_to_double 382 TRIO_PROTO((TRIO_CONST char *source, char **endp)); 383 #endif 384 385 #if defined(TRIO_FUNC_TO_FLOAT) 386 TRIO_PUBLIC_STRING float 387 trio_to_float 388 TRIO_PROTO((TRIO_CONST char *source, char **endp)); 389 #endif 390 391 #if defined(TRIO_FUNC_TO_LONG) 392 TRIO_PUBLIC_STRING long 393 trio_to_long 394 TRIO_PROTO((TRIO_CONST char *source, char **endp, int base)); 395 #endif 396 397 #if defined(TRIO_FUNC_TO_LOWER) 398 TRIO_PUBLIC_STRING int 399 trio_to_lower 400 TRIO_PROTO((int source)); 401 #endif 402 403 #if defined(TRIO_FUNC_TO_LONG_DOUBLE) 404 TRIO_PUBLIC_STRING trio_long_double_t 405 trio_to_long_double 406 TRIO_PROTO((TRIO_CONST char *source, char **endp)); 407 #endif 408 409 #if defined(TRIO_FUNC_TO_UNSIGNED_LONG) 410 TRIO_PUBLIC_STRING unsigned long 411 trio_to_unsigned_long 412 TRIO_PROTO((TRIO_CONST char *source, char **endp, int base)); 413 #endif 414 415 #if defined(TRIO_FUNC_TO_UPPER) 416 TRIO_PUBLIC_STRING int 417 trio_to_upper 418 TRIO_PROTO((int source)); 419 #endif 420 421 #if defined(TRIO_FUNC_TOKENIZE) 422 TRIO_PUBLIC_STRING char * 423 trio_tokenize 424 TRIO_PROTO((char *string, TRIO_CONST char *delimiters)); 425 #endif 426 427 #if defined(TRIO_FUNC_UPPER) 428 TRIO_PUBLIC_STRING int 429 trio_upper 430 TRIO_PROTO((char *target)); 431 #endif 432 433 /************************************************************************* 434 * Dynamic string functions 435 */ 436 437 /* 438 * Opaque type for dynamic strings 439 */ 440 441 typedef struct _trio_string_t trio_string_t; 442 443 #if defined(TRIO_FUNC_STRING_APPEND) 444 TRIO_PUBLIC_STRING int 445 trio_string_append 446 TRIO_PROTO((trio_string_t *self, trio_string_t *other)); 447 #endif 448 449 #if defined(TRIO_FUNC_STRING_CONTAINS) 450 TRIO_PUBLIC_STRING int 451 trio_string_contains 452 TRIO_PROTO((trio_string_t *self, trio_string_t *other)); 453 #endif 454 455 #if defined(TRIO_FUNC_STRING_COPY) 456 TRIO_PUBLIC_STRING int 457 trio_string_copy 458 TRIO_PROTO((trio_string_t *self, trio_string_t *other)); 459 #endif 460 461 #if defined(TRIO_FUNC_STRING_CREATE) 462 TRIO_PUBLIC_STRING trio_string_t * 463 trio_string_create 464 TRIO_PROTO((int initial_size)); 465 #endif 466 467 #if defined(TRIO_FUNC_STRING_DESTROY) 468 TRIO_PUBLIC_STRING void 469 trio_string_destroy 470 TRIO_PROTO((trio_string_t *self)); 471 #endif 472 473 #if defined(TRIO_FUNC_STRING_DUPLICATE) 474 TRIO_PUBLIC_STRING trio_string_t * 475 trio_string_duplicate 476 TRIO_PROTO((trio_string_t *other)); 477 #endif 478 479 #if defined(TRIO_FUNC_STRING_EQUAL) 480 TRIO_PUBLIC_STRING int 481 trio_string_equal 482 TRIO_PROTO((trio_string_t *self, trio_string_t *other)); 483 #endif 484 485 #if defined(TRIO_FUNC_STRING_EQUAL_MAX) 486 TRIO_PUBLIC_STRING int 487 trio_string_equal_max 488 TRIO_PROTO((trio_string_t *self, size_t max, trio_string_t *second)); 489 #endif 490 491 #if defined(TRIO_FUNC_STRING_EQUAL_CASE) 492 TRIO_PUBLIC_STRING int 493 trio_string_equal_case 494 TRIO_PROTO((trio_string_t *self, trio_string_t *other)); 495 #endif 496 497 #if defined(TRIO_FUNC_STRING_EQUAL_CASE_MAX) 498 TRIO_PUBLIC_STRING int 499 trio_string_equal_case_max 500 TRIO_PROTO((trio_string_t *self, size_t max, trio_string_t *other)); 501 #endif 502 503 #if defined(TRIO_FUNC_STRING_EXTRACT) 504 TRIO_PUBLIC_STRING char * 505 trio_string_extract 506 TRIO_PROTO((trio_string_t *self)); 507 #endif 508 509 #if defined(TRIO_FUNC_STRING_FORMAT_DATE_MAX) 510 TRIO_PUBLIC_STRING size_t 511 trio_string_format_date_max 512 TRIO_PROTO((trio_string_t *self, size_t max, TRIO_CONST char *format, TRIO_CONST struct tm *datetime)); 513 #endif 514 515 #if defined(TRIO_FUNC_STRING_GET) 516 TRIO_PUBLIC_STRING char * 517 trio_string_get 518 TRIO_PROTO((trio_string_t *self, int offset)); 519 #endif 520 521 #if defined(TRIO_FUNC_STRING_INDEX) 522 TRIO_PUBLIC_STRING char * 523 trio_string_index 524 TRIO_PROTO((trio_string_t *self, int character)); 525 #endif 526 527 #if defined(TRIO_FUNC_STRING_INDEX_LAST) 528 TRIO_PUBLIC_STRING char * 529 trio_string_index_last 530 TRIO_PROTO((trio_string_t *self, int character)); 531 #endif 532 533 #if defined(TRIO_FUNC_STRING_LENGTH) 534 TRIO_PUBLIC_STRING int 535 trio_string_length 536 TRIO_PROTO((trio_string_t *self)); 537 #endif 538 539 #if defined(TRIO_FUNC_STRING_LOWER) 540 TRIO_PUBLIC_STRING int 541 trio_string_lower 542 TRIO_PROTO((trio_string_t *self)); 543 #endif 544 545 #if defined(TRIO_FUNC_STRING_MATCH) 546 TRIO_PUBLIC_STRING int 547 trio_string_match 548 TRIO_PROTO((trio_string_t *self, trio_string_t *other)); 549 #endif 550 551 #if defined(TRIO_FUNC_STRING_MATCH_CASE) 552 TRIO_PUBLIC_STRING int 553 trio_string_match_case 554 TRIO_PROTO((trio_string_t *self, trio_string_t *other)); 555 #endif 556 557 #if defined(TRIO_FUNC_STRING_SIZE) 558 TRIO_PUBLIC_STRING int 559 trio_string_size 560 TRIO_PROTO((trio_string_t *self)); 561 #endif 562 563 #if defined(TRIO_FUNC_STRING_SUBSTRING) 564 TRIO_PUBLIC_STRING char * 565 trio_string_substring 566 TRIO_PROTO((trio_string_t *self, trio_string_t *other)); 567 #endif 568 569 #if defined(TRIO_FUNC_STRING_TERMINATE) 570 TRIO_PUBLIC_STRING void 571 trio_string_terminate 572 TRIO_PROTO((trio_string_t *self)); 573 #endif 574 575 #if defined(TRIO_FUNC_STRING_UPPER) 576 TRIO_PUBLIC_STRING int 577 trio_string_upper 578 TRIO_PROTO((trio_string_t *self)); 579 #endif 580 581 #if defined(TRIO_FUNC_XSTRING_APPEND) 582 TRIO_PUBLIC_STRING int 583 trio_xstring_append 584 TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); 585 #endif 586 587 #if defined(TRIO_FUNC_XSTRING_APPEND_CHAR) 588 TRIO_PUBLIC_STRING int 589 trio_xstring_append_char 590 TRIO_PROTO((trio_string_t *self, char character)); 591 #endif 592 593 #if defined(TRIO_FUNC_XSTRING_CONTAINS) 594 TRIO_PUBLIC_STRING int 595 trio_xstring_contains 596 TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); 597 #endif 598 599 #if defined(TRIO_FUNC_XSTRING_COPY) 600 TRIO_PUBLIC_STRING int 601 trio_xstring_copy 602 TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); 603 #endif 604 605 #if defined(TRIO_FUNC_XSTRING_DUPLICATE) 606 TRIO_PUBLIC_STRING trio_string_t * 607 trio_xstring_duplicate 608 TRIO_PROTO((TRIO_CONST char *other)); 609 #endif 610 611 #if defined(TRIO_FUNC_XSTRING_EQUAL) 612 TRIO_PUBLIC_STRING int 613 trio_xstring_equal 614 TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); 615 #endif 616 617 #if defined(TRIO_FUNC_XSTRING_EQUAL_MAX) 618 TRIO_PUBLIC_STRING int 619 trio_xstring_equal_max 620 TRIO_PROTO((trio_string_t *self, size_t max, TRIO_CONST char *other)); 621 #endif 622 623 #if defined(TRIO_FUNC_XSTRING_EQUAL_CASE) 624 TRIO_PUBLIC_STRING int 625 trio_xstring_equal_case 626 TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); 627 #endif 628 629 #if defined(TRIO_FUNC_XSTRING_EQUAL_CASE_MAX) 630 TRIO_PUBLIC_STRING int 631 trio_xstring_equal_case_max 632 TRIO_PROTO((trio_string_t *self, size_t max, TRIO_CONST char *other)); 633 #endif 634 635 #if defined(TRIO_FUNC_XSTRING_MATCH) 636 TRIO_PUBLIC_STRING int 637 trio_xstring_match 638 TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); 639 #endif 640 641 #if defined(TRIO_FUNC_XSTRING_MATCH_CASE) 642 TRIO_PUBLIC_STRING int 643 trio_xstring_match_case 644 TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); 645 #endif 646 647 #if defined(TRIO_FUNC_XSTRING_SET) 648 TRIO_PUBLIC_STRING void 649 trio_xstring_set 650 TRIO_PROTO((trio_string_t *self, char *buffer)); 651 #endif 652 653 #if defined(TRIO_FUNC_XSTRING_SUBSTRING) 654 TRIO_PUBLIC_STRING char * 655 trio_xstring_substring 656 TRIO_PROTO((trio_string_t *self, TRIO_CONST char *other)); 657 #endif 658 659 #ifdef __cplusplus 660 } 661 #endif 662 663 #endif /* TRIO_TRIOSTR_H */ 664