2
2
* Copyright (C) 2001-2010, Parrot Foundation.
4
* $Id: string_funcs.h 48842 2010-09-08 00:26:33Z nwellnhof $
6
4
* This is the api header for the string subsystem
7
5
* Data Structure and Algorithms:
66
64
PARROT_WARN_UNUSED_RESULT
67
65
PARROT_CAN_RETURN_NULL
68
STRING* Parrot_str_change_charset(PARROT_INTERP,
69
ARGMOD_NULLOK(STRING *src),
71
__attribute__nonnull__(1)
75
PARROT_WARN_UNUSED_RESULT
76
PARROT_CAN_RETURN_NULL
77
66
STRING* Parrot_str_change_encoding(PARROT_INTERP,
78
67
ARGMOD_NULLOK(STRING *src),
79
68
INTVAL encoding_nr)
87
76
__attribute__nonnull__(2);
79
PARROT_CANNOT_RETURN_NULL
80
PARROT_WARN_UNUSED_RESULT
81
STRING * Parrot_str_chr(PARROT_INTERP, UINTVAL character)
82
__attribute__nonnull__(1);
90
85
PARROT_WARN_UNUSED_RESULT
91
86
INTVAL Parrot_str_compare(PARROT_INTERP,
92
87
ARGIN_NULLOK(const STRING *s1),
157
152
PARROT_WARN_UNUSED_RESULT
158
153
INTVAL Parrot_str_find_index(PARROT_INTERP,
159
ARGIN(const STRING *s),
160
ARGIN(const STRING *s2),
154
ARGIN(const STRING *src),
155
ARGIN(const STRING *search),
162
157
__attribute__nonnull__(1)
163
158
__attribute__nonnull__(2)
200
195
__attribute__nonnull__(1);
198
void Parrot_str_gc_register(PARROT_INTERP, ARGIN(STRING *s))
199
__attribute__nonnull__(1)
200
__attribute__nonnull__(2);
203
void Parrot_str_gc_unregister(PARROT_INTERP, ARGIN(STRING *s))
204
__attribute__nonnull__(1)
205
__attribute__nonnull__(2);
203
208
PARROT_WARN_UNUSED_RESULT
204
INTVAL Parrot_str_indexed(PARROT_INTERP,
205
ARGIN(const STRING *s),
209
INTVAL Parrot_str_indexed(PARROT_INTERP, ARGIN(const STRING *s), INTVAL idx)
207
210
__attribute__nonnull__(1)
208
211
__attribute__nonnull__(2);
226
229
INTVAL Parrot_str_is_null(SHIM_INTERP, ARGIN_NULLOK(const STRING *s));
229
INTVAL Parrot_str_iter_index(PARROT_INTERP,
230
ARGIN(const STRING *src),
231
ARGMOD(String_iter *start),
232
ARGOUT(String_iter *end),
233
ARGIN(const STRING *search))
234
__attribute__nonnull__(1)
235
__attribute__nonnull__(2)
236
__attribute__nonnull__(3)
237
__attribute__nonnull__(4)
238
__attribute__nonnull__(5)
239
FUNC_MODIFIES(*start)
243
PARROT_CANNOT_RETURN_NULL
244
PARROT_WARN_UNUSED_RESULT
245
STRING * Parrot_str_iter_substr(PARROT_INTERP,
246
ARGIN(const STRING *str),
247
ARGIN(const String_iter *l),
248
ARGIN_NULLOK(const String_iter *r))
249
__attribute__nonnull__(1)
250
__attribute__nonnull__(2)
251
__attribute__nonnull__(3);
254
232
PARROT_WARN_UNUSED_RESULT
255
233
PARROT_CANNOT_RETURN_NULL
256
234
STRING* Parrot_str_join(PARROT_INTERP,
350
328
__attribute__nonnull__(5);
331
PARROT_CANNOT_RETURN_NULL
332
STRING * Parrot_str_reverse(PARROT_INTERP, ARGIN(const STRING *src))
333
__attribute__nonnull__(1)
334
__attribute__nonnull__(2);
353
337
PARROT_WARN_UNUSED_RESULT
354
338
PARROT_CAN_RETURN_NULL
355
339
PMC* Parrot_str_split(PARROT_INTERP,
382
366
PARROT_WARN_UNUSED_RESULT
383
size_t Parrot_str_to_hashval(PARROT_INTERP, ARGMOD_NULLOK(STRING *s))
367
size_t Parrot_str_to_hashval(PARROT_INTERP, ARGIN(const STRING *s))
384
368
__attribute__nonnull__(1)
369
__attribute__nonnull__(2);
388
372
PARROT_WARN_UNUSED_RESULT
436
420
PARROT_WARN_UNUSED_RESULT
437
421
PARROT_CANNOT_RETURN_NULL
438
STRING * string_increment(PARROT_INTERP, ARGIN(const STRING *s))
439
__attribute__nonnull__(1)
440
__attribute__nonnull__(2);
443
PARROT_WARN_UNUSED_RESULT
444
PARROT_CANNOT_RETURN_NULL
445
422
STRING * string_make(PARROT_INTERP,
446
423
ARGIN_NULLOK(const char *buffer),
453
430
PARROT_WARN_UNUSED_RESULT
455
INTVAL string_max_bytes(SHIM_INTERP, ARGIN(const STRING *s), UINTVAL nchars)
456
__attribute__nonnull__(2);
459
PARROT_WARN_UNUSED_RESULT
460
431
INTVAL string_ord(PARROT_INTERP, ARGIN(const STRING *s), INTVAL idx)
461
432
__attribute__nonnull__(1)
462
433
__attribute__nonnull__(2);
494
465
__attribute__nonnull__(2)
495
466
FUNC_MODIFIES(*tc);
468
INTVAL Parrot_str_iter_index(PARROT_INTERP,
469
ARGIN(const STRING *src),
470
ARGMOD(String_iter *start),
471
ARGOUT(String_iter *end),
472
ARGIN(const STRING *search))
473
__attribute__nonnull__(1)
474
__attribute__nonnull__(2)
475
__attribute__nonnull__(3)
476
__attribute__nonnull__(4)
477
__attribute__nonnull__(5)
478
FUNC_MODIFIES(*start)
481
PARROT_CANNOT_RETURN_NULL
482
PARROT_WARN_UNUSED_RESULT
483
STRING * Parrot_str_iter_substr(PARROT_INTERP,
484
ARGIN(const STRING *str),
485
ARGIN(const String_iter *l),
486
ARGIN_NULLOK(const String_iter *r))
487
__attribute__nonnull__(1)
488
__attribute__nonnull__(2)
489
__attribute__nonnull__(3);
497
491
#define ASSERT_ARGS_Parrot_str_bitwise_and __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
498
492
PARROT_ASSERT_ARG(interp))
499
493
#define ASSERT_ARGS_Parrot_str_bitwise_not __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
505
499
#define ASSERT_ARGS_Parrot_str_boolean __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
506
500
PARROT_ASSERT_ARG(interp))
507
501
#define ASSERT_ARGS_Parrot_str_byte_length __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
508
#define ASSERT_ARGS_Parrot_str_change_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
509
PARROT_ASSERT_ARG(interp))
510
502
#define ASSERT_ARGS_Parrot_str_change_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
511
503
PARROT_ASSERT_ARG(interp))
512
504
#define ASSERT_ARGS_Parrot_str_chopn __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
513
505
PARROT_ASSERT_ARG(interp) \
514
506
, PARROT_ASSERT_ARG(s))
507
#define ASSERT_ARGS_Parrot_str_chr __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
508
PARROT_ASSERT_ARG(interp))
515
509
#define ASSERT_ARGS_Parrot_str_compare __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
516
510
PARROT_ASSERT_ARG(interp))
517
511
#define ASSERT_ARGS_Parrot_str_compose __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
535
529
PARROT_ASSERT_ARG(interp))
536
530
#define ASSERT_ARGS_Parrot_str_find_index __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
537
531
PARROT_ASSERT_ARG(interp) \
538
, PARROT_ASSERT_ARG(s) \
539
, PARROT_ASSERT_ARG(s2))
532
, PARROT_ASSERT_ARG(src) \
533
, PARROT_ASSERT_ARG(search))
540
534
#define ASSERT_ARGS_Parrot_str_find_not_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
541
535
PARROT_ASSERT_ARG(interp))
542
536
#define ASSERT_ARGS_Parrot_str_finish __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
549
543
PARROT_ASSERT_ARG(interp))
550
544
#define ASSERT_ARGS_Parrot_str_from_num __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
551
545
PARROT_ASSERT_ARG(interp))
546
#define ASSERT_ARGS_Parrot_str_gc_register __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
547
PARROT_ASSERT_ARG(interp) \
548
, PARROT_ASSERT_ARG(s))
549
#define ASSERT_ARGS_Parrot_str_gc_unregister __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
550
PARROT_ASSERT_ARG(interp) \
551
, PARROT_ASSERT_ARG(s))
552
552
#define ASSERT_ARGS_Parrot_str_indexed __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
553
553
PARROT_ASSERT_ARG(interp) \
554
554
, PARROT_ASSERT_ARG(s))
558
558
PARROT_ASSERT_ARG(interp) \
559
559
, PARROT_ASSERT_ARG(s))
560
560
#define ASSERT_ARGS_Parrot_str_is_null __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
561
#define ASSERT_ARGS_Parrot_str_iter_index __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
562
PARROT_ASSERT_ARG(interp) \
563
, PARROT_ASSERT_ARG(src) \
564
, PARROT_ASSERT_ARG(start) \
565
, PARROT_ASSERT_ARG(end) \
566
, PARROT_ASSERT_ARG(search))
567
#define ASSERT_ARGS_Parrot_str_iter_substr __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
568
PARROT_ASSERT_ARG(interp) \
569
, PARROT_ASSERT_ARG(str) \
570
, PARROT_ASSERT_ARG(l))
571
561
#define ASSERT_ARGS_Parrot_str_join __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
572
562
PARROT_ASSERT_ARG(interp) \
573
563
, PARROT_ASSERT_ARG(ar))
600
590
PARROT_ASSERT_ARG(interp) \
601
591
, PARROT_ASSERT_ARG(src) \
602
592
, PARROT_ASSERT_ARG(rep))
593
#define ASSERT_ARGS_Parrot_str_reverse __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
594
PARROT_ASSERT_ARG(interp) \
595
, PARROT_ASSERT_ARG(src))
603
596
#define ASSERT_ARGS_Parrot_str_split __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
604
597
PARROT_ASSERT_ARG(interp))
605
598
#define ASSERT_ARGS_Parrot_str_substr __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
609
602
#define ASSERT_ARGS_Parrot_str_to_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
610
603
PARROT_ASSERT_ARG(interp))
611
604
#define ASSERT_ARGS_Parrot_str_to_hashval __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
612
PARROT_ASSERT_ARG(interp))
605
PARROT_ASSERT_ARG(interp) \
606
, PARROT_ASSERT_ARG(s))
613
607
#define ASSERT_ARGS_Parrot_str_to_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
614
608
PARROT_ASSERT_ARG(interp))
615
609
#define ASSERT_ARGS_Parrot_str_to_num __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
629
623
PARROT_ASSERT_ARG(interp))
630
624
#define ASSERT_ARGS_string_chr __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
631
625
PARROT_ASSERT_ARG(interp))
632
#define ASSERT_ARGS_string_increment __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
633
PARROT_ASSERT_ARG(interp) \
634
, PARROT_ASSERT_ARG(s))
635
626
#define ASSERT_ARGS_string_make __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
636
627
PARROT_ASSERT_ARG(interp))
637
#define ASSERT_ARGS_string_max_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
638
PARROT_ASSERT_ARG(s))
639
628
#define ASSERT_ARGS_string_ord __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
640
629
PARROT_ASSERT_ARG(interp) \
641
630
, PARROT_ASSERT_ARG(s))
649
638
#define ASSERT_ARGS_Parrot_str_from_uint __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
650
639
PARROT_ASSERT_ARG(interp) \
651
640
, PARROT_ASSERT_ARG(tc))
641
#define ASSERT_ARGS_Parrot_str_iter_index __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
642
PARROT_ASSERT_ARG(interp) \
643
, PARROT_ASSERT_ARG(src) \
644
, PARROT_ASSERT_ARG(start) \
645
, PARROT_ASSERT_ARG(end) \
646
, PARROT_ASSERT_ARG(search))
647
#define ASSERT_ARGS_Parrot_str_iter_substr __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
648
PARROT_ASSERT_ARG(interp) \
649
, PARROT_ASSERT_ARG(str) \
650
, PARROT_ASSERT_ARG(l))
652
651
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
653
652
/* HEADERIZER END: src/string/api.c */