-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunc.h
3407 lines (3154 loc) · 139 KB
/
func.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
// This file is built by update-headers from data in embed.fnc.
// Any changes made here will be lost!
//
// Edit update-headers and run it to effect changes.
#ifdef av_clear
/// Frees the all the elements of an array, leaving it empty.
/// The XS equivalent of @c @@array @c = @c (). See also av_undef.
///
/// Note that it is possible that the actions of a destructor called directly
/// or indirectly by freeing an element of the array could cause the reference
/// count of the array itself to be reduced (e.g. by deleting an entry in the
/// symbol table). So it is a possibility that the AV could have been freed
/// (or even reallocated) on return from the call unless you hold a reference
/// to it.
SWIFT_NAME(PerlInterpreter.av_clear(self:_:))
PERL_STATIC_INLINE void CPerl_av_clear(pTHX_ AV *_Nonnull av) {
av_clear(av);
}
#endif
#ifdef av_delete
/// Deletes the element indexed by @c key from the array, makes the element
/// mortal, and returns it. If @c flags equals @c G_DISCARD, the element is
/// freed and NULL is returned. NULL is also returned if @c key is out of
/// range.
///
/// Perl equivalent: @c splice(@@myarray, @c $key, @c 1, @c undef) (with the
/// @c splice in void context if @c G_DISCARD is present).
SWIFT_NAME(PerlInterpreter.av_delete(self:_:_:_:))
PERL_STATIC_INLINE SV *_Nullable CPerl_av_delete(pTHX_ AV *_Nonnull av, SSize_t key, I32 flags) {
return av_delete(av, key, flags);
}
#endif
#ifdef av_exists
/// Returns true if the element indexed by @c key has been initialized.
///
/// This relies on the fact that uninitialized array elements are set to
/// @c NULL.
///
/// Perl equivalent: @c exists($myarray[$key]).
SWIFT_NAME(PerlInterpreter.av_exists(self:_:_:))
PERL_STATIC_INLINE bool CPerl_av_exists(pTHX_ AV *_Nonnull av, SSize_t key) {
return av_exists(av, key);
}
#endif
#ifdef av_extend
/// Pre-extend an array. The @c key is the index to which the array should be
/// extended.
SWIFT_NAME(PerlInterpreter.av_extend(self:_:_:))
PERL_STATIC_INLINE void CPerl_av_extend(pTHX_ AV *_Nonnull av, SSize_t key) {
av_extend(av, key);
}
#endif
#ifdef av_fetch
/// Returns the SV at the specified index in the array. The @c key is the
/// index. If lval is true, you are guaranteed to get a real SV back (in case
/// it wasn't real before), which you can then modify. Check that the return
/// value is non-null before dereferencing it to a @c SV*.
///
/// See "Understanding the Magic of Tied Hashes and Arrays" in perlguts for
/// more information on how to use this function on tied arrays.
///
/// The rough perl equivalent is @c $myarray[$key].
SWIFT_NAME(PerlInterpreter.av_fetch(self:_:_:_:))
PERL_STATIC_INLINE SV *_Nullable *_Nullable CPerl_av_fetch(pTHX_ AV *_Nonnull av, SSize_t key, bool lval) {
return av_fetch(av, key, lval);
}
#endif
#ifdef av_fill
/// Set the highest index in the array to the given number, equivalent to
/// Perl's @c $#array @c = @c $fill;.
///
/// The number of elements in the array will be @c fill @c + @c 1 after
/// @c av_fill() returns. If the array was previously shorter, then the
/// additional elements appended are set to NULL. If the array
/// was longer, then the excess elements are freed. @c av_fill(av, @c -1) is
/// the same as @c av_clear(av).
SWIFT_NAME(PerlInterpreter.av_fill(self:_:_:))
PERL_STATIC_INLINE void CPerl_av_fill(pTHX_ AV *_Nonnull av, SSize_t fill) {
av_fill(av, fill);
}
#endif
#ifdef av_len
/// Same as av_top_index. Note that, unlike what the name implies, it returns
/// the highest index in the array, so to get the size of the array you need to use
/// @c av_len(av) @c + @c 1. This is unlike sv_len, which returns what you would
/// expect.
SWIFT_NAME(PerlInterpreter.av_len(self:_:))
PERL_STATIC_INLINE SSize_t CPerl_av_len(pTHX_ AV *_Nonnull av) {
return av_len(av);
}
#endif
#ifdef av_make
/// Creates a new AV and populates it with a list of SVs. The SVs are copied
/// into the array, so they may be freed after the call to @c av_make. The new AV
/// will have a reference count of 1.
///
/// Perl equivalent: @c my @c @@new_array @c = @c ($scalar1, @c $scalar2, @c $scalar3...);
SWIFT_NAME(PerlInterpreter.av_make(self:_:_:))
PERL_STATIC_INLINE AV *_Nonnull CPerl_av_make(pTHX_ SSize_t size, SV *_Nonnull *_Nonnull strp) {
return av_make(size, strp);
}
#endif
#ifdef av_pop
/// Removes one SV from the end of the array, reducing its size by one and
/// returning the SV (transferring control of one reference count) to the
/// caller. Returns @c &PL_sv_undef if the array is empty.
///
/// Perl equivalent: @c pop(@@myarray);
SWIFT_NAME(PerlInterpreter.av_pop(self:_:))
PERL_STATIC_INLINE SV *_Nonnull CPerl_av_pop(pTHX_ AV *_Nonnull av) {
return av_pop(av);
}
#endif
#ifdef av_push
/// Pushes an SV (transferring control of one reference count) onto the end of the
/// array. The array will grow automatically to accommodate the addition.
///
/// Perl equivalent: @c push @c @@myarray, @c $val;.
SWIFT_NAME(PerlInterpreter.av_push(self:_:_:))
PERL_STATIC_INLINE void CPerl_av_push(pTHX_ AV *_Nonnull av, SV *_Nonnull val) {
av_push(av, val);
}
#endif
#ifdef av_shift
/// Removes one SV from the start of the array, reducing its size by one and
/// returning the SV (transferring control of one reference count) to the
/// caller. Returns @c &PL_sv_undef if the array is empty.
///
/// Perl equivalent: @c shift(@@myarray);
SWIFT_NAME(PerlInterpreter.av_shift(self:_:))
PERL_STATIC_INLINE SV *_Nonnull CPerl_av_shift(pTHX_ AV *_Nonnull av) {
return av_shift(av);
}
#endif
#ifdef av_store
/// Stores an SV in an array. The array index is specified as @c key. The
/// return value will be @c NULL if the operation failed or if the value did not
/// need to be actually stored within the array (as in the case of tied
/// arrays). Otherwise, it can be dereferenced
/// to get the @c SV* that was stored
/// there (= @c val)).
///
/// Note that the caller is responsible for suitably incrementing the reference
/// count of @c val before the call, and decrementing it if the function
/// returned @c NULL.
///
/// Approximate Perl equivalent: @c splice(@@myarray, @c $key, @c 1, @c $val).
///
/// See "Understanding the Magic of Tied Hashes and Arrays" in perlguts for
/// more information on how to use this function on tied arrays.
SWIFT_NAME(PerlInterpreter.av_store(self:_:_:_:))
PERL_STATIC_INLINE SV *_Nullable *_Nullable CPerl_av_store(pTHX_ AV *_Nonnull av, SSize_t key, SV *_Nullable val) {
return av_store(av, key, val);
}
#endif
#ifdef av_tindex
/// Same as @c av_top_index().
SWIFT_NAME(PerlInterpreter.av_tindex(self:_:))
PERL_STATIC_INLINE SSize_t CPerl_av_tindex(pTHX_ AV *_Nonnull av) {
return av_tindex(av);
}
#endif
#ifdef av_top_index
/// Returns the highest index in the array. The number of elements in the
/// array is @c av_top_index(av) @c + @c 1. Returns -1 if the array is empty.
///
/// The Perl equivalent for this is @c $#myarray.
///
/// (A slightly shorter form is @c av_tindex.)
SWIFT_NAME(PerlInterpreter.av_top_index(self:_:))
PERL_STATIC_INLINE SSize_t CPerl_av_top_index(pTHX_ AV *_Nonnull av) {
return av_top_index(av);
}
#endif
#ifdef av_undef
/// Undefines the array. The XS equivalent of @c undef(@@array).
///
/// As well as freeing all the elements of the array (like @c av_clear()), this
/// also frees the memory used by the av to store its list of scalars.
///
/// See av_clear for a note about the array possibly being invalid on
/// return.
SWIFT_NAME(PerlInterpreter.av_undef(self:_:))
PERL_STATIC_INLINE void CPerl_av_undef(pTHX_ AV *_Nonnull av) {
av_undef(av);
}
#endif
#ifdef av_unshift
/// Unshift the given number of @c undef values onto the beginning of the
/// array. The array will grow automatically to accommodate the addition.
///
/// Perl equivalent: @c unshift @c @@myarray, @c ((undef) @c x @c $num);
SWIFT_NAME(PerlInterpreter.av_unshift(self:_:_:))
PERL_STATIC_INLINE void CPerl_av_unshift(pTHX_ AV *_Nonnull av, SSize_t num) {
av_unshift(av, num);
}
#endif
#ifdef block_start
/// Handles compile-time scope entry.
/// Arranges for hints to be restored on block
/// exit and also handles pad sequence numbers to make lexical variables scope
/// right. Returns a savestack index for use with @c block_end.
SWIFT_NAME(PerlInterpreter.block_start(self:_:))
PERL_STATIC_INLINE int CPerl_block_start(pTHX_ int full) {
return block_start(full);
}
#endif
#ifdef bytes_cmp_utf8
/// Compares the sequence of characters (stored as octets) in @c b, @c blen with the
/// sequence of characters (stored as UTF-8)
/// in @c u, @c ulen. Returns 0 if they are
/// equal, -1 or -2 if the first string is less than the second string, +1 or +2
/// if the first string is greater than the second string.
///
/// -1 or +1 is returned if the shorter string was identical to the start of the
/// longer string. -2 or +2 is returned if
/// there was a difference between characters
/// within the strings.
SWIFT_NAME(PerlInterpreter.bytes_cmp_utf8(self:_:_:_:_:))
PERL_STATIC_INLINE int CPerl_bytes_cmp_utf8(pTHX_ const U8 *_Nonnull b, STRLEN blen, const U8 *_Nonnull u, STRLEN ulen) {
return bytes_cmp_utf8(b, blen, u, ulen);
}
#endif
#ifdef call_argv
/// Performs a callback to the specified named and package-scoped Perl subroutine
/// with @c argv (a @c NULL-terminated array of strings) as arguments. See
/// perlcall.
///
/// Approximate Perl equivalent: @c &{"$sub_name"}(@@$argv).
SWIFT_NAME(PerlInterpreter.call_argv(self:_:_:_:))
PERL_STATIC_INLINE I32 CPerl_call_argv(pTHX_ const char* _Nonnull sub_name, I32 flags, char*_Nonnull * _Nonnull argv) {
return call_argv(sub_name, flags, argv);
}
#endif
#ifdef call_method
/// Performs a callback to the specified Perl method. The blessed object must
/// be on the stack. See perlcall.
SWIFT_NAME(PerlInterpreter.call_method(self:_:_:))
PERL_STATIC_INLINE I32 CPerl_call_method(pTHX_ const char* _Nonnull methname, I32 flags) {
return call_method(methname, flags);
}
#endif
#ifdef call_pv
/// Performs a callback to the specified Perl sub. See perlcall.
SWIFT_NAME(PerlInterpreter.call_pv(self:_:_:))
PERL_STATIC_INLINE I32 CPerl_call_pv(pTHX_ const char* _Nonnull sub_name, I32 flags) {
return call_pv(sub_name, flags);
}
#endif
#ifdef call_sv
/// Performs a callback to the Perl sub specified by the SV.
///
/// If neither the @c G_METHOD nor @c G_METHOD_NAMED flag is supplied, the
/// SV may be any of a CV, a GV, a reference to a CV, a reference to a GV
/// or @c SvPV(sv) will be used as the name of the sub to call.
///
/// If the @c G_METHOD flag is supplied, the SV may be a reference to a CV or
/// @c SvPV(sv) will be used as the name of the method to call.
///
/// If the @c G_METHOD_NAMED flag is supplied, @c SvPV(sv) will be used as
/// the name of the method to call.
///
/// Some other values are treated specially for internal use and should
/// not be depended on.
///
/// See perlcall.
SWIFT_NAME(PerlInterpreter.call_sv(self:_:_:))
PERL_STATIC_INLINE I32 CPerl_call_sv(pTHX_ SV* _Nonnull sv, VOL I32 flags) {
return call_sv(sv, flags);
}
#endif
#ifdef croak_no_modify
/// Exactly equivalent to @c Perl_croak(aTHX_ @c "%s", @c PL_no_modify), but generates
/// terser object code than using @c Perl_croak. Less code used on exception code
/// paths reduces CPU cache pressure.
SWIFT_NAME(PerlInterpreter.croak_no_modify(self:))
PERL_STATIC_INLINE void CPerl_croak_no_modify(pTHX) {
croak_no_modify();
}
#endif
#ifdef croak_xs_usage
/// A specialised variant of @c croak() for emitting the usage message for xsubs
///
/// @code
/// croak_xs_usage(cv, "eee_yow");
/// @endcode
///
/// works out the package name and subroutine name from @c cv, and then calls
/// @c croak(). Hence if @c cv is @c &ouch::awk, it would call @c croak as:
///
/// @code
/// Perl_croak(aTHX_ "Usage: %" SVf "::%" SVf "(%s)", "ouch" "awk",
/// "eee_yow");
/// @endcode
SWIFT_NAME(PerlInterpreter.croak_xs_usage(self:_:_:))
PERL_STATIC_INLINE void CPerl_croak_xs_usage(pTHX_ const CV *_Nonnull const cv, const char *_Nonnull const params) {
croak_xs_usage(cv, params);
}
#endif
#ifdef cv_name
/// Returns an SV containing the name of the CV, mainly for use in error
/// reporting. The CV may actually be a GV instead, in which case the returned
/// SV holds the GV's name. Anything other than a GV or CV is treated as a
/// string already holding the sub name, but this could change in the future.
///
/// An SV may be passed as a second argument. If so, the name will be assigned
/// to it and it will be returned. Otherwise the returned SV will be a new
/// mortal.
///
/// If @c flags has the @c CV_NAME_NOTQUAL bit set, then the package name will not be
/// included. If the first argument is neither a CV nor a GV, this flag is
/// ignored (subject to change).
SWIFT_NAME(PerlInterpreter.cv_name(self:_:_:_:))
PERL_STATIC_INLINE SV *_Nonnull CPerl_cv_name(pTHX_ CV *_Nonnull cv, SV *_Nullable sv, U32 flags) {
return cv_name(cv, sv, flags);
}
#endif
#ifdef cv_undef
/// Clear out all the active components of a CV. This can happen either
/// by an explicit @c undef @c &foo, or by the reference count going to zero.
/// In the former case, we keep the @c CvOUTSIDE pointer, so that any anonymous
/// children can still follow the full lexical scope chain.
SWIFT_NAME(PerlInterpreter.cv_undef(self:_:))
PERL_STATIC_INLINE void CPerl_cv_undef(pTHX_ CV* _Nonnull cv) {
cv_undef(cv);
}
#endif
#ifdef eval_sv
/// Tells Perl to @c eval the string in the SV. It supports the same flags
/// as @c call_sv, with the obvious exception of @c G_EVAL. See perlcall.
SWIFT_NAME(PerlInterpreter.eval_sv(self:_:_:))
PERL_STATIC_INLINE I32 CPerl_eval_sv(pTHX_ SV* _Nonnull sv, I32 flags) {
return eval_sv(sv, flags);
}
#endif
#ifdef fbm_compile
/// Analyses the string in order to make fast searches on it using @c fbm_instr()
/// -- the Boyer-Moore algorithm.
SWIFT_NAME(PerlInterpreter.fbm_compile(self:_:_:))
PERL_STATIC_INLINE void CPerl_fbm_compile(pTHX_ SV* _Nonnull sv, U32 flags) {
fbm_compile(sv, flags);
}
#endif
#ifdef foldEQ_utf8
/// Returns true if the leading portions of the strings @c s1 and @c s2 (either or both
/// of which may be in UTF-8) are the same case-insensitively; false otherwise.
/// How far into the strings to compare is determined by other input parameters.
///
/// If @c u1 is true, the string @c s1 is assumed to be in UTF-8-encoded Unicode;
/// otherwise it is assumed to be in native 8-bit encoding. Correspondingly for @c u2
/// with respect to @c s2.
///
/// If the byte length @c l1 is non-zero, it says how far into @c s1 to check for fold
/// equality. In other words, @c s1+@c l1 will be used as a goal to reach. The
/// scan will not be considered to be a match unless the goal is reached, and
/// scanning won't continue past that goal. Correspondingly for @c l2 with respect to
/// @c s2.
///
/// If @c pe1 is non-@c NULL and the pointer it points to is not @c NULL, that pointer is
/// considered an end pointer to the position 1 byte past the maximum point
/// in @c s1 beyond which scanning will not continue under any circumstances.
/// (This routine assumes that UTF-8 encoded input strings are not malformed;
/// malformed input can cause it to read past @c pe1).
/// This means that if both @c l1 and @c pe1 are specified, and @c pe1
/// is less than @c s1+@c l1, the match will never be successful because it can
/// never
/// get as far as its goal (and in fact is asserted against). Correspondingly for
/// @c pe2 with respect to @c s2.
///
/// At least one of @c s1 and @c s2 must have a goal (at least one of @c l1 and
/// @c l2 must be non-zero), and if both do, both have to be
/// reached for a successful match. Also, if the fold of a character is multiple
/// characters, all of them must be matched (see tr21 reference below for
/// 'folding').
///
/// Upon a successful match, if @c pe1 is non-@c NULL,
/// it will be set to point to the beginning of the @i next character of @c s1
/// beyond what was matched. Correspondingly for @c pe2 and @c s2.
///
/// For case-insensitiveness, the "casefolding" of Unicode is used
/// instead of upper/lowercasing both the characters, see
/// /www.unicode.org/unicode/reports/tr21/ in http: (Case Mappings).
SWIFT_NAME(PerlInterpreter.foldEQ_utf8(self:_:_:_:_:_:_:_:_:))
PERL_STATIC_INLINE I32 CPerl_foldEQ_utf8(pTHX_ const char *_Nonnull s1, char *_Nullable *_Nullable pe1, UV l1, bool u1, const char *_Nonnull s2, char *_Nullable *_Nullable pe2, UV l2, bool u2) {
return foldEQ_utf8(s1, pe1, l1, u1, s2, pe2, l2, u2);
}
#endif
#ifdef get_av
/// Returns the AV of the specified Perl global or package array with the given
/// name (so it won't work on lexical variables). @c flags are passed
/// to @c gv_fetchpv. If @c GV_ADD is set and the
/// Perl variable does not exist then it will be created. If @c flags is zero
/// and the variable does not exist then NULL is returned.
///
/// Perl equivalent: @c @@{"$name"}.
SWIFT_NAME(PerlInterpreter.get_av(self:_:_:))
PERL_STATIC_INLINE AV *_Nullable CPerl_get_av(pTHX_ const char *_Nonnull name, I32 flags) {
return get_av(name, flags);
}
#endif
#ifdef get_cv
/// Uses @c strlen to get the length of @c name, then calls @c get_cvn_flags.
SWIFT_NAME(PerlInterpreter.get_cv(self:_:_:))
PERL_STATIC_INLINE CV *_Nullable CPerl_get_cv(pTHX_ const char* _Nonnull name, I32 flags) {
return get_cv(name, flags);
}
#endif
#ifdef get_hv
/// Returns the HV of the specified Perl hash. @c flags are passed to
/// @c gv_fetchpv. If @c GV_ADD is set and the
/// Perl variable does not exist then it will be created. If @c flags is zero
/// and the variable does not exist then @c NULL is returned.
SWIFT_NAME(PerlInterpreter.get_hv(self:_:_:))
PERL_STATIC_INLINE HV *_Nullable CPerl_get_hv(pTHX_ const char *_Nonnull name, I32 flags) {
return get_hv(name, flags);
}
#endif
#ifdef get_sv
/// Returns the SV of the specified Perl scalar. @c flags are passed to
/// @c gv_fetchpv. If @c GV_ADD is set and the
/// Perl variable does not exist then it will be created. If @c flags is zero
/// and the variable does not exist then NULL is returned.
SWIFT_NAME(PerlInterpreter.get_sv(self:_:_:))
PERL_STATIC_INLINE SV *_Nullable CPerl_get_sv(pTHX_ const char *_Nonnull name, I32 flags) {
return get_sv(name, flags);
}
#endif
#ifdef getcwd_sv
/// Fill @c sv with current working directory
SWIFT_NAME(PerlInterpreter.getcwd_sv(self:_:))
PERL_STATIC_INLINE int CPerl_getcwd_sv(pTHX_ SV* _Nonnull sv) {
return getcwd_sv(sv);
}
#endif
#ifdef grok_bin
/// converts a string representing a binary number to numeric form.
///
/// On entry @c start and @c *len give the string to scan, @c *flags gives
/// conversion flags, and @c result should be @c NULL or a pointer to an NV.
/// The scan stops at the end of the string, or the first invalid character.
/// Unless @c PERL_SCAN_SILENT_ILLDIGIT is set in @c *flags, encountering an
/// invalid character will also trigger a warning.
/// On return @c *len is set to the length of the scanned string,
/// and @c *flags gives output flags.
///
/// If the value is <= @c UV_MAX it is returned as a UV, the output flags are clear,
/// and nothing is written to @c *result. If the value is > @c UV_MAX, @c grok_bin
/// returns @c UV_MAX, sets @c PERL_SCAN_GREATER_THAN_UV_MAX in the output flags,
/// and writes the value to @c *result (or the value is discarded if @c result
/// is NULL).
///
/// The binary number may optionally be prefixed with @c "0b" or @c "b" unless
/// @c PERL_SCAN_DISALLOW_PREFIX is set in @c *flags on entry. If
/// @c PERL_SCAN_ALLOW_UNDERSCORES is set in @c *flags then the binary
/// number may use @c "_" characters to separate digits.
SWIFT_NAME(PerlInterpreter.grok_bin(self:_:_:_:_:))
PERL_STATIC_INLINE UV CPerl_grok_bin(pTHX_ const char* _Nonnull start, STRLEN* _Nonnull len_p, I32* _Nonnull flags, NV *_Nullable result) {
return grok_bin(start, len_p, flags, result);
}
#endif
#ifdef grok_hex
/// converts a string representing a hex number to numeric form.
///
/// On entry @c start and @c *len_p give the string to scan, @c *flags gives
/// conversion flags, and @c result should be @c NULL or a pointer to an NV.
/// The scan stops at the end of the string, or the first invalid character.
/// Unless @c PERL_SCAN_SILENT_ILLDIGIT is set in @c *flags, encountering an
/// invalid character will also trigger a warning.
/// On return @c *len is set to the length of the scanned string,
/// and @c *flags gives output flags.
///
/// If the value is <= @c UV_MAX it is returned as a UV, the output flags are clear,
/// and nothing is written to @c *result. If the value is > @c UV_MAX, @c grok_hex
/// returns @c UV_MAX, sets @c PERL_SCAN_GREATER_THAN_UV_MAX in the output flags,
/// and writes the value to @c *result (or the value is discarded if @c result
/// is @c NULL).
///
/// The hex number may optionally be prefixed with @c "0x" or @c "x" unless
/// @c PERL_SCAN_DISALLOW_PREFIX is set in @c *flags on entry. If
/// @c PERL_SCAN_ALLOW_UNDERSCORES is set in @c *flags then the hex
/// number may use @c "_" characters to separate digits.
SWIFT_NAME(PerlInterpreter.grok_hex(self:_:_:_:_:))
PERL_STATIC_INLINE UV CPerl_grok_hex(pTHX_ const char* _Nonnull start, STRLEN* _Nonnull len_p, I32* _Nonnull flags, NV *_Nullable result) {
return grok_hex(start, len_p, flags, result);
}
#endif
#ifdef grok_infnan
/// Helper for @c grok_number(), accepts various ways of spelling "infinity"
/// or "not a number", and returns one of the following flag combinations:
///
/// @code
/// IS_NUMBER_INFINITE
/// IS_NUMBER_NAN
/// IS_NUMBER_INFINITE | IS_NUMBER_NEG
/// IS_NUMBER_NAN | IS_NUMBER_NEG
/// 0
/// @endcode
///
/// possibly |-ed with @c IS_NUMBER_TRAILING.
///
/// If an infinity or a not-a-number is recognized, @c *sp will point to
/// one byte past the end of the recognized string. If the recognition fails,
/// zero is returned, and @c *sp will not move.
SWIFT_NAME(PerlInterpreter.grok_infnan(self:_:_:))
PERL_STATIC_INLINE int CPerl_grok_infnan(pTHX_ const char*_Nonnull * _Nonnull sp, const char *_Nonnull send) {
return grok_infnan(sp, send);
}
#endif
#ifdef grok_number
/// Identical to @c grok_number_flags() with @c flags set to zero.
SWIFT_NAME(PerlInterpreter.grok_number(self:_:_:_:))
PERL_STATIC_INLINE int CPerl_grok_number(pTHX_ const char *_Nonnull pv, STRLEN len, UV *_Nullable valuep) {
return grok_number(pv, len, valuep);
}
#endif
#ifdef grok_number_flags
/// Recognise (or not) a number. The type of the number is returned
/// (0 if unrecognised), otherwise it is a bit-ORed combination of
/// @c IS_NUMBER_IN_UV, @c IS_NUMBER_GREATER_THAN_UV_MAX, @c IS_NUMBER_NOT_INT,
/// @c IS_NUMBER_NEG, @c IS_NUMBER_INFINITY, @c IS_NUMBER_NAN (defined in perl.h).
///
/// If the value of the number can fit in a UV, it is returned in @c *valuep.
/// @c IS_NUMBER_IN_UV will be set to indicate that @c *valuep is valid, @c IS_NUMBER_IN_UV
/// will never be set unless @c *valuep is valid, but @c *valuep may have been assigned
/// to during processing even though @c IS_NUMBER_IN_UV is not set on return.
/// If @c valuep is @c NULL, @c IS_NUMBER_IN_UV will be set for the same cases as when
/// @c valuep is non-@c NULL, but no actual assignment (or SEGV) will occur.
///
/// @c IS_NUMBER_NOT_INT will be set with @c IS_NUMBER_IN_UV if trailing decimals were
/// seen (in which case @c *valuep gives the true value truncated to an integer), and
/// @c IS_NUMBER_NEG if the number is negative (in which case @c *valuep holds the
/// absolute value). @c IS_NUMBER_IN_UV is not set if e notation was used or the
/// number is larger than a UV.
///
/// @c flags allows only @c PERL_SCAN_TRAILING, which allows for trailing
/// non-numeric text on an otherwise successful @i grok, setting
/// @c IS_NUMBER_TRAILING on the result.
SWIFT_NAME(PerlInterpreter.grok_number_flags(self:_:_:_:_:))
PERL_STATIC_INLINE int CPerl_grok_number_flags(pTHX_ const char *_Nonnull pv, STRLEN len, UV *_Nullable valuep, U32 flags) {
return grok_number_flags(pv, len, valuep, flags);
}
#endif
#ifdef grok_numeric_radix
/// Scan and skip for a numeric decimal separator (radix).
SWIFT_NAME(PerlInterpreter.grok_numeric_radix(self:_:_:))
PERL_STATIC_INLINE bool CPerl_grok_numeric_radix(pTHX_ const char *_Nonnull *_Nonnull sp, const char *_Nonnull send) {
return grok_numeric_radix(sp, send);
}
#endif
#ifdef grok_oct
/// converts a string representing an octal number to numeric form.
///
/// On entry @c start and @c *len give the string to scan, @c *flags gives
/// conversion flags, and @c result should be @c NULL or a pointer to an NV.
/// The scan stops at the end of the string, or the first invalid character.
/// Unless @c PERL_SCAN_SILENT_ILLDIGIT is set in @c *flags, encountering an
/// 8 or 9 will also trigger a warning.
/// On return @c *len is set to the length of the scanned string,
/// and @c *flags gives output flags.
///
/// If the value is <= @c UV_MAX it is returned as a UV, the output flags are clear,
/// and nothing is written to @c *result. If the value is > @c UV_MAX, @c grok_oct
/// returns @c UV_MAX, sets @c PERL_SCAN_GREATER_THAN_UV_MAX in the output flags,
/// and writes the value to @c *result (or the value is discarded if @c result
/// is @c NULL).
///
/// If @c PERL_SCAN_ALLOW_UNDERSCORES is set in @c *flags then the octal
/// number may use @c "_" characters to separate digits.
SWIFT_NAME(PerlInterpreter.grok_oct(self:_:_:_:_:))
PERL_STATIC_INLINE UV CPerl_grok_oct(pTHX_ const char* _Nonnull start, STRLEN* _Nonnull len_p, I32* _Nonnull flags, NV *_Nullable result) {
return grok_oct(start, len_p, flags, result);
}
#endif
#ifdef gv_init
/// The old form of @c gv_init_pvn(). It does not work with UTF-8 strings, as it
/// has no flags parameter. If the @c multi parameter is set, the
/// @c GV_ADDMULTI flag will be passed to @c gv_init_pvn().
SWIFT_NAME(PerlInterpreter.gv_init(self:_:_:_:_:_:))
PERL_STATIC_INLINE void CPerl_gv_init(pTHX_ GV* _Nonnull gv, HV* _Nullable stash, const char* _Nonnull name, STRLEN len, bool multi) {
gv_init(gv, stash, name, len, multi);
}
#endif
#ifdef hv_clear
/// Frees the all the elements of a hash, leaving it empty.
/// The XS equivalent of @c %hash @c = @c (). See also hv_undef.
///
/// See av_clear for a note about the hash possibly being invalid on
/// return.
SWIFT_NAME(PerlInterpreter.hv_clear(self:_:))
PERL_STATIC_INLINE void CPerl_hv_clear(pTHX_ HV *_Nullable hv) {
hv_clear(hv);
}
#endif
#ifdef hv_clear_placeholders
/// Clears any placeholders from a hash. If a restricted hash has any of its keys
/// marked as readonly and the key is subsequently deleted, the key is not actually
/// deleted but is marked by assigning it a value of @c &PL_sv_placeholder. This tags
/// it so it will be ignored by future operations such as iterating over the hash,
/// but will still allow the hash to have a value reassigned to the key at some
/// future point. This function clears any such placeholder keys from the hash.
/// See @c lock_keys @c in @c Hash::Util::lock_keys()|Hash::Util for an example of its
/// use.
SWIFT_NAME(PerlInterpreter.hv_clear_placeholders(self:_:))
PERL_STATIC_INLINE void CPerl_hv_clear_placeholders(pTHX_ HV *_Nonnull hv) {
hv_clear_placeholders(hv);
}
#endif
#ifdef hv_delete
/// Deletes a key/value pair in the hash. The value's SV is removed from
/// the hash, made mortal, and returned to the caller. The absolute
/// value of @c klen is the length of the key. If @c klen is negative the
/// key is assumed to be in UTF-8-encoded Unicode. The @c flags value
/// will normally be zero; if set to @c G_DISCARD then @c NULL will be returned.
/// @c NULL will also be returned if the key is not found.
SWIFT_NAME(PerlInterpreter.hv_delete(self:_:_:_:_:))
PERL_STATIC_INLINE SV *_Nullable CPerl_hv_delete(pTHX_ HV *_Nullable hv, const char *_Nonnull key, I32 klen, I32 flags) {
return hv_delete(hv, key, klen, flags);
}
#endif
#ifdef hv_delete_ent
/// Deletes a key/value pair in the hash. The value SV is removed from the hash,
/// made mortal, and returned to the caller. The @c flags value will normally be
/// zero; if set to @c G_DISCARD then @c NULL will be returned. @c NULL will also
/// be returned if the key is not found. @c hash can be a valid precomputed hash
/// value, or 0 to ask for it to be computed.
SWIFT_NAME(PerlInterpreter.hv_delete_ent(self:_:_:_:_:))
PERL_STATIC_INLINE SV *_Nullable CPerl_hv_delete_ent(pTHX_ HV *_Nullable hv, SV *_Nonnull keysv, I32 flags, U32 hash) {
return hv_delete_ent(hv, keysv, flags, hash);
}
#endif
#ifdef hv_exists
/// Returns a boolean indicating whether the specified hash key exists. The
/// absolute value of @c klen is the length of the key. If @c klen is
/// negative the key is assumed to be in UTF-8-encoded Unicode.
SWIFT_NAME(PerlInterpreter.hv_exists(self:_:_:_:))
PERL_STATIC_INLINE bool CPerl_hv_exists(pTHX_ HV *_Nullable hv, const char *_Nonnull key, I32 klen) {
return hv_exists(hv, key, klen);
}
#endif
#ifdef hv_exists_ent
/// Returns a boolean indicating whether
/// the specified hash key exists. @c hash
/// can be a valid precomputed hash value, or 0 to ask for it to be
/// computed.
SWIFT_NAME(PerlInterpreter.hv_exists_ent(self:_:_:_:))
PERL_STATIC_INLINE bool CPerl_hv_exists_ent(pTHX_ HV *_Nullable hv, SV *_Nonnull keysv, U32 hash) {
return hv_exists_ent(hv, keysv, hash);
}
#endif
#ifdef hv_fetch
/// Returns the SV which corresponds to the specified key in the hash.
/// The absolute value of @c klen is the length of the key. If @c klen is
/// negative the key is assumed to be in UTF-8-encoded Unicode. If
/// @c lval is set then the fetch will be part of a store. This means that if
/// there is no value in the hash associated with the given key, then one is
/// created and a pointer to it is returned. The @c SV* it points to can be
/// assigned to. But always check that the
/// return value is non-null before dereferencing it to an @c SV*.
///
/// See "Understanding the Magic of Tied Hashes and Arrays" in perlguts for more
/// information on how to use this function on tied hashes.
SWIFT_NAME(PerlInterpreter.hv_fetch(self:_:_:_:_:))
PERL_STATIC_INLINE SV *_Nullable *_Nullable CPerl_hv_fetch(pTHX_ HV *_Nullable hv, const char *_Nonnull key, I32 klen, bool lval) {
return hv_fetch(hv, key, klen, lval);
}
#endif
#ifdef hv_fetch_ent
/// Returns the hash entry which corresponds to the specified key in the hash.
/// @c hash must be a valid precomputed hash number for the given @c key, or 0
/// if you want the function to compute it. IF @c lval is set then the fetch
/// will be part of a store. Make sure the return value is non-null before
/// accessing it. The return value when @c hv is a tied hash is a pointer to a
/// static location, so be sure to make a copy of the structure if you need to
/// store it somewhere.
///
/// See "Understanding the Magic of Tied Hashes and Arrays" in perlguts for more
/// information on how to use this function on tied hashes.
SWIFT_NAME(PerlInterpreter.hv_fetch_ent(self:_:_:_:_:))
PERL_STATIC_INLINE HE *_Nullable CPerl_hv_fetch_ent(pTHX_ HV *_Nullable hv, SV *_Nonnull keysv, bool lval, U32 hash) {
return hv_fetch_ent(hv, keysv, lval, hash);
}
#endif
#ifdef hv_iterinit
/// Prepares a starting point to traverse a hash table. Returns the number of
/// keys in the hash, including placeholders (i.e. the same as @c HvTOTALKEYS(hv)).
/// The return value is currently only meaningful for hashes without tie magic.
///
/// NOTE: Before version 5.004_65, @c hv_iterinit used to return the number of
/// hash buckets that happen to be in use. If you still need that esoteric
/// value, you can get it through the macro @c HvFILL(hv).
///
SWIFT_NAME(PerlInterpreter.hv_iterinit(self:_:))
PERL_STATIC_INLINE I32 CPerl_hv_iterinit(pTHX_ HV *_Nonnull hv) {
return hv_iterinit(hv);
}
#endif
#ifdef hv_iternext
/// Returns entries from a hash iterator. See @c hv_iterinit.
///
/// You may call @c hv_delete or @c hv_delete_ent on the hash entry that the
/// iterator currently points to, without losing your place or invalidating your
/// iterator. Note that in this case the current entry is deleted from the hash
/// with your iterator holding the last reference to it. Your iterator is flagged
/// to free the entry on the next call to @c hv_iternext, so you must not discard
/// your iterator immediately else the entry will leak - call @c hv_iternext to
/// trigger the resource deallocation.
SWIFT_NAME(PerlInterpreter.hv_iternext(self:_:))
PERL_STATIC_INLINE HE *_Nullable CPerl_hv_iternext(pTHX_ HV *_Nonnull hv) {
return hv_iternext(hv);
}
#endif
#ifdef hv_magic
/// Adds magic to a hash. See @c sv_magic.
SWIFT_NAME(PerlInterpreter.hv_magic(self:_:_:_:))
PERL_STATIC_INLINE void CPerl_hv_magic(pTHX_ HV *_Nonnull hv, GV *_Nullable gv, int how) {
hv_magic(hv, gv, how);
}
#endif
#ifdef hv_scalar
/// Evaluates the hash in scalar context and returns the result.
///
/// When the hash is tied dispatches through to the SCALAR method,
/// otherwise returns a mortal SV containing the number of keys
/// in the hash.
///
/// Note, prior to 5.25 this function returned what is now
/// returned by the hv_bucket_ratio() function.
SWIFT_NAME(PerlInterpreter.hv_scalar(self:_:))
PERL_STATIC_INLINE SV *_Nonnull CPerl_hv_scalar(pTHX_ HV *_Nonnull hv) {
return hv_scalar(hv);
}
#endif
#ifdef hv_store
/// Stores an SV in a hash. The hash key is specified as @c key and the
/// absolute value of @c klen is the length of the key. If @c klen is
/// negative the key is assumed to be in UTF-8-encoded Unicode. The
/// @c hash parameter is the precomputed hash value; if it is zero then
/// Perl will compute it.
///
/// The return value will be
/// @c NULL if the operation failed or if the value did not need to be actually
/// stored within the hash (as in the case of tied hashes). Otherwise it can
/// be dereferenced to get the original @c SV*. Note that the caller is
/// responsible for suitably incrementing the reference count of @c val before
/// the call, and decrementing it if the function returned @c NULL. Effectively
/// a successful @c hv_store takes ownership of one reference to @c val. This is
/// usually what you want; a newly created SV has a reference count of one, so
/// if all your code does is create SVs then store them in a hash, @c hv_store
/// will own the only reference to the new SV, and your code doesn't need to do
/// anything further to tidy up. @c hv_store is not implemented as a call to
/// @c hv_store_ent, and does not create a temporary SV for the key, so if your
/// key data is not already in SV form then use @c hv_store in preference to
/// @c hv_store_ent.
///
/// See "Understanding the Magic of Tied Hashes and Arrays" in perlguts for more
/// information on how to use this function on tied hashes.
SWIFT_NAME(PerlInterpreter.hv_store(self:_:_:_:_:_:))
PERL_STATIC_INLINE SV *_Nullable *_Nullable CPerl_hv_store(pTHX_ HV *_Nullable hv, const char *_Nullable key, I32 klen, SV *_Nullable val, U32 hash) {
return hv_store(hv, key, klen, val, hash);
}
#endif
#ifdef hv_store_ent
/// Stores @c val in a hash. The hash key is specified as @c key. The @c hash
/// parameter is the precomputed hash value; if it is zero then Perl will
/// compute it. The return value is the new hash entry so created. It will be
/// @c NULL if the operation failed or if the value did not need to be actually
/// stored within the hash (as in the case of tied hashes). Otherwise the
/// contents of the return value can be accessed using the @c He? macros
/// described here. Note that the caller is responsible for suitably
/// incrementing the reference count of @c val before the call, and
/// decrementing it if the function returned NULL. Effectively a successful
/// @c hv_store_ent takes ownership of one reference to @c val. This is
/// usually what you want; a newly created SV has a reference count of one, so
/// if all your code does is create SVs then store them in a hash, @c hv_store
/// will own the only reference to the new SV, and your code doesn't need to do
/// anything further to tidy up. Note that @c hv_store_ent only reads the @c key;
/// unlike @c val it does not take ownership of it, so maintaining the correct
/// reference count on @c key is entirely the caller's responsibility. @c hv_store
/// is not implemented as a call to @c hv_store_ent, and does not create a temporary
/// SV for the key, so if your key data is not already in SV form then use
/// @c hv_store in preference to @c hv_store_ent.
///
/// See "Understanding the Magic of Tied Hashes and Arrays" in perlguts for more
/// information on how to use this function on tied hashes.
SWIFT_NAME(PerlInterpreter.hv_store_ent(self:_:_:_:_:))
PERL_STATIC_INLINE HE *_Nullable CPerl_hv_store_ent(pTHX_ HV *_Nullable hv, SV *_Nullable key, SV *_Nullable val, U32 hash) {
return hv_store_ent(hv, key, val, hash);
}
#endif
#ifdef hv_undef
/// Undefines the hash. The XS equivalent of @c undef(%hash).
///
/// As well as freeing all the elements of the hash (like @c hv_clear()), this
/// also frees any auxiliary data and storage associated with the hash.
///
/// See av_clear for a note about the hash possibly being invalid on
/// return.
SWIFT_NAME(PerlInterpreter.hv_undef(self:_:))
PERL_STATIC_INLINE void CPerl_hv_undef(pTHX_ HV *_Nullable hv) {
hv_undef(hv);
}
#endif
#ifdef intro_my
/// "Introduce" @c my variables to visible status. This is called during parsing
/// at the end of each statement to make lexical variables visible to subsequent
/// statements.
SWIFT_NAME(PerlInterpreter.intro_my(self:))
PERL_STATIC_INLINE U32 CPerl_intro_my(pTHX) {
return intro_my();
}
#endif
#ifdef is_ascii_string
/// This is a misleadingly-named synonym for is_utf8_invariant_string.
/// On ASCII-ish platforms, the name isn't misleading: the ASCII-range characters
/// are exactly the UTF-8 invariants. But EBCDIC machines have more invariants
/// than just the ASCII characters, so @c is_utf8_invariant_string is preferred.
SWIFT_NAME(is_ascii_string(_:_:))
PERL_STATIC_INLINE bool CPerl_is_ascii_string(const U8* _Nonnull const s, const STRLEN len) {
return is_ascii_string(s, len);
}
#endif
#ifdef is_c9strict_utf8_string
/// Returns TRUE if the first @c len bytes of string @c s form a valid
/// UTF-8-encoded string that conforms to
/// /www.unicode.org/versions/corrigendum9.html in Unicode Corrigendum #9|http:;
/// otherwise it returns FALSE. If @c len is 0, it will be calculated using
/// @c strlen(s) (which means if you use this option, that @c s can't have embedded
/// @c NUL characters and has to have a terminating @c NUL byte). Note that all
/// characters being ASCII constitute 'a valid UTF-8 string'.
///
/// This function returns FALSE for strings containing any code points above the
/// Unicode max of 0x10FFFF or surrogate code points, but accepts non-character
/// code points per
/// /www.unicode.org/versions/corrigendum9.html in Corrigendum #9|http:.
///
/// See also
/// @c is_utf8_invariant_string,
/// @c is_utf8_string,
/// @c is_utf8_string_flags,
/// @c is_utf8_string_loc,
/// @c is_utf8_string_loc_flags,
/// @c is_utf8_string_loclen,
/// @c is_utf8_string_loclen_flags,
/// @c is_utf8_fixed_width_buf_flags,
/// @c is_utf8_fixed_width_buf_loc_flags,
/// @c is_utf8_fixed_width_buf_loclen_flags,
/// @c is_strict_utf8_string,
/// @c is_strict_utf8_string_loc,
/// @c is_strict_utf8_string_loclen,
/// @c is_c9strict_utf8_string_loc,
/// and
/// @c is_c9strict_utf8_string_loclen.
SWIFT_NAME(is_c9strict_utf8_string(_:_:))
PERL_STATIC_INLINE bool CPerl_is_c9strict_utf8_string(const U8 *_Nonnull s, const STRLEN len) {
return is_c9strict_utf8_string(s, len);
}
#endif
#ifdef is_c9strict_utf8_string_loc
/// Like @c is_c9strict_utf8_string but stores the location of the failure (in
/// the case of "utf8ness failure") or the location @c s+@c len (in the case of
/// "utf8ness success") in the @c ep pointer.
///
/// See also @c is_c9strict_utf8_string_loclen.
SWIFT_NAME(is_c9strict_utf8_string_loc(_:_:_:))
PERL_STATIC_INLINE bool CPerl_is_c9strict_utf8_string_loc(const U8 *_Nonnull s, const STRLEN len, const U8 *_Nonnull *_Nonnull ep) {
return is_c9strict_utf8_string_loc(s, len, ep);
}
#endif
#ifdef is_c9strict_utf8_string_loclen
/// Like @c is_c9strict_utf8_string but stores the location of the failure (in
/// the case of "utf8ness failure") or the location @c s+@c len (in the case of
/// "utf8ness success") in the @c ep pointer, and the number of UTF-8 encoded
/// characters in the @c el pointer.
///
/// See also @c is_c9strict_utf8_string_loc.
SWIFT_NAME(is_c9strict_utf8_string_loclen(_:_:_:_:))
PERL_STATIC_INLINE bool CPerl_is_c9strict_utf8_string_loclen(const U8 *_Nonnull s, const STRLEN len, const U8 *_Nullable *_Nullable ep, STRLEN *_Nullable el) {
return is_c9strict_utf8_string_loclen(s, len, ep, el);
}
#endif
#ifdef is_invariant_string
/// This is a somewhat misleadingly-named synonym for is_utf8_invariant_string.
/// @c is_utf8_invariant_string is preferred, as it indicates under what conditions
/// the string is invariant.
SWIFT_NAME(is_invariant_string(_:_:))
PERL_STATIC_INLINE bool CPerl_is_invariant_string(const U8* _Nonnull const s, const STRLEN len) {
return is_invariant_string(s, len);
}
#endif
#ifdef is_strict_utf8_string
/// Returns TRUE if the first @c len bytes of string @c s form a valid
/// UTF-8-encoded string that is fully interchangeable by any application using
/// Unicode rules; otherwise it returns FALSE. If @c len is 0, it will be
/// calculated using @c strlen(s) (which means if you use this option, that @c s
/// can't have embedded @c NUL characters and has to have a terminating @c NUL
/// byte). Note that all characters being ASCII constitute 'a valid UTF-8 string'.
///
/// This function returns FALSE for strings containing any
/// code points above the Unicode max of 0x10FFFF, surrogate code points, or
/// non-character code points.
///
/// See also
/// @c is_utf8_invariant_string,
/// @c is_utf8_string,
/// @c is_utf8_string_flags,
/// @c is_utf8_string_loc,
/// @c is_utf8_string_loc_flags,
/// @c is_utf8_string_loclen,
/// @c is_utf8_string_loclen_flags,
/// @c is_utf8_fixed_width_buf_flags,
/// @c is_utf8_fixed_width_buf_loc_flags,
/// @c is_utf8_fixed_width_buf_loclen_flags,
/// @c is_strict_utf8_string_loc,
/// @c is_strict_utf8_string_loclen,
/// @c is_c9strict_utf8_string,
/// @c is_c9strict_utf8_string_loc,
/// and
/// @c is_c9strict_utf8_string_loclen.
SWIFT_NAME(is_strict_utf8_string(_:_:))
PERL_STATIC_INLINE bool CPerl_is_strict_utf8_string(const U8 *_Nonnull s, const STRLEN len) {
return is_strict_utf8_string(s, len);
}
#endif
#ifdef is_strict_utf8_string_loc
/// Like @c is_strict_utf8_string but stores the location of the failure (in the
/// case of "utf8ness failure") or the location @c s+@c len (in the case of
/// "utf8ness success") in the @c ep pointer.
///
/// See also @c is_strict_utf8_string_loclen.
SWIFT_NAME(is_strict_utf8_string_loc(_:_:_:))
PERL_STATIC_INLINE bool CPerl_is_strict_utf8_string_loc(const U8 *_Nonnull s, const STRLEN len, const U8 *_Nonnull *_Nonnull ep) {
return is_strict_utf8_string_loc(s, len, ep);
}
#endif