Commit | Line | Data |
954c1994 |
1 | =head1 NAME |
2 | |
3 | perlapi - autogenerated documentation for the perl public API |
4 | |
5 | =head1 DESCRIPTION |
6 | |
1c846c1f |
7 | This file contains the documentation of the perl public API generated by |
8 | embed.pl, specifically a listing of functions, macros, flags, and variables |
9 | that may be used by extension writers. The interfaces of any functions that |
954c1994 |
10 | are not listed here are subject to change without notice. For this reason, |
11 | blindly using functions listed in proto.h is to be avoided when writing |
12 | extensions. |
13 | |
14 | Note that all Perl API global variables must be referenced with the C<PL_> |
15 | prefix. Some macros are provided for compatibility with the older, |
16 | unadorned names, but this support may be disabled in a future release. |
17 | |
18 | The listing is alphabetical, case insensitive. |
19 | |
20 | =over 8 |
21 | |
22 | =item AvFILL |
23 | |
24 | Same as C<av_len()>. Deprecated, use C<av_len()> instead. |
25 | |
26 | int AvFILL(AV* av) |
27 | |
497711e7 |
28 | =for hackers |
29 | Found in file av.h |
30 | |
954c1994 |
31 | =item av_clear |
32 | |
33 | Clears an array, making it empty. Does not free the memory used by the |
34 | array itself. |
35 | |
36 | void av_clear(AV* ar) |
37 | |
497711e7 |
38 | =for hackers |
39 | Found in file av.c |
40 | |
f3b76584 |
41 | =item av_delete |
42 | |
43 | Deletes the element indexed by C<key> from the array. Returns the |
44 | deleted element. C<flags> is currently ignored. |
45 | |
46 | SV* av_delete(AV* ar, I32 key, I32 flags) |
47 | |
48 | =for hackers |
49 | Found in file av.c |
50 | |
51 | =item av_exists |
52 | |
53 | Returns true if the element indexed by C<key> has been initialized. |
54 | |
55 | This relies on the fact that uninitialized array elements are set to |
56 | C<&PL_sv_undef>. |
57 | |
58 | bool av_exists(AV* ar, I32 key) |
59 | |
60 | =for hackers |
61 | Found in file av.c |
62 | |
954c1994 |
63 | =item av_extend |
64 | |
65 | Pre-extend an array. The C<key> is the index to which the array should be |
66 | extended. |
67 | |
68 | void av_extend(AV* ar, I32 key) |
69 | |
497711e7 |
70 | =for hackers |
71 | Found in file av.c |
72 | |
954c1994 |
73 | =item av_fetch |
74 | |
75 | Returns the SV at the specified index in the array. The C<key> is the |
76 | index. If C<lval> is set then the fetch will be part of a store. Check |
77 | that the return value is non-null before dereferencing it to a C<SV*>. |
78 | |
96f1132b |
79 | See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for |
80 | more information on how to use this function on tied arrays. |
954c1994 |
81 | |
82 | SV** av_fetch(AV* ar, I32 key, I32 lval) |
83 | |
497711e7 |
84 | =for hackers |
85 | Found in file av.c |
86 | |
f3b76584 |
87 | =item av_fill |
88 | |
89 | Ensure than an array has a given number of elements, equivalent to |
90 | Perl's C<$#array = $fill;>. |
91 | |
92 | void av_fill(AV* ar, I32 fill) |
93 | |
94 | =for hackers |
95 | Found in file av.c |
96 | |
954c1994 |
97 | =item av_len |
98 | |
99 | Returns the highest index in the array. Returns -1 if the array is |
100 | empty. |
101 | |
102 | I32 av_len(AV* ar) |
103 | |
497711e7 |
104 | =for hackers |
105 | Found in file av.c |
106 | |
954c1994 |
107 | =item av_make |
108 | |
109 | Creates a new AV and populates it with a list of SVs. The SVs are copied |
110 | into the array, so they may be freed after the call to av_make. The new AV |
111 | will have a reference count of 1. |
112 | |
113 | AV* av_make(I32 size, SV** svp) |
114 | |
497711e7 |
115 | =for hackers |
116 | Found in file av.c |
117 | |
954c1994 |
118 | =item av_pop |
119 | |
120 | Pops an SV off the end of the array. Returns C<&PL_sv_undef> if the array |
121 | is empty. |
122 | |
123 | SV* av_pop(AV* ar) |
124 | |
497711e7 |
125 | =for hackers |
126 | Found in file av.c |
127 | |
954c1994 |
128 | =item av_push |
129 | |
130 | Pushes an SV onto the end of the array. The array will grow automatically |
131 | to accommodate the addition. |
132 | |
133 | void av_push(AV* ar, SV* val) |
134 | |
497711e7 |
135 | =for hackers |
136 | Found in file av.c |
137 | |
954c1994 |
138 | =item av_shift |
139 | |
140 | Shifts an SV off the beginning of the array. |
141 | |
142 | SV* av_shift(AV* ar) |
143 | |
497711e7 |
144 | =for hackers |
145 | Found in file av.c |
146 | |
954c1994 |
147 | =item av_store |
148 | |
149 | Stores an SV in an array. The array index is specified as C<key>. The |
150 | return value will be NULL if the operation failed or if the value did not |
151 | need to be actually stored within the array (as in the case of tied |
152 | arrays). Otherwise it can be dereferenced to get the original C<SV*>. Note |
153 | that the caller is responsible for suitably incrementing the reference |
154 | count of C<val> before the call, and decrementing it if the function |
155 | returned NULL. |
156 | |
96f1132b |
157 | See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for |
954c1994 |
158 | more information on how to use this function on tied arrays. |
159 | |
160 | SV** av_store(AV* ar, I32 key, SV* val) |
161 | |
497711e7 |
162 | =for hackers |
163 | Found in file av.c |
164 | |
954c1994 |
165 | =item av_undef |
166 | |
167 | Undefines the array. Frees the memory used by the array itself. |
168 | |
169 | void av_undef(AV* ar) |
170 | |
497711e7 |
171 | =for hackers |
172 | Found in file av.c |
173 | |
954c1994 |
174 | =item av_unshift |
175 | |
176 | Unshift the given number of C<undef> values onto the beginning of the |
177 | array. The array will grow automatically to accommodate the addition. You |
178 | must then use C<av_store> to assign values to these new elements. |
179 | |
180 | void av_unshift(AV* ar, I32 num) |
181 | |
497711e7 |
182 | =for hackers |
183 | Found in file av.c |
184 | |
185 | =item bytes_to_utf8 |
186 | |
187 | Converts a string C<s> of length C<len> from ASCII into UTF8 encoding. |
6662521e |
188 | Returns a pointer to the newly-created string, and sets C<len> to |
189 | reflect the new length. |
497711e7 |
190 | |
eebe1485 |
191 | NOTE: this function is experimental and may change or be |
192 | removed without notice. |
193 | |
194 | U8* bytes_to_utf8(U8 *s, STRLEN *len) |
497711e7 |
195 | |
196 | =for hackers |
197 | Found in file utf8.c |
198 | |
954c1994 |
199 | =item call_argv |
200 | |
201 | Performs a callback to the specified Perl sub. See L<perlcall>. |
202 | |
203 | NOTE: the perl_ form of this function is deprecated. |
204 | |
205 | I32 call_argv(const char* sub_name, I32 flags, char** argv) |
206 | |
497711e7 |
207 | =for hackers |
208 | Found in file perl.c |
209 | |
954c1994 |
210 | =item call_method |
211 | |
212 | Performs a callback to the specified Perl method. The blessed object must |
213 | be on the stack. See L<perlcall>. |
214 | |
215 | NOTE: the perl_ form of this function is deprecated. |
216 | |
217 | I32 call_method(const char* methname, I32 flags) |
218 | |
497711e7 |
219 | =for hackers |
220 | Found in file perl.c |
221 | |
954c1994 |
222 | =item call_pv |
223 | |
224 | Performs a callback to the specified Perl sub. See L<perlcall>. |
225 | |
226 | NOTE: the perl_ form of this function is deprecated. |
227 | |
228 | I32 call_pv(const char* sub_name, I32 flags) |
229 | |
497711e7 |
230 | =for hackers |
231 | Found in file perl.c |
232 | |
954c1994 |
233 | =item call_sv |
234 | |
235 | Performs a callback to the Perl sub whose name is in the SV. See |
236 | L<perlcall>. |
237 | |
238 | NOTE: the perl_ form of this function is deprecated. |
239 | |
240 | I32 call_sv(SV* sv, I32 flags) |
241 | |
497711e7 |
242 | =for hackers |
243 | Found in file perl.c |
244 | |
954c1994 |
245 | =item CLASS |
246 | |
247 | Variable which is setup by C<xsubpp> to indicate the |
248 | class name for a C++ XS constructor. This is always a C<char*>. See C<THIS>. |
249 | |
250 | char* CLASS |
251 | |
497711e7 |
252 | =for hackers |
253 | Found in file XSUB.h |
254 | |
954c1994 |
255 | =item Copy |
256 | |
257 | The XSUB-writer's interface to the C C<memcpy> function. The C<src> is the |
258 | source, C<dest> is the destination, C<nitems> is the number of items, and C<type> is |
259 | the type. May fail on overlapping copies. See also C<Move>. |
260 | |
261 | void Copy(void* src, void* dest, int nitems, type) |
262 | |
497711e7 |
263 | =for hackers |
264 | Found in file handy.h |
265 | |
954c1994 |
266 | =item croak |
267 | |
c9d5ac95 |
268 | This is the XSUB-writer's interface to Perl's C<die> function. |
269 | Normally use this function the same way you use the C C<printf> |
270 | function. See C<warn>. |
271 | |
272 | If you want to throw an exception object, assign the object to |
273 | C<$@> and then pass C<Nullch> to croak(): |
274 | |
275 | errsv = get_sv("@", TRUE); |
276 | sv_setsv(errsv, exception_object); |
277 | croak(Nullch); |
954c1994 |
278 | |
279 | void croak(const char* pat, ...) |
280 | |
497711e7 |
281 | =for hackers |
282 | Found in file util.c |
283 | |
954c1994 |
284 | =item CvSTASH |
285 | |
286 | Returns the stash of the CV. |
287 | |
288 | HV* CvSTASH(CV* cv) |
289 | |
497711e7 |
290 | =for hackers |
291 | Found in file cv.h |
292 | |
beab0874 |
293 | =item cv_const_sv |
294 | |
295 | If C<cv> is a constant sub eligible for inlining. returns the constant |
296 | value returned by the sub. Otherwise, returns NULL. |
297 | |
298 | Constant subs can be created with C<newCONSTSUB> or as described in |
299 | L<perlsub/"Constant Functions">. |
300 | |
301 | SV* cv_const_sv(CV* cv) |
302 | |
303 | =for hackers |
35676c7e |
304 | Found in file op.c |
beab0874 |
305 | |
954c1994 |
306 | =item dMARK |
307 | |
308 | Declare a stack marker variable, C<mark>, for the XSUB. See C<MARK> and |
309 | C<dORIGMARK>. |
310 | |
311 | dMARK; |
312 | |
497711e7 |
313 | =for hackers |
314 | Found in file pp.h |
315 | |
954c1994 |
316 | =item dORIGMARK |
317 | |
318 | Saves the original stack mark for the XSUB. See C<ORIGMARK>. |
319 | |
320 | dORIGMARK; |
321 | |
497711e7 |
322 | =for hackers |
323 | Found in file pp.h |
324 | |
954c1994 |
325 | =item dSP |
326 | |
327 | Declares a local copy of perl's stack pointer for the XSUB, available via |
328 | the C<SP> macro. See C<SP>. |
329 | |
330 | dSP; |
331 | |
497711e7 |
332 | =for hackers |
333 | Found in file pp.h |
334 | |
954c1994 |
335 | =item dXSARGS |
336 | |
337 | Sets up stack and mark pointers for an XSUB, calling dSP and dMARK. This |
338 | is usually handled automatically by C<xsubpp>. Declares the C<items> |
339 | variable to indicate the number of items on the stack. |
340 | |
341 | dXSARGS; |
342 | |
497711e7 |
343 | =for hackers |
344 | Found in file XSUB.h |
345 | |
954c1994 |
346 | =item dXSI32 |
347 | |
348 | Sets up the C<ix> variable for an XSUB which has aliases. This is usually |
349 | handled automatically by C<xsubpp>. |
350 | |
351 | dXSI32; |
352 | |
497711e7 |
353 | =for hackers |
354 | Found in file XSUB.h |
355 | |
954c1994 |
356 | =item ENTER |
357 | |
358 | Opening bracket on a callback. See C<LEAVE> and L<perlcall>. |
359 | |
360 | ENTER; |
361 | |
497711e7 |
362 | =for hackers |
363 | Found in file scope.h |
364 | |
954c1994 |
365 | =item eval_pv |
366 | |
367 | Tells Perl to C<eval> the given string and return an SV* result. |
368 | |
369 | NOTE: the perl_ form of this function is deprecated. |
370 | |
371 | SV* eval_pv(const char* p, I32 croak_on_error) |
372 | |
497711e7 |
373 | =for hackers |
374 | Found in file perl.c |
375 | |
954c1994 |
376 | =item eval_sv |
377 | |
378 | Tells Perl to C<eval> the string in the SV. |
379 | |
380 | NOTE: the perl_ form of this function is deprecated. |
381 | |
382 | I32 eval_sv(SV* sv, I32 flags) |
383 | |
497711e7 |
384 | =for hackers |
385 | Found in file perl.c |
386 | |
954c1994 |
387 | =item EXTEND |
388 | |
389 | Used to extend the argument stack for an XSUB's return values. Once |
4375e838 |
390 | used, guarantees that there is room for at least C<nitems> to be pushed |
954c1994 |
391 | onto the stack. |
392 | |
393 | void EXTEND(SP, int nitems) |
394 | |
497711e7 |
395 | =for hackers |
396 | Found in file pp.h |
397 | |
954c1994 |
398 | =item fbm_compile |
399 | |
400 | Analyses the string in order to make fast searches on it using fbm_instr() |
401 | -- the Boyer-Moore algorithm. |
402 | |
403 | void fbm_compile(SV* sv, U32 flags) |
404 | |
497711e7 |
405 | =for hackers |
406 | Found in file util.c |
407 | |
954c1994 |
408 | =item fbm_instr |
409 | |
410 | Returns the location of the SV in the string delimited by C<str> and |
411 | C<strend>. It returns C<Nullch> if the string can't be found. The C<sv> |
412 | does not have to be fbm_compiled, but the search will not be as fast |
413 | then. |
414 | |
415 | char* fbm_instr(unsigned char* big, unsigned char* bigend, SV* littlesv, U32 flags) |
416 | |
497711e7 |
417 | =for hackers |
418 | Found in file util.c |
419 | |
954c1994 |
420 | =item FREETMPS |
421 | |
422 | Closing bracket for temporaries on a callback. See C<SAVETMPS> and |
423 | L<perlcall>. |
424 | |
425 | FREETMPS; |
426 | |
497711e7 |
427 | =for hackers |
428 | Found in file scope.h |
429 | |
954c1994 |
430 | =item get_av |
431 | |
432 | Returns the AV of the specified Perl array. If C<create> is set and the |
433 | Perl variable does not exist then it will be created. If C<create> is not |
434 | set and the variable does not exist then NULL is returned. |
435 | |
436 | NOTE: the perl_ form of this function is deprecated. |
437 | |
438 | AV* get_av(const char* name, I32 create) |
439 | |
497711e7 |
440 | =for hackers |
441 | Found in file perl.c |
442 | |
954c1994 |
443 | =item get_cv |
444 | |
445 | Returns the CV of the specified Perl subroutine. If C<create> is set and |
446 | the Perl subroutine does not exist then it will be declared (which has the |
447 | same effect as saying C<sub name;>). If C<create> is not set and the |
448 | subroutine does not exist then NULL is returned. |
449 | |
450 | NOTE: the perl_ form of this function is deprecated. |
451 | |
452 | CV* get_cv(const char* name, I32 create) |
453 | |
497711e7 |
454 | =for hackers |
455 | Found in file perl.c |
456 | |
954c1994 |
457 | =item get_hv |
458 | |
459 | Returns the HV of the specified Perl hash. If C<create> is set and the |
460 | Perl variable does not exist then it will be created. If C<create> is not |
461 | set and the variable does not exist then NULL is returned. |
462 | |
463 | NOTE: the perl_ form of this function is deprecated. |
464 | |
465 | HV* get_hv(const char* name, I32 create) |
466 | |
497711e7 |
467 | =for hackers |
468 | Found in file perl.c |
469 | |
954c1994 |
470 | =item get_sv |
471 | |
472 | Returns the SV of the specified Perl scalar. If C<create> is set and the |
473 | Perl variable does not exist then it will be created. If C<create> is not |
474 | set and the variable does not exist then NULL is returned. |
475 | |
476 | NOTE: the perl_ form of this function is deprecated. |
477 | |
478 | SV* get_sv(const char* name, I32 create) |
479 | |
497711e7 |
480 | =for hackers |
481 | Found in file perl.c |
482 | |
954c1994 |
483 | =item GIMME |
484 | |
485 | A backward-compatible version of C<GIMME_V> which can only return |
486 | C<G_SCALAR> or C<G_ARRAY>; in a void context, it returns C<G_SCALAR>. |
487 | Deprecated. Use C<GIMME_V> instead. |
488 | |
489 | U32 GIMME |
490 | |
497711e7 |
491 | =for hackers |
492 | Found in file op.h |
493 | |
954c1994 |
494 | =item GIMME_V |
495 | |
496 | The XSUB-writer's equivalent to Perl's C<wantarray>. Returns C<G_VOID>, |
90fdbbb7 |
497 | C<G_SCALAR> or C<G_ARRAY> for void, scalar or list context, |
954c1994 |
498 | respectively. |
499 | |
500 | U32 GIMME_V |
501 | |
497711e7 |
502 | =for hackers |
503 | Found in file op.h |
504 | |
954c1994 |
505 | =item GvSV |
506 | |
507 | Return the SV from the GV. |
508 | |
509 | SV* GvSV(GV* gv) |
510 | |
497711e7 |
511 | =for hackers |
512 | Found in file gv.h |
513 | |
954c1994 |
514 | =item gv_fetchmeth |
515 | |
516 | Returns the glob with the given C<name> and a defined subroutine or |
517 | C<NULL>. The glob lives in the given C<stash>, or in the stashes |
1c846c1f |
518 | accessible via @ISA and @UNIVERSAL. |
954c1994 |
519 | |
520 | The argument C<level> should be either 0 or -1. If C<level==0>, as a |
521 | side-effect creates a glob with the given C<name> in the given C<stash> |
522 | which in the case of success contains an alias for the subroutine, and sets |
1c846c1f |
523 | up caching info for this glob. Similarly for all the searched stashes. |
954c1994 |
524 | |
525 | This function grants C<"SUPER"> token as a postfix of the stash name. The |
526 | GV returned from C<gv_fetchmeth> may be a method cache entry, which is not |
4929bf7b |
527 | visible to Perl code. So when calling C<call_sv>, you should not use |
954c1994 |
528 | the GV directly; instead, you should use the method's CV, which can be |
1c846c1f |
529 | obtained from the GV with the C<GvCV> macro. |
954c1994 |
530 | |
531 | GV* gv_fetchmeth(HV* stash, const char* name, STRLEN len, I32 level) |
532 | |
497711e7 |
533 | =for hackers |
534 | Found in file gv.c |
535 | |
954c1994 |
536 | =item gv_fetchmethod |
537 | |
6d0f518e |
538 | See L<gv_fetchmethod_autoload>. |
954c1994 |
539 | |
540 | GV* gv_fetchmethod(HV* stash, const char* name) |
541 | |
497711e7 |
542 | =for hackers |
543 | Found in file gv.c |
544 | |
954c1994 |
545 | =item gv_fetchmethod_autoload |
546 | |
547 | Returns the glob which contains the subroutine to call to invoke the method |
548 | on the C<stash>. In fact in the presence of autoloading this may be the |
549 | glob for "AUTOLOAD". In this case the corresponding variable $AUTOLOAD is |
1c846c1f |
550 | already setup. |
954c1994 |
551 | |
552 | The third parameter of C<gv_fetchmethod_autoload> determines whether |
553 | AUTOLOAD lookup is performed if the given method is not present: non-zero |
1c846c1f |
554 | means yes, look for AUTOLOAD; zero means no, don't look for AUTOLOAD. |
954c1994 |
555 | Calling C<gv_fetchmethod> is equivalent to calling C<gv_fetchmethod_autoload> |
1c846c1f |
556 | with a non-zero C<autoload> parameter. |
954c1994 |
557 | |
558 | These functions grant C<"SUPER"> token as a prefix of the method name. Note |
559 | that if you want to keep the returned glob for a long time, you need to |
560 | check for it being "AUTOLOAD", since at the later time the call may load a |
561 | different subroutine due to $AUTOLOAD changing its value. Use the glob |
1c846c1f |
562 | created via a side effect to do this. |
954c1994 |
563 | |
564 | These functions have the same side-effects and as C<gv_fetchmeth> with |
565 | C<level==0>. C<name> should be writable if contains C<':'> or C<' |
566 | ''>. The warning against passing the GV returned by C<gv_fetchmeth> to |
1c846c1f |
567 | C<call_sv> apply equally to these functions. |
954c1994 |
568 | |
569 | GV* gv_fetchmethod_autoload(HV* stash, const char* name, I32 autoload) |
570 | |
497711e7 |
571 | =for hackers |
572 | Found in file gv.c |
573 | |
954c1994 |
574 | =item gv_stashpv |
575 | |
386d01d6 |
576 | Returns a pointer to the stash for a specified package. C<name> should |
577 | be a valid UTF-8 string. If C<create> is set then the package will be |
578 | created if it does not already exist. If C<create> is not set and the |
579 | package does not exist then NULL is returned. |
954c1994 |
580 | |
581 | HV* gv_stashpv(const char* name, I32 create) |
582 | |
497711e7 |
583 | =for hackers |
584 | Found in file gv.c |
585 | |
954c1994 |
586 | =item gv_stashsv |
587 | |
386d01d6 |
588 | Returns a pointer to the stash for a specified package, which must be a |
589 | valid UTF-8 string. See C<gv_stashpv>. |
954c1994 |
590 | |
591 | HV* gv_stashsv(SV* sv, I32 create) |
592 | |
497711e7 |
593 | =for hackers |
594 | Found in file gv.c |
595 | |
954c1994 |
596 | =item G_ARRAY |
597 | |
90fdbbb7 |
598 | Used to indicate list context. See C<GIMME_V>, C<GIMME> and |
954c1994 |
599 | L<perlcall>. |
600 | |
497711e7 |
601 | =for hackers |
602 | Found in file cop.h |
603 | |
954c1994 |
604 | =item G_DISCARD |
605 | |
606 | Indicates that arguments returned from a callback should be discarded. See |
607 | L<perlcall>. |
608 | |
497711e7 |
609 | =for hackers |
610 | Found in file cop.h |
611 | |
954c1994 |
612 | =item G_EVAL |
613 | |
614 | Used to force a Perl C<eval> wrapper around a callback. See |
615 | L<perlcall>. |
616 | |
497711e7 |
617 | =for hackers |
618 | Found in file cop.h |
619 | |
954c1994 |
620 | =item G_NOARGS |
621 | |
622 | Indicates that no arguments are being sent to a callback. See |
623 | L<perlcall>. |
624 | |
497711e7 |
625 | =for hackers |
626 | Found in file cop.h |
627 | |
954c1994 |
628 | =item G_SCALAR |
629 | |
630 | Used to indicate scalar context. See C<GIMME_V>, C<GIMME>, and |
631 | L<perlcall>. |
632 | |
497711e7 |
633 | =for hackers |
634 | Found in file cop.h |
635 | |
954c1994 |
636 | =item G_VOID |
637 | |
638 | Used to indicate void context. See C<GIMME_V> and L<perlcall>. |
639 | |
497711e7 |
640 | =for hackers |
641 | Found in file cop.h |
642 | |
954c1994 |
643 | =item HEf_SVKEY |
644 | |
645 | This flag, used in the length slot of hash entries and magic structures, |
646 | specifies the structure contains a C<SV*> pointer where a C<char*> pointer |
647 | is to be expected. (For information only--not to be used). |
648 | |
497711e7 |
649 | =for hackers |
650 | Found in file hv.h |
651 | |
954c1994 |
652 | =item HeHASH |
653 | |
654 | Returns the computed hash stored in the hash entry. |
655 | |
656 | U32 HeHASH(HE* he) |
657 | |
497711e7 |
658 | =for hackers |
659 | Found in file hv.h |
660 | |
954c1994 |
661 | =item HeKEY |
662 | |
663 | Returns the actual pointer stored in the key slot of the hash entry. The |
664 | pointer may be either C<char*> or C<SV*>, depending on the value of |
665 | C<HeKLEN()>. Can be assigned to. The C<HePV()> or C<HeSVKEY()> macros are |
666 | usually preferable for finding the value of a key. |
667 | |
668 | void* HeKEY(HE* he) |
669 | |
497711e7 |
670 | =for hackers |
671 | Found in file hv.h |
672 | |
954c1994 |
673 | =item HeKLEN |
674 | |
675 | If this is negative, and amounts to C<HEf_SVKEY>, it indicates the entry |
676 | holds an C<SV*> key. Otherwise, holds the actual length of the key. Can |
677 | be assigned to. The C<HePV()> macro is usually preferable for finding key |
678 | lengths. |
679 | |
680 | STRLEN HeKLEN(HE* he) |
681 | |
497711e7 |
682 | =for hackers |
683 | Found in file hv.h |
684 | |
954c1994 |
685 | =item HePV |
686 | |
687 | Returns the key slot of the hash entry as a C<char*> value, doing any |
688 | necessary dereferencing of possibly C<SV*> keys. The length of the string |
689 | is placed in C<len> (this is a macro, so do I<not> use C<&len>). If you do |
690 | not care about what the length of the key is, you may use the global |
691 | variable C<PL_na>, though this is rather less efficient than using a local |
692 | variable. Remember though, that hash keys in perl are free to contain |
693 | embedded nulls, so using C<strlen()> or similar is not a good way to find |
694 | the length of hash keys. This is very similar to the C<SvPV()> macro |
695 | described elsewhere in this document. |
696 | |
697 | char* HePV(HE* he, STRLEN len) |
698 | |
497711e7 |
699 | =for hackers |
700 | Found in file hv.h |
701 | |
954c1994 |
702 | =item HeSVKEY |
703 | |
704 | Returns the key as an C<SV*>, or C<Nullsv> if the hash entry does not |
705 | contain an C<SV*> key. |
706 | |
707 | SV* HeSVKEY(HE* he) |
708 | |
497711e7 |
709 | =for hackers |
710 | Found in file hv.h |
711 | |
954c1994 |
712 | =item HeSVKEY_force |
713 | |
714 | Returns the key as an C<SV*>. Will create and return a temporary mortal |
715 | C<SV*> if the hash entry contains only a C<char*> key. |
716 | |
717 | SV* HeSVKEY_force(HE* he) |
718 | |
497711e7 |
719 | =for hackers |
720 | Found in file hv.h |
721 | |
954c1994 |
722 | =item HeSVKEY_set |
723 | |
724 | Sets the key to a given C<SV*>, taking care to set the appropriate flags to |
725 | indicate the presence of an C<SV*> key, and returns the same |
726 | C<SV*>. |
727 | |
728 | SV* HeSVKEY_set(HE* he, SV* sv) |
729 | |
497711e7 |
730 | =for hackers |
731 | Found in file hv.h |
732 | |
954c1994 |
733 | =item HeVAL |
734 | |
735 | Returns the value slot (type C<SV*>) stored in the hash entry. |
736 | |
737 | SV* HeVAL(HE* he) |
738 | |
497711e7 |
739 | =for hackers |
740 | Found in file hv.h |
741 | |
954c1994 |
742 | =item HvNAME |
743 | |
744 | Returns the package name of a stash. See C<SvSTASH>, C<CvSTASH>. |
745 | |
746 | char* HvNAME(HV* stash) |
747 | |
497711e7 |
748 | =for hackers |
749 | Found in file hv.h |
750 | |
954c1994 |
751 | =item hv_clear |
752 | |
753 | Clears a hash, making it empty. |
754 | |
755 | void hv_clear(HV* tb) |
756 | |
497711e7 |
757 | =for hackers |
758 | Found in file hv.c |
759 | |
954c1994 |
760 | =item hv_delete |
761 | |
762 | Deletes a key/value pair in the hash. The value SV is removed from the |
1c846c1f |
763 | hash and returned to the caller. The C<klen> is the length of the key. |
954c1994 |
764 | The C<flags> value will normally be zero; if set to G_DISCARD then NULL |
765 | will be returned. |
766 | |
da58a35d |
767 | SV* hv_delete(HV* tb, const char* key, I32 klen, I32 flags) |
954c1994 |
768 | |
497711e7 |
769 | =for hackers |
770 | Found in file hv.c |
771 | |
954c1994 |
772 | =item hv_delete_ent |
773 | |
774 | Deletes a key/value pair in the hash. The value SV is removed from the |
775 | hash and returned to the caller. The C<flags> value will normally be zero; |
776 | if set to G_DISCARD then NULL will be returned. C<hash> can be a valid |
777 | precomputed hash value, or 0 to ask for it to be computed. |
778 | |
779 | SV* hv_delete_ent(HV* tb, SV* key, I32 flags, U32 hash) |
780 | |
497711e7 |
781 | =for hackers |
782 | Found in file hv.c |
783 | |
954c1994 |
784 | =item hv_exists |
785 | |
786 | Returns a boolean indicating whether the specified hash key exists. The |
787 | C<klen> is the length of the key. |
788 | |
da58a35d |
789 | bool hv_exists(HV* tb, const char* key, I32 klen) |
954c1994 |
790 | |
497711e7 |
791 | =for hackers |
792 | Found in file hv.c |
793 | |
954c1994 |
794 | =item hv_exists_ent |
795 | |
796 | Returns a boolean indicating whether the specified hash key exists. C<hash> |
797 | can be a valid precomputed hash value, or 0 to ask for it to be |
798 | computed. |
799 | |
800 | bool hv_exists_ent(HV* tb, SV* key, U32 hash) |
801 | |
497711e7 |
802 | =for hackers |
803 | Found in file hv.c |
804 | |
954c1994 |
805 | =item hv_fetch |
806 | |
807 | Returns the SV which corresponds to the specified key in the hash. The |
808 | C<klen> is the length of the key. If C<lval> is set then the fetch will be |
809 | part of a store. Check that the return value is non-null before |
1c846c1f |
810 | dereferencing it to a C<SV*>. |
954c1994 |
811 | |
96f1132b |
812 | See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more |
954c1994 |
813 | information on how to use this function on tied hashes. |
814 | |
da58a35d |
815 | SV** hv_fetch(HV* tb, const char* key, I32 klen, I32 lval) |
954c1994 |
816 | |
497711e7 |
817 | =for hackers |
818 | Found in file hv.c |
819 | |
954c1994 |
820 | =item hv_fetch_ent |
821 | |
822 | Returns the hash entry which corresponds to the specified key in the hash. |
823 | C<hash> must be a valid precomputed hash number for the given C<key>, or 0 |
824 | if you want the function to compute it. IF C<lval> is set then the fetch |
825 | will be part of a store. Make sure the return value is non-null before |
826 | accessing it. The return value when C<tb> is a tied hash is a pointer to a |
827 | static location, so be sure to make a copy of the structure if you need to |
1c846c1f |
828 | store it somewhere. |
954c1994 |
829 | |
96f1132b |
830 | See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more |
954c1994 |
831 | information on how to use this function on tied hashes. |
832 | |
833 | HE* hv_fetch_ent(HV* tb, SV* key, I32 lval, U32 hash) |
834 | |
497711e7 |
835 | =for hackers |
836 | Found in file hv.c |
837 | |
954c1994 |
838 | =item hv_iterinit |
839 | |
840 | Prepares a starting point to traverse a hash table. Returns the number of |
841 | keys in the hash (i.e. the same as C<HvKEYS(tb)>). The return value is |
1c846c1f |
842 | currently only meaningful for hashes without tie magic. |
954c1994 |
843 | |
844 | NOTE: Before version 5.004_65, C<hv_iterinit> used to return the number of |
845 | hash buckets that happen to be in use. If you still need that esoteric |
846 | value, you can get it through the macro C<HvFILL(tb)>. |
847 | |
848 | I32 hv_iterinit(HV* tb) |
849 | |
497711e7 |
850 | =for hackers |
851 | Found in file hv.c |
852 | |
954c1994 |
853 | =item hv_iterkey |
854 | |
855 | Returns the key from the current position of the hash iterator. See |
856 | C<hv_iterinit>. |
857 | |
858 | char* hv_iterkey(HE* entry, I32* retlen) |
859 | |
497711e7 |
860 | =for hackers |
861 | Found in file hv.c |
862 | |
954c1994 |
863 | =item hv_iterkeysv |
864 | |
865 | Returns the key as an C<SV*> from the current position of the hash |
866 | iterator. The return value will always be a mortal copy of the key. Also |
867 | see C<hv_iterinit>. |
868 | |
869 | SV* hv_iterkeysv(HE* entry) |
870 | |
497711e7 |
871 | =for hackers |
872 | Found in file hv.c |
873 | |
954c1994 |
874 | =item hv_iternext |
875 | |
876 | Returns entries from a hash iterator. See C<hv_iterinit>. |
877 | |
878 | HE* hv_iternext(HV* tb) |
879 | |
497711e7 |
880 | =for hackers |
881 | Found in file hv.c |
882 | |
954c1994 |
883 | =item hv_iternextsv |
884 | |
885 | Performs an C<hv_iternext>, C<hv_iterkey>, and C<hv_iterval> in one |
886 | operation. |
887 | |
888 | SV* hv_iternextsv(HV* hv, char** key, I32* retlen) |
889 | |
497711e7 |
890 | =for hackers |
891 | Found in file hv.c |
892 | |
954c1994 |
893 | =item hv_iterval |
894 | |
895 | Returns the value from the current position of the hash iterator. See |
896 | C<hv_iterkey>. |
897 | |
898 | SV* hv_iterval(HV* tb, HE* entry) |
899 | |
497711e7 |
900 | =for hackers |
901 | Found in file hv.c |
902 | |
954c1994 |
903 | =item hv_magic |
904 | |
905 | Adds magic to a hash. See C<sv_magic>. |
906 | |
907 | void hv_magic(HV* hv, GV* gv, int how) |
908 | |
497711e7 |
909 | =for hackers |
910 | Found in file hv.c |
911 | |
954c1994 |
912 | =item hv_store |
913 | |
914 | Stores an SV in a hash. The hash key is specified as C<key> and C<klen> is |
915 | the length of the key. The C<hash> parameter is the precomputed hash |
916 | value; if it is zero then Perl will compute it. The return value will be |
917 | NULL if the operation failed or if the value did not need to be actually |
918 | stored within the hash (as in the case of tied hashes). Otherwise it can |
919 | be dereferenced to get the original C<SV*>. Note that the caller is |
920 | responsible for suitably incrementing the reference count of C<val> before |
1c846c1f |
921 | the call, and decrementing it if the function returned NULL. |
954c1994 |
922 | |
96f1132b |
923 | See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more |
954c1994 |
924 | information on how to use this function on tied hashes. |
925 | |
da58a35d |
926 | SV** hv_store(HV* tb, const char* key, I32 klen, SV* val, U32 hash) |
954c1994 |
927 | |
497711e7 |
928 | =for hackers |
929 | Found in file hv.c |
930 | |
954c1994 |
931 | =item hv_store_ent |
932 | |
933 | Stores C<val> in a hash. The hash key is specified as C<key>. The C<hash> |
934 | parameter is the precomputed hash value; if it is zero then Perl will |
935 | compute it. The return value is the new hash entry so created. It will be |
936 | NULL if the operation failed or if the value did not need to be actually |
937 | stored within the hash (as in the case of tied hashes). Otherwise the |
938 | contents of the return value can be accessed using the C<He???> macros |
939 | described here. Note that the caller is responsible for suitably |
940 | incrementing the reference count of C<val> before the call, and |
1c846c1f |
941 | decrementing it if the function returned NULL. |
954c1994 |
942 | |
96f1132b |
943 | See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more |
954c1994 |
944 | information on how to use this function on tied hashes. |
945 | |
946 | HE* hv_store_ent(HV* tb, SV* key, SV* val, U32 hash) |
947 | |
497711e7 |
948 | =for hackers |
949 | Found in file hv.c |
950 | |
954c1994 |
951 | =item hv_undef |
952 | |
953 | Undefines the hash. |
954 | |
955 | void hv_undef(HV* tb) |
956 | |
497711e7 |
957 | =for hackers |
958 | Found in file hv.c |
959 | |
954c1994 |
960 | =item isALNUM |
961 | |
4375e838 |
962 | Returns a boolean indicating whether the C C<char> is an ASCII alphanumeric |
f1cbbd6e |
963 | character (including underscore) or digit. |
954c1994 |
964 | |
965 | bool isALNUM(char ch) |
966 | |
497711e7 |
967 | =for hackers |
968 | Found in file handy.h |
969 | |
954c1994 |
970 | =item isALPHA |
971 | |
4375e838 |
972 | Returns a boolean indicating whether the C C<char> is an ASCII alphabetic |
954c1994 |
973 | character. |
974 | |
975 | bool isALPHA(char ch) |
976 | |
497711e7 |
977 | =for hackers |
978 | Found in file handy.h |
979 | |
954c1994 |
980 | =item isDIGIT |
981 | |
4375e838 |
982 | Returns a boolean indicating whether the C C<char> is an ASCII |
954c1994 |
983 | digit. |
984 | |
985 | bool isDIGIT(char ch) |
986 | |
497711e7 |
987 | =for hackers |
988 | Found in file handy.h |
989 | |
954c1994 |
990 | =item isLOWER |
991 | |
992 | Returns a boolean indicating whether the C C<char> is a lowercase |
993 | character. |
994 | |
995 | bool isLOWER(char ch) |
996 | |
497711e7 |
997 | =for hackers |
998 | Found in file handy.h |
999 | |
954c1994 |
1000 | =item isSPACE |
1001 | |
1002 | Returns a boolean indicating whether the C C<char> is whitespace. |
1003 | |
1004 | bool isSPACE(char ch) |
1005 | |
497711e7 |
1006 | =for hackers |
1007 | Found in file handy.h |
1008 | |
954c1994 |
1009 | =item isUPPER |
1010 | |
1011 | Returns a boolean indicating whether the C C<char> is an uppercase |
1012 | character. |
1013 | |
1014 | bool isUPPER(char ch) |
1015 | |
497711e7 |
1016 | =for hackers |
1017 | Found in file handy.h |
1018 | |
eebe1485 |
1019 | =item is_utf8_char |
1020 | |
1021 | Tests if some arbitrary number of bytes begins in a valid UTF-8 character. |
1022 | The actual number of bytes in the UTF-8 character will be returned if it |
1023 | is valid, otherwise 0. |
1024 | |
1025 | STRLEN is_utf8_char(U8 *p) |
1026 | |
1027 | =for hackers |
1028 | Found in file utf8.c |
1029 | |
1030 | =item is_utf8_string |
1031 | |
1032 | Returns true if first C<len> bytes of the given string form valid a UTF8 |
1033 | string, false otherwise. |
1034 | |
1035 | bool is_utf8_string(U8 *s, STRLEN len) |
1036 | |
1037 | =for hackers |
1038 | Found in file utf8.c |
1039 | |
954c1994 |
1040 | =item items |
1041 | |
1042 | Variable which is setup by C<xsubpp> to indicate the number of |
1043 | items on the stack. See L<perlxs/"Variable-length Parameter Lists">. |
1044 | |
1045 | I32 items |
1046 | |
497711e7 |
1047 | =for hackers |
1048 | Found in file XSUB.h |
1049 | |
954c1994 |
1050 | =item ix |
1051 | |
1052 | Variable which is setup by C<xsubpp> to indicate which of an |
1053 | XSUB's aliases was used to invoke it. See L<perlxs/"The ALIAS: Keyword">. |
1054 | |
1055 | I32 ix |
1056 | |
497711e7 |
1057 | =for hackers |
1058 | Found in file XSUB.h |
1059 | |
954c1994 |
1060 | =item LEAVE |
1061 | |
1062 | Closing bracket on a callback. See C<ENTER> and L<perlcall>. |
1063 | |
1064 | LEAVE; |
1065 | |
497711e7 |
1066 | =for hackers |
1067 | Found in file scope.h |
1068 | |
954c1994 |
1069 | =item looks_like_number |
1070 | |
1071 | Test if an the content of an SV looks like a number (or is a |
a8586c98 |
1072 | number). C<Inf> and C<Infinity> are treated as numbers (so will not |
1073 | issue a non-numeric warning), even if your atof() doesn't grok them. |
954c1994 |
1074 | |
1075 | I32 looks_like_number(SV* sv) |
1076 | |
497711e7 |
1077 | =for hackers |
1078 | Found in file sv.c |
1079 | |
954c1994 |
1080 | =item MARK |
1081 | |
1082 | Stack marker variable for the XSUB. See C<dMARK>. |
1083 | |
497711e7 |
1084 | =for hackers |
1085 | Found in file pp.h |
1086 | |
954c1994 |
1087 | =item mg_clear |
1088 | |
1089 | Clear something magical that the SV represents. See C<sv_magic>. |
1090 | |
1091 | int mg_clear(SV* sv) |
1092 | |
497711e7 |
1093 | =for hackers |
1094 | Found in file mg.c |
1095 | |
954c1994 |
1096 | =item mg_copy |
1097 | |
1098 | Copies the magic from one SV to another. See C<sv_magic>. |
1099 | |
1100 | int mg_copy(SV* sv, SV* nsv, const char* key, I32 klen) |
1101 | |
497711e7 |
1102 | =for hackers |
1103 | Found in file mg.c |
1104 | |
954c1994 |
1105 | =item mg_find |
1106 | |
1107 | Finds the magic pointer for type matching the SV. See C<sv_magic>. |
1108 | |
1109 | MAGIC* mg_find(SV* sv, int type) |
1110 | |
497711e7 |
1111 | =for hackers |
1112 | Found in file mg.c |
1113 | |
954c1994 |
1114 | =item mg_free |
1115 | |
1116 | Free any magic storage used by the SV. See C<sv_magic>. |
1117 | |
1118 | int mg_free(SV* sv) |
1119 | |
497711e7 |
1120 | =for hackers |
1121 | Found in file mg.c |
1122 | |
954c1994 |
1123 | =item mg_get |
1124 | |
1125 | Do magic after a value is retrieved from the SV. See C<sv_magic>. |
1126 | |
1127 | int mg_get(SV* sv) |
1128 | |
497711e7 |
1129 | =for hackers |
1130 | Found in file mg.c |
1131 | |
954c1994 |
1132 | =item mg_length |
1133 | |
1134 | Report on the SV's length. See C<sv_magic>. |
1135 | |
1136 | U32 mg_length(SV* sv) |
1137 | |
497711e7 |
1138 | =for hackers |
1139 | Found in file mg.c |
1140 | |
954c1994 |
1141 | =item mg_magical |
1142 | |
1143 | Turns on the magical status of an SV. See C<sv_magic>. |
1144 | |
1145 | void mg_magical(SV* sv) |
1146 | |
497711e7 |
1147 | =for hackers |
1148 | Found in file mg.c |
1149 | |
954c1994 |
1150 | =item mg_set |
1151 | |
1152 | Do magic after a value is assigned to the SV. See C<sv_magic>. |
1153 | |
1154 | int mg_set(SV* sv) |
1155 | |
497711e7 |
1156 | =for hackers |
1157 | Found in file mg.c |
1158 | |
954c1994 |
1159 | =item Move |
1160 | |
1161 | The XSUB-writer's interface to the C C<memmove> function. The C<src> is the |
1162 | source, C<dest> is the destination, C<nitems> is the number of items, and C<type> is |
1163 | the type. Can do overlapping moves. See also C<Copy>. |
1164 | |
1165 | void Move(void* src, void* dest, int nitems, type) |
1166 | |
497711e7 |
1167 | =for hackers |
1168 | Found in file handy.h |
1169 | |
954c1994 |
1170 | =item New |
1171 | |
1172 | The XSUB-writer's interface to the C C<malloc> function. |
1173 | |
1174 | void New(int id, void* ptr, int nitems, type) |
1175 | |
497711e7 |
1176 | =for hackers |
1177 | Found in file handy.h |
1178 | |
954c1994 |
1179 | =item newAV |
1180 | |
1181 | Creates a new AV. The reference count is set to 1. |
1182 | |
1183 | AV* newAV() |
1184 | |
497711e7 |
1185 | =for hackers |
1186 | Found in file av.c |
1187 | |
954c1994 |
1188 | =item Newc |
1189 | |
1190 | The XSUB-writer's interface to the C C<malloc> function, with |
1191 | cast. |
1192 | |
1193 | void Newc(int id, void* ptr, int nitems, type, cast) |
1194 | |
497711e7 |
1195 | =for hackers |
1196 | Found in file handy.h |
1197 | |
954c1994 |
1198 | =item newCONSTSUB |
1199 | |
1200 | Creates a constant sub equivalent to Perl C<sub FOO () { 123 }> which is |
1201 | eligible for inlining at compile-time. |
1202 | |
beab0874 |
1203 | CV* newCONSTSUB(HV* stash, char* name, SV* sv) |
954c1994 |
1204 | |
497711e7 |
1205 | =for hackers |
35676c7e |
1206 | Found in file op.c |
497711e7 |
1207 | |
954c1994 |
1208 | =item newHV |
1209 | |
1210 | Creates a new HV. The reference count is set to 1. |
1211 | |
1212 | HV* newHV() |
1213 | |
497711e7 |
1214 | =for hackers |
1215 | Found in file hv.c |
1216 | |
954c1994 |
1217 | =item newRV_inc |
1218 | |
1219 | Creates an RV wrapper for an SV. The reference count for the original SV is |
1220 | incremented. |
1221 | |
1222 | SV* newRV_inc(SV* sv) |
1223 | |
497711e7 |
1224 | =for hackers |
1225 | Found in file sv.h |
1226 | |
954c1994 |
1227 | =item newRV_noinc |
1228 | |
1229 | Creates an RV wrapper for an SV. The reference count for the original |
1230 | SV is B<not> incremented. |
1231 | |
1232 | SV* newRV_noinc(SV *sv) |
1233 | |
497711e7 |
1234 | =for hackers |
1235 | Found in file sv.c |
1236 | |
954c1994 |
1237 | =item NEWSV |
1238 | |
1239 | Creates a new SV. A non-zero C<len> parameter indicates the number of |
1240 | bytes of preallocated string space the SV should have. An extra byte for a |
1241 | tailing NUL is also reserved. (SvPOK is not set for the SV even if string |
444155da |
1242 | space is allocated.) The reference count for the new SV is set to 1. |
954c1994 |
1243 | C<id> is an integer id between 0 and 1299 (used to identify leaks). |
1244 | |
1245 | SV* NEWSV(int id, STRLEN len) |
1246 | |
497711e7 |
1247 | =for hackers |
1248 | Found in file handy.h |
1249 | |
954c1994 |
1250 | =item newSViv |
1251 | |
1252 | Creates a new SV and copies an integer into it. The reference count for the |
1253 | SV is set to 1. |
1254 | |
1255 | SV* newSViv(IV i) |
1256 | |
497711e7 |
1257 | =for hackers |
1258 | Found in file sv.c |
1259 | |
954c1994 |
1260 | =item newSVnv |
1261 | |
1262 | Creates a new SV and copies a floating point value into it. |
1263 | The reference count for the SV is set to 1. |
1264 | |
1265 | SV* newSVnv(NV n) |
1266 | |
497711e7 |
1267 | =for hackers |
1268 | Found in file sv.c |
1269 | |
954c1994 |
1270 | =item newSVpv |
1271 | |
1272 | Creates a new SV and copies a string into it. The reference count for the |
1273 | SV is set to 1. If C<len> is zero, Perl will compute the length using |
1274 | strlen(). For efficiency, consider using C<newSVpvn> instead. |
1275 | |
1276 | SV* newSVpv(const char* s, STRLEN len) |
1277 | |
497711e7 |
1278 | =for hackers |
1279 | Found in file sv.c |
1280 | |
954c1994 |
1281 | =item newSVpvf |
1282 | |
1283 | Creates a new SV an initialize it with the string formatted like |
1284 | C<sprintf>. |
1285 | |
1286 | SV* newSVpvf(const char* pat, ...) |
1287 | |
497711e7 |
1288 | =for hackers |
1289 | Found in file sv.c |
1290 | |
954c1994 |
1291 | =item newSVpvn |
1292 | |
1293 | Creates a new SV and copies a string into it. The reference count for the |
1c846c1f |
1294 | SV is set to 1. Note that if C<len> is zero, Perl will create a zero length |
954c1994 |
1295 | string. You are responsible for ensuring that the source string is at least |
1296 | C<len> bytes long. |
1297 | |
1298 | SV* newSVpvn(const char* s, STRLEN len) |
1299 | |
497711e7 |
1300 | =for hackers |
1301 | Found in file sv.c |
1302 | |
1c846c1f |
1303 | =item newSVpvn_share |
1304 | |
1305 | Creates a new SV and populates it with a string from |
1306 | the string table. Turns on READONLY and FAKE. |
1307 | The idea here is that as string table is used for shared hash |
1308 | keys these strings will have SvPVX == HeKEY and hash lookup |
1309 | will avoid string compare. |
1310 | |
ae154d6d |
1311 | SV* newSVpvn_share(const char* s, I32 len, U32 hash) |
1c846c1f |
1312 | |
1313 | =for hackers |
1314 | Found in file sv.c |
1315 | |
954c1994 |
1316 | =item newSVrv |
1317 | |
1318 | Creates a new SV for the RV, C<rv>, to point to. If C<rv> is not an RV then |
1319 | it will be upgraded to one. If C<classname> is non-null then the new SV will |
1320 | be blessed in the specified package. The new SV is returned and its |
1321 | reference count is 1. |
1322 | |
1323 | SV* newSVrv(SV* rv, const char* classname) |
1324 | |
497711e7 |
1325 | =for hackers |
1326 | Found in file sv.c |
1327 | |
954c1994 |
1328 | =item newSVsv |
1329 | |
1330 | Creates a new SV which is an exact duplicate of the original SV. |
1331 | |
1332 | SV* newSVsv(SV* old) |
1333 | |
497711e7 |
1334 | =for hackers |
1335 | Found in file sv.c |
1336 | |
1a3327fb |
1337 | =item newSVuv |
1338 | |
1339 | Creates a new SV and copies an unsigned integer into it. |
1340 | The reference count for the SV is set to 1. |
1341 | |
1342 | SV* newSVuv(UV u) |
1343 | |
497711e7 |
1344 | =for hackers |
1345 | Found in file sv.c |
1346 | |
954c1994 |
1347 | =item newXS |
1348 | |
1349 | Used by C<xsubpp> to hook up XSUBs as Perl subs. |
1350 | |
497711e7 |
1351 | =for hackers |
35676c7e |
1352 | Found in file op.c |
497711e7 |
1353 | |
954c1994 |
1354 | =item newXSproto |
1355 | |
1356 | Used by C<xsubpp> to hook up XSUBs as Perl subs. Adds Perl prototypes to |
1357 | the subs. |
1358 | |
497711e7 |
1359 | =for hackers |
1360 | Found in file XSUB.h |
1361 | |
954c1994 |
1362 | =item Newz |
1363 | |
1364 | The XSUB-writer's interface to the C C<malloc> function. The allocated |
1365 | memory is zeroed with C<memzero>. |
1366 | |
1367 | void Newz(int id, void* ptr, int nitems, type) |
1368 | |
497711e7 |
1369 | =for hackers |
1370 | Found in file handy.h |
1371 | |
954c1994 |
1372 | =item Nullav |
1373 | |
1374 | Null AV pointer. |
1375 | |
497711e7 |
1376 | =for hackers |
1377 | Found in file av.h |
1378 | |
954c1994 |
1379 | =item Nullch |
1380 | |
1381 | Null character pointer. |
1382 | |
497711e7 |
1383 | =for hackers |
1384 | Found in file handy.h |
1385 | |
954c1994 |
1386 | =item Nullcv |
1387 | |
1388 | Null CV pointer. |
1389 | |
497711e7 |
1390 | =for hackers |
1391 | Found in file cv.h |
1392 | |
954c1994 |
1393 | =item Nullhv |
1394 | |
1395 | Null HV pointer. |
1396 | |
497711e7 |
1397 | =for hackers |
1398 | Found in file hv.h |
1399 | |
954c1994 |
1400 | =item Nullsv |
1401 | |
1402 | Null SV pointer. |
1403 | |
497711e7 |
1404 | =for hackers |
1405 | Found in file handy.h |
1406 | |
954c1994 |
1407 | =item ORIGMARK |
1408 | |
1409 | The original stack mark for the XSUB. See C<dORIGMARK>. |
1410 | |
497711e7 |
1411 | =for hackers |
1412 | Found in file pp.h |
1413 | |
954c1994 |
1414 | =item perl_alloc |
1415 | |
1416 | Allocates a new Perl interpreter. See L<perlembed>. |
1417 | |
1418 | PerlInterpreter* perl_alloc() |
1419 | |
497711e7 |
1420 | =for hackers |
1421 | Found in file perl.c |
1422 | |
954c1994 |
1423 | =item perl_construct |
1424 | |
1425 | Initializes a new Perl interpreter. See L<perlembed>. |
1426 | |
1427 | void perl_construct(PerlInterpreter* interp) |
1428 | |
497711e7 |
1429 | =for hackers |
1430 | Found in file perl.c |
1431 | |
954c1994 |
1432 | =item perl_destruct |
1433 | |
1434 | Shuts down a Perl interpreter. See L<perlembed>. |
1435 | |
1436 | void perl_destruct(PerlInterpreter* interp) |
1437 | |
497711e7 |
1438 | =for hackers |
1439 | Found in file perl.c |
1440 | |
954c1994 |
1441 | =item perl_free |
1442 | |
1443 | Releases a Perl interpreter. See L<perlembed>. |
1444 | |
1445 | void perl_free(PerlInterpreter* interp) |
1446 | |
497711e7 |
1447 | =for hackers |
1448 | Found in file perl.c |
1449 | |
954c1994 |
1450 | =item perl_parse |
1451 | |
1452 | Tells a Perl interpreter to parse a Perl script. See L<perlembed>. |
1453 | |
1454 | int perl_parse(PerlInterpreter* interp, XSINIT_t xsinit, int argc, char** argv, char** env) |
1455 | |
497711e7 |
1456 | =for hackers |
1457 | Found in file perl.c |
1458 | |
954c1994 |
1459 | =item perl_run |
1460 | |
1461 | Tells a Perl interpreter to run. See L<perlembed>. |
1462 | |
1463 | int perl_run(PerlInterpreter* interp) |
1464 | |
497711e7 |
1465 | =for hackers |
1466 | Found in file perl.c |
1467 | |
954c1994 |
1468 | =item PL_DBsingle |
1469 | |
1470 | When Perl is run in debugging mode, with the B<-d> switch, this SV is a |
ae154d6d |
1471 | boolean which indicates whether subs are being single-stepped. |
954c1994 |
1472 | Single-stepping is automatically turned on after every step. This is the C |
1473 | variable which corresponds to Perl's $DB::single variable. See |
1474 | C<PL_DBsub>. |
1475 | |
1476 | SV * PL_DBsingle |
1477 | |
497711e7 |
1478 | =for hackers |
1479 | Found in file intrpvar.h |
1480 | |
954c1994 |
1481 | =item PL_DBsub |
1482 | |
1483 | When Perl is run in debugging mode, with the B<-d> switch, this GV contains |
1484 | the SV which holds the name of the sub being debugged. This is the C |
1485 | variable which corresponds to Perl's $DB::sub variable. See |
1486 | C<PL_DBsingle>. |
1487 | |
1488 | GV * PL_DBsub |
1489 | |
497711e7 |
1490 | =for hackers |
1491 | Found in file intrpvar.h |
1492 | |
954c1994 |
1493 | =item PL_DBtrace |
1494 | |
1495 | Trace variable used when Perl is run in debugging mode, with the B<-d> |
1496 | switch. This is the C variable which corresponds to Perl's $DB::trace |
1497 | variable. See C<PL_DBsingle>. |
1498 | |
1499 | SV * PL_DBtrace |
1500 | |
497711e7 |
1501 | =for hackers |
1502 | Found in file intrpvar.h |
1503 | |
954c1994 |
1504 | =item PL_dowarn |
1505 | |
1506 | The C variable which corresponds to Perl's $^W warning variable. |
1507 | |
1508 | bool PL_dowarn |
1509 | |
497711e7 |
1510 | =for hackers |
1511 | Found in file intrpvar.h |
1512 | |
c155e47c |
1513 | =item PL_last_in_gv |
1514 | |
1515 | The GV which was last used for a filehandle input operation. (C<< <FH> >>) |
1516 | |
1517 | GV* PL_last_in_gv |
1518 | |
1519 | =for hackers |
1520 | Found in file thrdvar.h |
1521 | |
954c1994 |
1522 | =item PL_modglobal |
1523 | |
ae154d6d |
1524 | C<PL_modglobal> is a general purpose, interpreter global HV for use by |
954c1994 |
1525 | extensions that need to keep information on a per-interpreter basis. |
ae154d6d |
1526 | In a pinch, it can also be used as a symbol table for extensions |
1527 | to share data among each other. It is a good idea to use keys |
954c1994 |
1528 | prefixed by the package name of the extension that owns the data. |
1529 | |
1530 | HV* PL_modglobal |
1531 | |
497711e7 |
1532 | =for hackers |
1533 | Found in file intrpvar.h |
1534 | |
954c1994 |
1535 | =item PL_na |
1536 | |
1537 | A convenience variable which is typically used with C<SvPV> when one |
1538 | doesn't care about the length of the string. It is usually more efficient |
1539 | to either declare a local variable and use that instead or to use the |
1540 | C<SvPV_nolen> macro. |
1541 | |
1542 | STRLEN PL_na |
1543 | |
497711e7 |
1544 | =for hackers |
1545 | Found in file thrdvar.h |
1546 | |
c155e47c |
1547 | =item PL_ofs_sv |
1548 | |
1549 | The output field separator - C<$,> in Perl space. |
1550 | |
1551 | SV* PL_ofs_sv |
1552 | |
1553 | =for hackers |
1554 | Found in file thrdvar.h |
1555 | |
1556 | =item PL_rs |
1557 | |
1558 | The input record separator - C<$/> in Perl space. |
1559 | |
1560 | SV* PL_rs |
1561 | |
1562 | =for hackers |
1563 | Found in file thrdvar.h |
1564 | |
954c1994 |
1565 | =item PL_sv_no |
1566 | |
1567 | This is the C<false> SV. See C<PL_sv_yes>. Always refer to this as |
1568 | C<&PL_sv_no>. |
1569 | |
1570 | SV PL_sv_no |
1571 | |
497711e7 |
1572 | =for hackers |
1573 | Found in file intrpvar.h |
1574 | |
954c1994 |
1575 | =item PL_sv_undef |
1576 | |
1577 | This is the C<undef> SV. Always refer to this as C<&PL_sv_undef>. |
1578 | |
1579 | SV PL_sv_undef |
1580 | |
497711e7 |
1581 | =for hackers |
1582 | Found in file intrpvar.h |
1583 | |
954c1994 |
1584 | =item PL_sv_yes |
1585 | |
1586 | This is the C<true> SV. See C<PL_sv_no>. Always refer to this as |
1587 | C<&PL_sv_yes>. |
1588 | |
1589 | SV PL_sv_yes |
1590 | |
497711e7 |
1591 | =for hackers |
1592 | Found in file intrpvar.h |
1593 | |
954c1994 |
1594 | =item POPi |
1595 | |
1596 | Pops an integer off the stack. |
1597 | |
1598 | IV POPi |
1599 | |
497711e7 |
1600 | =for hackers |
1601 | Found in file pp.h |
1602 | |
954c1994 |
1603 | =item POPl |
1604 | |
1605 | Pops a long off the stack. |
1606 | |
1607 | long POPl |
1608 | |
497711e7 |
1609 | =for hackers |
1610 | Found in file pp.h |
1611 | |
954c1994 |
1612 | =item POPn |
1613 | |
1614 | Pops a double off the stack. |
1615 | |
1616 | NV POPn |
1617 | |
497711e7 |
1618 | =for hackers |
1619 | Found in file pp.h |
1620 | |
954c1994 |
1621 | =item POPp |
1622 | |
1623 | Pops a string off the stack. |
1624 | |
1625 | char* POPp |
1626 | |
497711e7 |
1627 | =for hackers |
1628 | Found in file pp.h |
1629 | |
954c1994 |
1630 | =item POPs |
1631 | |
1632 | Pops an SV off the stack. |
1633 | |
1634 | SV* POPs |
1635 | |
497711e7 |
1636 | =for hackers |
1637 | Found in file pp.h |
1638 | |
954c1994 |
1639 | =item PUSHi |
1640 | |
1641 | Push an integer onto the stack. The stack must have room for this element. |
1642 | Handles 'set' magic. See C<XPUSHi>. |
1643 | |
1644 | void PUSHi(IV iv) |
1645 | |
497711e7 |
1646 | =for hackers |
1647 | Found in file pp.h |
1648 | |
954c1994 |
1649 | =item PUSHMARK |
1650 | |
1651 | Opening bracket for arguments on a callback. See C<PUTBACK> and |
1652 | L<perlcall>. |
1653 | |
1654 | PUSHMARK; |
1655 | |
497711e7 |
1656 | =for hackers |
1657 | Found in file pp.h |
1658 | |
954c1994 |
1659 | =item PUSHn |
1660 | |
1661 | Push a double onto the stack. The stack must have room for this element. |
1662 | Handles 'set' magic. See C<XPUSHn>. |
1663 | |
1664 | void PUSHn(NV nv) |
1665 | |
497711e7 |
1666 | =for hackers |
1667 | Found in file pp.h |
1668 | |
954c1994 |
1669 | =item PUSHp |
1670 | |
1671 | Push a string onto the stack. The stack must have room for this element. |
1672 | The C<len> indicates the length of the string. Handles 'set' magic. See |
1673 | C<XPUSHp>. |
1674 | |
1675 | void PUSHp(char* str, STRLEN len) |
1676 | |
497711e7 |
1677 | =for hackers |
1678 | Found in file pp.h |
1679 | |
954c1994 |
1680 | =item PUSHs |
1681 | |
1c846c1f |
1682 | Push an SV onto the stack. The stack must have room for this element. |
954c1994 |
1683 | Does not handle 'set' magic. See C<XPUSHs>. |
1684 | |
1685 | void PUSHs(SV* sv) |
1686 | |
497711e7 |
1687 | =for hackers |
1688 | Found in file pp.h |
1689 | |
954c1994 |
1690 | =item PUSHu |
1691 | |
1692 | Push an unsigned integer onto the stack. The stack must have room for this |
1693 | element. See C<XPUSHu>. |
1694 | |
1695 | void PUSHu(UV uv) |
1696 | |
497711e7 |
1697 | =for hackers |
1698 | Found in file pp.h |
1699 | |
954c1994 |
1700 | =item PUTBACK |
1701 | |
1702 | Closing bracket for XSUB arguments. This is usually handled by C<xsubpp>. |
1703 | See C<PUSHMARK> and L<perlcall> for other uses. |
1704 | |
1705 | PUTBACK; |
1706 | |
497711e7 |
1707 | =for hackers |
1708 | Found in file pp.h |
1709 | |
954c1994 |
1710 | =item Renew |
1711 | |
1712 | The XSUB-writer's interface to the C C<realloc> function. |
1713 | |
1714 | void Renew(void* ptr, int nitems, type) |
1715 | |
497711e7 |
1716 | =for hackers |
1717 | Found in file handy.h |
1718 | |
954c1994 |
1719 | =item Renewc |
1720 | |
1721 | The XSUB-writer's interface to the C C<realloc> function, with |
1722 | cast. |
1723 | |
1724 | void Renewc(void* ptr, int nitems, type, cast) |
1725 | |
497711e7 |
1726 | =for hackers |
1727 | Found in file handy.h |
1728 | |
954c1994 |
1729 | =item require_pv |
1730 | |
1731 | Tells Perl to C<require> a module. |
1732 | |
1733 | NOTE: the perl_ form of this function is deprecated. |
1734 | |
1735 | void require_pv(const char* pv) |
1736 | |
497711e7 |
1737 | =for hackers |
1738 | Found in file perl.c |
1739 | |
954c1994 |
1740 | =item RETVAL |
1741 | |
1742 | Variable which is setup by C<xsubpp> to hold the return value for an |
1743 | XSUB. This is always the proper type for the XSUB. See |
1744 | L<perlxs/"The RETVAL Variable">. |
1745 | |
1746 | (whatever) RETVAL |
1747 | |
497711e7 |
1748 | =for hackers |
1749 | Found in file XSUB.h |
1750 | |
954c1994 |
1751 | =item Safefree |
1752 | |
1753 | The XSUB-writer's interface to the C C<free> function. |
1754 | |
49b8b560 |
1755 | void Safefree(void* ptr) |
954c1994 |
1756 | |
497711e7 |
1757 | =for hackers |
1758 | Found in file handy.h |
1759 | |
954c1994 |
1760 | =item savepv |
1761 | |
1762 | Copy a string to a safe spot. This does not use an SV. |
1763 | |
1764 | char* savepv(const char* sv) |
1765 | |
497711e7 |
1766 | =for hackers |
1767 | Found in file util.c |
1768 | |
954c1994 |
1769 | =item savepvn |
1770 | |
1771 | Copy a string to a safe spot. The C<len> indicates number of bytes to |
1772 | copy. This does not use an SV. |
1773 | |
1774 | char* savepvn(const char* sv, I32 len) |
1775 | |
497711e7 |
1776 | =for hackers |
1777 | Found in file util.c |
1778 | |
954c1994 |
1779 | =item SAVETMPS |
1780 | |
1781 | Opening bracket for temporaries on a callback. See C<FREETMPS> and |
1782 | L<perlcall>. |
1783 | |
1784 | SAVETMPS; |
1785 | |
497711e7 |
1786 | =for hackers |
1787 | Found in file scope.h |
1788 | |
954c1994 |
1789 | =item SP |
1790 | |
1791 | Stack pointer. This is usually handled by C<xsubpp>. See C<dSP> and |
1792 | C<SPAGAIN>. |
1793 | |
497711e7 |
1794 | =for hackers |
1795 | Found in file pp.h |
1796 | |
954c1994 |
1797 | =item SPAGAIN |
1798 | |
1799 | Refetch the stack pointer. Used after a callback. See L<perlcall>. |
1800 | |
1801 | SPAGAIN; |
1802 | |
497711e7 |
1803 | =for hackers |
1804 | Found in file pp.h |
1805 | |
954c1994 |
1806 | =item ST |
1807 | |
1808 | Used to access elements on the XSUB's stack. |
1809 | |
1810 | SV* ST(int ix) |
1811 | |
497711e7 |
1812 | =for hackers |
1813 | Found in file XSUB.h |
1814 | |
954c1994 |
1815 | =item strEQ |
1816 | |
1817 | Test two strings to see if they are equal. Returns true or false. |
1818 | |
1819 | bool strEQ(char* s1, char* s2) |
1820 | |
497711e7 |
1821 | =for hackers |
1822 | Found in file handy.h |
1823 | |
954c1994 |
1824 | =item strGE |
1825 | |
1826 | Test two strings to see if the first, C<s1>, is greater than or equal to |
1827 | the second, C<s2>. Returns true or false. |
1828 | |
1829 | bool strGE(char* s1, char* s2) |
1830 | |
497711e7 |
1831 | =for hackers |
1832 | Found in file handy.h |
1833 | |
954c1994 |
1834 | =item strGT |
1835 | |
1836 | Test two strings to see if the first, C<s1>, is greater than the second, |
1837 | C<s2>. Returns true or false. |
1838 | |
1839 | bool strGT(char* s1, char* s2) |
1840 | |
497711e7 |
1841 | =for hackers |
1842 | Found in file handy.h |
1843 | |
954c1994 |
1844 | =item strLE |
1845 | |
1846 | Test two strings to see if the first, C<s1>, is less than or equal to the |
1847 | second, C<s2>. Returns true or false. |
1848 | |
1849 | bool strLE(char* s1, char* s2) |
1850 | |
497711e7 |
1851 | =for hackers |
1852 | Found in file handy.h |
1853 | |
954c1994 |
1854 | =item strLT |
1855 | |
1856 | Test two strings to see if the first, C<s1>, is less than the second, |
1857 | C<s2>. Returns true or false. |
1858 | |
1859 | bool strLT(char* s1, char* s2) |
1860 | |
497711e7 |
1861 | =for hackers |
1862 | Found in file handy.h |
1863 | |
954c1994 |
1864 | =item strNE |
1865 | |
1866 | Test two strings to see if they are different. Returns true or |
1867 | false. |
1868 | |
1869 | bool strNE(char* s1, char* s2) |
1870 | |
497711e7 |
1871 | =for hackers |
1872 | Found in file handy.h |
1873 | |
954c1994 |
1874 | =item strnEQ |
1875 | |
1876 | Test two strings to see if they are equal. The C<len> parameter indicates |
1877 | the number of bytes to compare. Returns true or false. (A wrapper for |
1878 | C<strncmp>). |
1879 | |
1880 | bool strnEQ(char* s1, char* s2, STRLEN len) |
1881 | |
497711e7 |
1882 | =for hackers |
1883 | Found in file handy.h |
1884 | |
954c1994 |
1885 | =item strnNE |
1886 | |
1887 | Test two strings to see if they are different. The C<len> parameter |
1888 | indicates the number of bytes to compare. Returns true or false. (A |
1889 | wrapper for C<strncmp>). |
1890 | |
1891 | bool strnNE(char* s1, char* s2, STRLEN len) |
1892 | |
497711e7 |
1893 | =for hackers |
1894 | Found in file handy.h |
1895 | |
954c1994 |
1896 | =item StructCopy |
1897 | |
4375e838 |
1898 | This is an architecture-independent macro to copy one structure to another. |
954c1994 |
1899 | |
1900 | void StructCopy(type src, type dest, type) |
1901 | |
497711e7 |
1902 | =for hackers |
1903 | Found in file handy.h |
1904 | |
954c1994 |
1905 | =item SvCUR |
1906 | |
1907 | Returns the length of the string which is in the SV. See C<SvLEN>. |
1908 | |
1909 | STRLEN SvCUR(SV* sv) |
1910 | |
497711e7 |
1911 | =for hackers |
1912 | Found in file sv.h |
1913 | |
954c1994 |
1914 | =item SvCUR_set |
1915 | |
1916 | Set the length of the string which is in the SV. See C<SvCUR>. |
1917 | |
1918 | void SvCUR_set(SV* sv, STRLEN len) |
1919 | |
497711e7 |
1920 | =for hackers |
1921 | Found in file sv.h |
1922 | |
954c1994 |
1923 | =item SvEND |
1924 | |
1925 | Returns a pointer to the last character in the string which is in the SV. |
1926 | See C<SvCUR>. Access the character as *(SvEND(sv)). |
1927 | |
1928 | char* SvEND(SV* sv) |
1929 | |
497711e7 |
1930 | =for hackers |
1931 | Found in file sv.h |
1932 | |
954c1994 |
1933 | =item SvGETMAGIC |
1934 | |
1935 | Invokes C<mg_get> on an SV if it has 'get' magic. This macro evaluates its |
1936 | argument more than once. |
1937 | |
1938 | void SvGETMAGIC(SV* sv) |
1939 | |
497711e7 |
1940 | =for hackers |
1941 | Found in file sv.h |
1942 | |
954c1994 |
1943 | =item SvGROW |
1944 | |
1945 | Expands the character buffer in the SV so that it has room for the |
1946 | indicated number of bytes (remember to reserve space for an extra trailing |
1947 | NUL character). Calls C<sv_grow> to perform the expansion if necessary. |
1948 | Returns a pointer to the character buffer. |
1949 | |
1950 | void SvGROW(SV* sv, STRLEN len) |
1951 | |
497711e7 |
1952 | =for hackers |
1953 | Found in file sv.h |
1954 | |
954c1994 |
1955 | =item SvIOK |
1956 | |
1957 | Returns a boolean indicating whether the SV contains an integer. |
1958 | |
1959 | bool SvIOK(SV* sv) |
1960 | |
497711e7 |
1961 | =for hackers |
1962 | Found in file sv.h |
1963 | |
954c1994 |
1964 | =item SvIOKp |
1965 | |
1966 | Returns a boolean indicating whether the SV contains an integer. Checks |
1967 | the B<private> setting. Use C<SvIOK>. |
1968 | |
1969 | bool SvIOKp(SV* sv) |
1970 | |
497711e7 |
1971 | =for hackers |
1972 | Found in file sv.h |
1973 | |
e331fc52 |
1974 | =item SvIOK_notUV |
1975 | |
1976 | Returns a boolean indicating whether the SV contains an signed integer. |
1977 | |
1978 | void SvIOK_notUV(SV* sv) |
1979 | |
1980 | =for hackers |
1981 | Found in file sv.h |
1982 | |
954c1994 |
1983 | =item SvIOK_off |
1984 | |
1985 | Unsets the IV status of an SV. |
1986 | |
1987 | void SvIOK_off(SV* sv) |
1988 | |
497711e7 |
1989 | =for hackers |
1990 | Found in file sv.h |
1991 | |
954c1994 |
1992 | =item SvIOK_on |
1993 | |
1994 | Tells an SV that it is an integer. |
1995 | |
1996 | void SvIOK_on(SV* sv) |
1997 | |
497711e7 |
1998 | =for hackers |
1999 | Found in file sv.h |
2000 | |
954c1994 |
2001 | =item SvIOK_only |
2002 | |
2003 | Tells an SV that it is an integer and disables all other OK bits. |
2004 | |
2005 | void SvIOK_only(SV* sv) |
2006 | |
497711e7 |
2007 | =for hackers |
2008 | Found in file sv.h |
2009 | |
e331fc52 |
2010 | =item SvIOK_only_UV |
2011 | |
2012 | Tells and SV that it is an unsigned integer and disables all other OK bits. |
2013 | |
2014 | void SvIOK_only_UV(SV* sv) |
2015 | |
2016 | =for hackers |
2017 | Found in file sv.h |
2018 | |
2019 | =item SvIOK_UV |
2020 | |
2021 | Returns a boolean indicating whether the SV contains an unsigned integer. |
2022 | |
2023 | void SvIOK_UV(SV* sv) |
2024 | |
2025 | =for hackers |
2026 | Found in file sv.h |
2027 | |
954c1994 |
2028 | =item SvIV |
2029 | |
2030 | Coerces the given SV to an integer and returns it. |
2031 | |
2032 | IV SvIV(SV* sv) |
2033 | |
497711e7 |
2034 | =for hackers |
2035 | Found in file sv.h |
2036 | |
954c1994 |
2037 | =item SvIVX |
2038 | |
2039 | Returns the integer which is stored in the SV, assuming SvIOK is |
2040 | true. |
2041 | |
2042 | IV SvIVX(SV* sv) |
2043 | |
497711e7 |
2044 | =for hackers |
2045 | Found in file sv.h |
2046 | |
954c1994 |
2047 | =item SvLEN |
2048 | |
91e74348 |
2049 | Returns the size of the string buffer in the SV, not including any part |
2050 | attributable to C<SvOOK>. See C<SvCUR>. |
954c1994 |
2051 | |
2052 | STRLEN SvLEN(SV* sv) |
2053 | |
497711e7 |
2054 | =for hackers |
2055 | Found in file sv.h |
2056 | |
954c1994 |
2057 | =item SvNIOK |
2058 | |
2059 | Returns a boolean indicating whether the SV contains a number, integer or |
2060 | double. |
2061 | |
2062 | bool SvNIOK(SV* sv) |
2063 | |
497711e7 |
2064 | =for hackers |
2065 | Found in file sv.h |
2066 | |
954c1994 |
2067 | =item SvNIOKp |
2068 | |
2069 | Returns a boolean indicating whether the SV contains a number, integer or |
2070 | double. Checks the B<private> setting. Use C<SvNIOK>. |
2071 | |
2072 | bool SvNIOKp(SV* sv) |
2073 | |
497711e7 |
2074 | =for hackers |
2075 | Found in file sv.h |
2076 | |
954c1994 |
2077 | =item SvNIOK_off |
2078 | |
2079 | Unsets the NV/IV status of an SV. |
2080 | |
2081 | void SvNIOK_off(SV* sv) |
2082 | |
497711e7 |
2083 | =for hackers |
2084 | Found in file sv.h |
2085 | |
954c1994 |
2086 | =item SvNOK |
2087 | |
2088 | Returns a boolean indicating whether the SV contains a double. |
2089 | |
2090 | bool SvNOK(SV* sv) |
2091 | |
497711e7 |
2092 | =for hackers |
2093 | Found in file sv.h |
2094 | |
954c1994 |
2095 | =item SvNOKp |
2096 | |
2097 | Returns a boolean indicating whether the SV contains a double. Checks the |
2098 | B<private> setting. Use C<SvNOK>. |
2099 | |
2100 | bool SvNOKp(SV* sv) |
2101 | |
497711e7 |
2102 | =for hackers |
2103 | Found in file sv.h |
2104 | |
954c1994 |
2105 | =item SvNOK_off |
2106 | |
2107 | Unsets the NV status of an SV. |
2108 | |
2109 | void SvNOK_off(SV* sv) |
2110 | |
497711e7 |
2111 | =for hackers |
2112 | Found in file sv.h |
2113 | |
954c1994 |
2114 | =item SvNOK_on |
2115 | |
2116 | Tells an SV that it is a double. |
2117 | |
2118 | void SvNOK_on(SV* sv) |
2119 | |
497711e7 |
2120 | =for hackers |
2121 | Found in file sv.h |
2122 | |
954c1994 |
2123 | =item SvNOK_only |
2124 | |
2125 | Tells an SV that it is a double and disables all other OK bits. |
2126 | |
2127 | void SvNOK_only(SV* sv) |
2128 | |
497711e7 |
2129 | =for hackers |
2130 | Found in file sv.h |
2131 | |
954c1994 |
2132 | =item SvNV |
2133 | |
2134 | Coerce the given SV to a double and return it. |
2135 | |
2136 | NV SvNV(SV* sv) |
2137 | |
497711e7 |
2138 | =for hackers |
2139 | Found in file sv.h |
2140 | |
954c1994 |
2141 | =item SvNVX |
2142 | |
2143 | Returns the double which is stored in the SV, assuming SvNOK is |
2144 | true. |
2145 | |
2146 | NV SvNVX(SV* sv) |
2147 | |
497711e7 |
2148 | =for hackers |
2149 | Found in file sv.h |
2150 | |
954c1994 |
2151 | =item SvOK |
2152 | |
2153 | Returns a boolean indicating whether the value is an SV. |
2154 | |
2155 | bool SvOK(SV* sv) |
2156 | |
497711e7 |
2157 | =for hackers |
2158 | Found in file sv.h |
2159 | |
954c1994 |
2160 | =item SvOOK |
2161 | |
2162 | Returns a boolean indicating whether the SvIVX is a valid offset value for |
2163 | the SvPVX. This hack is used internally to speed up removal of characters |
2164 | from the beginning of a SvPV. When SvOOK is true, then the start of the |
2165 | allocated string buffer is really (SvPVX - SvIVX). |
2166 | |
2167 | bool SvOOK(SV* sv) |
2168 | |
497711e7 |
2169 | =for hackers |
2170 | Found in file sv.h |
2171 | |
954c1994 |
2172 | =item SvPOK |
2173 | |
2174 | Returns a boolean indicating whether the SV contains a character |
2175 | string. |
2176 | |
2177 | bool SvPOK(SV* sv) |
2178 | |
497711e7 |
2179 | =for hackers |
2180 | Found in file sv.h |
2181 | |
954c1994 |
2182 | =item SvPOKp |
2183 | |
2184 | Returns a boolean indicating whether the SV contains a character string. |
2185 | Checks the B<private> setting. Use C<SvPOK>. |
2186 | |
2187 | bool SvPOKp(SV* sv) |
2188 | |
497711e7 |
2189 | =for hackers |
2190 | Found in file sv.h |
2191 | |
954c1994 |
2192 | =item SvPOK_off |
2193 | |
2194 | Unsets the PV status of an SV. |
2195 | |
2196 | void SvPOK_off(SV* sv) |
2197 | |
497711e7 |
2198 | =for hackers |
2199 | Found in file sv.h |
2200 | |
954c1994 |
2201 | =item SvPOK_on |
2202 | |
2203 | Tells an SV that it is a string. |
2204 | |
2205 | void SvPOK_on(SV* sv) |
2206 | |
497711e7 |
2207 | =for hackers |
2208 | Found in file sv.h |
2209 | |
954c1994 |
2210 | =item SvPOK_only |
2211 | |
2212 | Tells an SV that it is a string and disables all other OK bits. |
2213 | |
2214 | void SvPOK_only(SV* sv) |
2215 | |
497711e7 |
2216 | =for hackers |
2217 | Found in file sv.h |
2218 | |
914184e1 |
2219 | =item SvPOK_only_UTF8 |
2220 | |
2221 | Tells an SV that it is a UTF8 string (do not use frivolously) |
2222 | and disables all other OK bits. |
2223 | |
2224 | void SvPOK_only_UTF8(SV* sv) |
2225 | |
2226 | =for hackers |
2227 | Found in file sv.h |
2228 | |
954c1994 |
2229 | =item SvPV |
2230 | |
2231 | Returns a pointer to the string in the SV, or a stringified form of the SV |
2232 | if the SV does not contain a string. Handles 'get' magic. |
2233 | |
2234 | char* SvPV(SV* sv, STRLEN len) |
2235 | |
497711e7 |
2236 | =for hackers |
2237 | Found in file sv.h |
2238 | |
954c1994 |
2239 | =item SvPVX |
2240 | |
2241 | Returns a pointer to the string in the SV. The SV must contain a |
2242 | string. |
2243 | |
2244 | char* SvPVX(SV* sv) |
2245 | |
497711e7 |
2246 | =for hackers |
2247 | Found in file sv.h |
2248 | |
954c1994 |
2249 | =item SvPV_force |
2250 | |
2251 | Like <SvPV> but will force the SV into becoming a string (SvPOK). You want |
2252 | force if you are going to update the SvPVX directly. |
2253 | |
2254 | char* SvPV_force(SV* sv, STRLEN len) |
2255 | |
497711e7 |
2256 | =for hackers |
2257 | Found in file sv.h |
2258 | |
954c1994 |
2259 | =item SvPV_nolen |
2260 | |
2261 | Returns a pointer to the string in the SV, or a stringified form of the SV |
2262 | if the SV does not contain a string. Handles 'get' magic. |
2263 | |
2264 | char* SvPV_nolen(SV* sv) |
2265 | |
497711e7 |
2266 | =for hackers |
2267 | Found in file sv.h |
2268 | |
954c1994 |
2269 | =item SvREFCNT |
2270 | |
2271 | Returns the value of the object's reference count. |
2272 | |
2273 | U32 SvREFCNT(SV* sv) |
2274 | |
497711e7 |
2275 | =for hackers |
2276 | Found in file sv.h |
2277 | |
954c1994 |
2278 | =item SvREFCNT_dec |
2279 | |
2280 | Decrements the reference count of the given SV. |
2281 | |
2282 | void SvREFCNT_dec(SV* sv) |
2283 | |
497711e7 |
2284 | =for hackers |
2285 | Found in file sv.h |
2286 | |
954c1994 |
2287 | =item SvREFCNT_inc |
2288 | |
2289 | Increments the reference count of the given SV. |
2290 | |
2291 | SV* SvREFCNT_inc(SV* sv) |
2292 | |
497711e7 |
2293 | =for hackers |
2294 | Found in file sv.h |
2295 | |
954c1994 |
2296 | =item SvROK |
2297 | |
2298 | Tests if the SV is an RV. |
2299 | |
2300 | bool SvROK(SV* sv) |
2301 | |
497711e7 |
2302 | =for hackers |
2303 | Found in file sv.h |
2304 | |
954c1994 |
2305 | =item SvROK_off |
2306 | |
2307 | Unsets the RV status of an SV. |
2308 | |
2309 | void SvROK_off(SV* sv) |
2310 | |
497711e7 |
2311 | =for hackers |
2312 | Found in file sv.h |
2313 | |
954c1994 |
2314 | =item SvROK_on |
2315 | |
2316 | Tells an SV that it is an RV. |
2317 | |
2318 | void SvROK_on(SV* sv) |
2319 | |
497711e7 |
2320 | =for hackers |
2321 | Found in file sv.h |
2322 | |
954c1994 |
2323 | =item SvRV |
2324 | |
2325 | Dereferences an RV to return the SV. |
2326 | |
2327 | SV* SvRV(SV* sv) |
2328 | |
497711e7 |
2329 | =for hackers |
2330 | Found in file sv.h |
2331 | |
954c1994 |
2332 | =item SvSETMAGIC |
2333 | |
2334 | Invokes C<mg_set> on an SV if it has 'set' magic. This macro evaluates its |
2335 | argument more than once. |
2336 | |
2337 | void SvSETMAGIC(SV* sv) |
2338 | |
497711e7 |
2339 | =for hackers |
2340 | Found in file sv.h |
2341 | |
954c1994 |
2342 | =item SvSetSV |
2343 | |
2344 | Calls C<sv_setsv> if dsv is not the same as ssv. May evaluate arguments |
2345 | more than once. |
2346 | |
2347 | void SvSetSV(SV* dsb, SV* ssv) |
2348 | |
497711e7 |
2349 | =for hackers |
2350 | Found in file sv.h |
2351 | |
954c1994 |
2352 | =item SvSetSV_nosteal |
2353 | |
2354 | Calls a non-destructive version of C<sv_setsv> if dsv is not the same as |
2355 | ssv. May evaluate arguments more than once. |
2356 | |
2357 | void SvSetSV_nosteal(SV* dsv, SV* ssv) |
2358 | |
497711e7 |
2359 | =for hackers |
2360 | Found in file sv.h |
2361 | |
954c1994 |
2362 | =item SvSTASH |
2363 | |
2364 | Returns the stash of the SV. |
2365 | |
2366 | HV* SvSTASH(SV* sv) |
2367 | |
497711e7 |
2368 | =for hackers |
2369 | Found in file sv.h |
2370 | |
954c1994 |
2371 | =item SvTAINT |
2372 | |
2373 | Taints an SV if tainting is enabled |
2374 | |
2375 | void SvTAINT(SV* sv) |
2376 | |
497711e7 |
2377 | =for hackers |
2378 | Found in file sv.h |
2379 | |
954c1994 |
2380 | =item SvTAINTED |
2381 | |
2382 | Checks to see if an SV is tainted. Returns TRUE if it is, FALSE if |
2383 | not. |
2384 | |
2385 | bool SvTAINTED(SV* sv) |
2386 | |
497711e7 |
2387 | =for hackers |
2388 | Found in file sv.h |
2389 | |
954c1994 |
2390 | =item SvTAINTED_off |
2391 | |
2392 | Untaints an SV. Be I<very> careful with this routine, as it short-circuits |
2393 | some of Perl's fundamental security features. XS module authors should not |
2394 | use this function unless they fully understand all the implications of |
2395 | unconditionally untainting the value. Untainting should be done in the |
2396 | standard perl fashion, via a carefully crafted regexp, rather than directly |
2397 | untainting variables. |
2398 | |
2399 | void SvTAINTED_off(SV* sv) |
2400 | |
497711e7 |
2401 | =for hackers |
2402 | Found in file sv.h |
2403 | |
954c1994 |
2404 | =item SvTAINTED_on |
2405 | |
2406 | Marks an SV as tainted. |
2407 | |
2408 | void SvTAINTED_on(SV* sv) |
2409 | |
497711e7 |
2410 | =for hackers |
2411 | Found in file sv.h |
2412 | |
954c1994 |
2413 | =item SvTRUE |
2414 | |
2415 | Returns a boolean indicating whether Perl would evaluate the SV as true or |
2416 | false, defined or undefined. Does not handle 'get' magic. |
2417 | |
2418 | bool SvTRUE(SV* sv) |
2419 | |
497711e7 |
2420 | =for hackers |
2421 | Found in file sv.h |
2422 | |
eebe1485 |
2423 | =item svtype |
c155e47c |
2424 | |
eebe1485 |
2425 | An enum of flags for Perl types. These are found in the file B<sv.h> |
2426 | in the C<svtype> enum. Test these flags with the C<SvTYPE> macro. |
34f7a5fe |
2427 | |
497711e7 |
2428 | =for hackers |
2429 | Found in file sv.h |
2430 | |
eebe1485 |
2431 | =item SvTYPE |
840a7b70 |
2432 | |
eebe1485 |
2433 | Returns the type of the SV. See C<svtype>. |
2434 | |
2435 | svtype SvTYPE(SV* sv) |
954c1994 |
2436 | |
497711e7 |
2437 | =for hackers |
2438 | Found in file sv.h |
2439 | |
954c1994 |
2440 | =item SVt_IV |
2441 | |
2442 | Integer type flag for scalars. See C<svtype>. |
2443 | |
497711e7 |
2444 | =for hackers |
2445 | Found in file sv.h |
2446 | |
954c1994 |
2447 | =item SVt_NV |
2448 | |
2449 | Double type flag for scalars. See C<svtype>. |
2450 | |
497711e7 |
2451 | =for hackers |
2452 | Found in file sv.h |
2453 | |
954c1994 |
2454 | =item SVt_PV |
2455 | |
2456 | Pointer type flag for scalars. See C<svtype>. |
2457 | |
497711e7 |
2458 | =for hackers |
2459 | Found in file sv.h |
2460 | |
954c1994 |
2461 | =item SVt_PVAV |
2462 | |
2463 | Type flag for arrays. See C<svtype>. |
2464 | |
497711e7 |
2465 | =for hackers |
2466 | Found in file sv.h |
2467 | |
954c1994 |
2468 | =item SVt_PVCV |
2469 | |
2470 | Type flag for code refs. See C<svtype>. |
2471 | |
497711e7 |
2472 | =for hackers |
2473 | Found in file sv.h |
2474 | |
954c1994 |
2475 | =item SVt_PVHV |
2476 | |
2477 | Type flag for hashes. See C<svtype>. |
2478 | |
497711e7 |
2479 | =for hackers |
2480 | Found in file sv.h |
2481 | |
954c1994 |
2482 | =item SVt_PVMG |
2483 | |
2484 | Type flag for blessed scalars. See C<svtype>. |
2485 | |
497711e7 |
2486 | =for hackers |
2487 | Found in file sv.h |
2488 | |
a8586c98 |
2489 | =item SvUOK |
2490 | |
2491 | Returns a boolean indicating whether the SV contains an unsigned integer. |
2492 | |
2493 | void SvUOK(SV* sv) |
2494 | |
2495 | =for hackers |
2496 | Found in file sv.h |
2497 | |
954c1994 |
2498 | =item SvUPGRADE |
2499 | |
2500 | Used to upgrade an SV to a more complex form. Uses C<sv_upgrade> to |
2501 | perform the upgrade if necessary. See C<svtype>. |
2502 | |
2503 | void SvUPGRADE(SV* sv, svtype type) |
2504 | |
497711e7 |
2505 | =for hackers |
2506 | Found in file sv.h |
2507 | |
914184e1 |
2508 | =item SvUTF8 |
2509 | |
2510 | Returns a boolean indicating whether the SV contains UTF-8 encoded data. |
2511 | |
2512 | void SvUTF8(SV* sv) |
2513 | |
2514 | =for hackers |
2515 | Found in file sv.h |
2516 | |
2517 | =item SvUTF8_off |
2518 | |
2519 | Unsets the UTF8 status of an SV. |
2520 | |
2521 | void SvUTF8_off(SV *sv) |
2522 | |
2523 | =for hackers |
2524 | Found in file sv.h |
2525 | |
2526 | =item SvUTF8_on |
2527 | |
2528 | Tells an SV that it is a string and encoded in UTF8. Do not use frivolously. |
2529 | |
2530 | void SvUTF8_on(SV *sv) |
2531 | |
2532 | =for hackers |
2533 | Found in file sv.h |
2534 | |
954c1994 |
2535 | =item SvUV |
2536 | |
2537 | Coerces the given SV to an unsigned integer and returns it. |
2538 | |
2539 | UV SvUV(SV* sv) |
2540 | |
497711e7 |
2541 | =for hackers |
2542 | Found in file sv.h |
2543 | |
954c1994 |
2544 | =item SvUVX |
2545 | |
2546 | Returns the unsigned integer which is stored in the SV, assuming SvIOK is |
2547 | true. |
2548 | |
2549 | UV SvUVX(SV* sv) |
2550 | |
497711e7 |
2551 | =for hackers |
2552 | Found in file sv.h |
2553 | |
954c1994 |
2554 | =item sv_2mortal |
2555 | |
2556 | Marks an SV as mortal. The SV will be destroyed when the current context |
2557 | ends. |
2558 | |
2559 | SV* sv_2mortal(SV* sv) |
2560 | |
497711e7 |
2561 | =for hackers |
2562 | Found in file sv.c |
2563 | |
954c1994 |
2564 | =item sv_bless |
2565 | |
2566 | Blesses an SV into a specified package. The SV must be an RV. The package |
2567 | must be designated by its stash (see C<gv_stashpv()>). The reference count |
2568 | of the SV is unaffected. |
2569 | |
2570 | SV* sv_bless(SV* sv, HV* stash) |
2571 | |
497711e7 |
2572 | =for hackers |
2573 | Found in file sv.c |
2574 | |
954c1994 |
2575 | =item sv_catpv |
2576 | |
2577 | Concatenates the string onto the end of the string which is in the SV. |
2578 | Handles 'get' magic, but not 'set' magic. See C<sv_catpv_mg>. |
2579 | |
2580 | void sv_catpv(SV* sv, const char* ptr) |
2581 | |
497711e7 |
2582 | =for hackers |
2583 | Found in file sv.c |
2584 | |
954c1994 |
2585 | =item sv_catpvf |
2586 | |
2587 | Processes its arguments like C<sprintf> and appends the formatted output |
2588 | to an SV. Handles 'get' magic, but not 'set' magic. C<SvSETMAGIC()> must |
2589 | typically be called after calling this function to handle 'set' magic. |
2590 | |
2591 | void sv_catpvf(SV* sv, const char* pat, ...) |
2592 | |
497711e7 |
2593 | =for hackers |
2594 | Found in file sv.c |
2595 | |
954c1994 |
2596 | =item sv_catpvf_mg |
2597 | |
2598 | Like C<sv_catpvf>, but also handles 'set' magic. |
2599 | |
2600 | void sv_catpvf_mg(SV *sv, const char* pat, ...) |
2601 | |
497711e7 |
2602 | =for hackers |
2603 | Found in file sv.c |
2604 | |
954c1994 |
2605 | =item sv_catpvn |
2606 | |
2607 | Concatenates the string onto the end of the string which is in the SV. The |
2608 | C<len> indicates number of bytes to copy. Handles 'get' magic, but not |
2609 | 'set' magic. See C<sv_catpvn_mg>. |
2610 | |
2611 | void sv_catpvn(SV* sv, const char* ptr, STRLEN len) |
2612 | |
497711e7 |
2613 | =for hackers |
2614 | Found in file sv.c |
2615 | |
954c1994 |
2616 | =item sv_catpvn_mg |
2617 | |
2618 | Like C<sv_catpvn>, but also handles 'set' magic. |
2619 | |
2620 | void sv_catpvn_mg(SV *sv, const char *ptr, STRLEN len) |
2621 | |
497711e7 |
2622 | =for hackers |
2623 | Found in file sv.c |
2624 | |
954c1994 |
2625 | =item sv_catpv_mg |
2626 | |
2627 | Like C<sv_catpv>, but also handles 'set' magic. |
2628 | |
2629 | void sv_catpv_mg(SV *sv, const char *ptr) |
2630 | |
497711e7 |
2631 | =for hackers |
2632 | Found in file sv.c |
2633 | |
954c1994 |
2634 | =item sv_catsv |
2635 | |
1aa99e6b |
2636 | Concatenates the string from SV C<ssv> onto the end of the string in |
2637 | SV C<dsv>. Modifies C<dsv> but not C<ssv>. Handles 'get' magic, but |
2638 | not 'set' magic. See C<sv_catsv_mg>. |
954c1994 |
2639 | |
2640 | void sv_catsv(SV* dsv, SV* ssv) |
2641 | |
497711e7 |
2642 | =for hackers |
2643 | Found in file sv.c |
2644 | |
954c1994 |
2645 | =item sv_catsv_mg |
2646 | |
2647 | Like C<sv_catsv>, but also handles 'set' magic. |
2648 | |
2649 | void sv_catsv_mg(SV *dstr, SV *sstr) |
2650 | |
497711e7 |
2651 | =for hackers |
2652 | Found in file sv.c |
2653 | |
954c1994 |
2654 | =item sv_chop |
2655 | |
1c846c1f |
2656 | Efficient removal of characters from the beginning of the string buffer. |
954c1994 |
2657 | SvPOK(sv) must be true and the C<ptr> must be a pointer to somewhere inside |
2658 | the string buffer. The C<ptr> becomes the first character of the adjusted |
2659 | string. |
2660 | |
2661 | void sv_chop(SV* sv, char* ptr) |
2662 | |
497711e7 |
2663 | =for hackers |
2664 | Found in file sv.c |
2665 | |
c461cf8f |
2666 | =item sv_clear |
2667 | |
2668 | Clear an SV, making it empty. Does not free the memory used by the SV |
2669 | itself. |
2670 | |
2671 | void sv_clear(SV* sv) |
2672 | |
2673 | =for hackers |
2674 | Found in file sv.c |
2675 | |
954c1994 |
2676 | =item sv_cmp |
2677 | |
2678 | Compares the strings in two SVs. Returns -1, 0, or 1 indicating whether the |
2679 | string in C<sv1> is less than, equal to, or greater than the string in |
2680 | C<sv2>. |
2681 | |
2682 | I32 sv_cmp(SV* sv1, SV* sv2) |
2683 | |
497711e7 |
2684 | =for hackers |
2685 | Found in file sv.c |
2686 | |
c461cf8f |
2687 | =item sv_cmp_locale |
2688 | |
2689 | Compares the strings in two SVs in a locale-aware manner. See |
2690 | L</sv_cmp_locale> |
2691 | |
2692 | I32 sv_cmp_locale(SV* sv1, SV* sv2) |
2693 | |
2694 | =for hackers |
2695 | Found in file sv.c |
2696 | |
954c1994 |
2697 | =item sv_dec |
2698 | |
2699 | Auto-decrement of the value in the SV. |
2700 | |
2701 | void sv_dec(SV* sv) |
2702 | |
497711e7 |
2703 | =for hackers |
2704 | Found in file sv.c |
2705 | |
954c1994 |
2706 | =item sv_derived_from |
2707 | |
2708 | Returns a boolean indicating whether the SV is derived from the specified |
2709 | class. This is the function that implements C<UNIVERSAL::isa>. It works |
2710 | for class names as well as for objects. |
2711 | |
2712 | bool sv_derived_from(SV* sv, const char* name) |
2713 | |
497711e7 |
2714 | =for hackers |
2715 | Found in file universal.c |
2716 | |
954c1994 |
2717 | =item sv_eq |
2718 | |
2719 | Returns a boolean indicating whether the strings in the two SVs are |
2720 | identical. |
2721 | |
2722 | I32 sv_eq(SV* sv1, SV* sv2) |
2723 | |
497711e7 |
2724 | =for hackers |
2725 | Found in file sv.c |
2726 | |
c461cf8f |
2727 | =item sv_free |
2728 | |
2729 | Free the memory used by an SV. |
2730 | |
2731 | void sv_free(SV* sv) |
2732 | |
2733 | =for hackers |
2734 | Found in file sv.c |
2735 | |
2736 | =item sv_gets |
2737 | |
2738 | Get a line from the filehandle and store it into the SV, optionally |
2739 | appending to the currently-stored string. |
2740 | |
2741 | char* sv_gets(SV* sv, PerlIO* fp, I32 append) |
2742 | |
2743 | =for hackers |
2744 | Found in file sv.c |
2745 | |
954c1994 |
2746 | =item sv_grow |
2747 | |
2748 | Expands the character buffer in the SV. This will use C<sv_unref> and will |
2749 | upgrade the SV to C<SVt_PV>. Returns a pointer to the character buffer. |
2750 | Use C<SvGROW>. |
2751 | |
2752 | char* sv_grow(SV* sv, STRLEN newlen) |
2753 | |
497711e7 |
2754 | =for hackers |
2755 | Found in file sv.c |
2756 | |
954c1994 |
2757 | =item sv_inc |
2758 | |
2759 | Auto-increment of the value in the SV. |
2760 | |
2761 | void sv_inc(SV* sv) |
2762 | |
497711e7 |
2763 | =for hackers |
2764 | Found in file sv.c |
2765 | |
954c1994 |
2766 | =item sv_insert |
2767 | |
2768 | Inserts a string at the specified offset/length within the SV. Similar to |
2769 | the Perl substr() function. |
2770 | |
2771 | void sv_insert(SV* bigsv, STRLEN offset, STRLEN len, char* little, STRLEN littlelen) |
2772 | |
497711e7 |
2773 | =for hackers |
2774 | Found in file sv.c |
2775 | |
954c1994 |
2776 | =item sv_isa |
2777 | |
2778 | Returns a boolean indicating whether the SV is blessed into the specified |
2779 | class. This does not check for subtypes; use C<sv_derived_from> to verify |
2780 | an inheritance relationship. |
2781 | |
2782 | int sv_isa(SV* sv, const char* name) |
2783 | |
497711e7 |
2784 | =for hackers |
2785 | Found in file sv.c |
2786 | |
954c1994 |
2787 | =item sv_isobject |
2788 | |
2789 | Returns a boolean indicating whether the SV is an RV pointing to a blessed |
2790 | object. If the SV is not an RV, or if the object is not blessed, then this |
2791 | will return false. |
2792 | |
2793 | int sv_isobject(SV* sv) |
2794 | |
497711e7 |
2795 | =for hackers |
2796 | Found in file sv.c |
2797 | |
954c1994 |
2798 | =item sv_len |
2799 | |
2800 | Returns the length of the string in the SV. See also C<SvCUR>. |
2801 | |
2802 | STRLEN sv_len(SV* sv) |
2803 | |
497711e7 |
2804 | =for hackers |
2805 | Found in file sv.c |
2806 | |
c461cf8f |
2807 | =item sv_len_utf8 |
2808 | |
2809 | Returns the number of characters in the string in an SV, counting wide |
2810 | UTF8 bytes as a single character. |
2811 | |
2812 | STRLEN sv_len_utf8(SV* sv) |
2813 | |
2814 | =for hackers |
2815 | Found in file sv.c |
2816 | |
954c1994 |
2817 | =item sv_magic |
2818 | |
2819 | Adds magic to an SV. |
2820 | |
2821 | void sv_magic(SV* sv, SV* obj, int how, const char* name, I32 namlen) |
2822 | |
497711e7 |
2823 | =for hackers |
2824 | Found in file sv.c |
2825 | |
954c1994 |
2826 | =item sv_mortalcopy |
2827 | |
2828 | Creates a new SV which is a copy of the original SV. The new SV is marked |
2829 | as mortal. |
2830 | |
2831 | SV* sv_mortalcopy(SV* oldsv) |
2832 | |
497711e7 |
2833 | =for hackers |
2834 | Found in file sv.c |
2835 | |
954c1994 |
2836 | =item sv_newmortal |
2837 | |
2838 | Creates a new SV which is mortal. The reference count of the SV is set to 1. |
2839 | |
2840 | SV* sv_newmortal() |
2841 | |
497711e7 |
2842 | =for hackers |
2843 | Found in file sv.c |
2844 | |
c461cf8f |
2845 | =item sv_pvn_force |
2846 | |
2847 | Get a sensible string out of the SV somehow. |
2848 | |
2849 | char* sv_pvn_force(SV* sv, STRLEN* lp) |
2850 | |
2851 | =for hackers |
2852 | Found in file sv.c |
2853 | |
2854 | =item sv_pvutf8n_force |
2855 | |
2856 | Get a sensible UTF8-encoded string out of the SV somehow. See |
2857 | L</sv_pvn_force>. |
2858 | |
2859 | char* sv_pvutf8n_force(SV* sv, STRLEN* lp) |
2860 | |
2861 | =for hackers |
2862 | Found in file sv.c |
2863 | |
2864 | =item sv_reftype |
2865 | |
2866 | Returns a string describing what the SV is a reference to. |
2867 | |
2868 | char* sv_reftype(SV* sv, int ob) |
2869 | |
2870 | =for hackers |
2871 | Found in file sv.c |
2872 | |
2873 | =item sv_replace |
2874 | |
2875 | Make the first argument a copy of the second, then delete the original. |
2876 | |
2877 | void sv_replace(SV* sv, SV* nsv) |
2878 | |
2879 | =for hackers |
2880 | Found in file sv.c |
2881 | |
2882 | =item sv_rvweaken |
2883 | |
2884 | Weaken a reference. |
2885 | |
2886 | SV* sv_rvweaken(SV *sv) |
2887 | |
2888 | =for hackers |
2889 | Found in file sv.c |
2890 | |
954c1994 |
2891 | =item sv_setiv |
2892 | |
2893 | Copies an integer into the given SV. Does not handle 'set' magic. See |
2894 | C<sv_setiv_mg>. |
2895 | |
2896 | void sv_setiv(SV* sv, IV num) |
2897 | |
497711e7 |
2898 | =for hackers |
2899 | Found in file sv.c |
2900 | |
954c1994 |
2901 | =item sv_setiv_mg |
2902 | |
2903 | Like C<sv_setiv>, but also handles 'set' magic. |
2904 | |
2905 | void sv_setiv_mg(SV *sv, IV i) |
2906 | |
497711e7 |
2907 | =for hackers |
2908 | Found in file sv.c |
2909 | |
954c1994 |
2910 | =item sv_setnv |
2911 | |
2912 | Copies a double into the given SV. Does not handle 'set' magic. See |
2913 | C<sv_setnv_mg>. |
2914 | |
2915 | void sv_setnv(SV* sv, NV num) |
2916 | |
497711e7 |
2917 | =for hackers |
2918 | Found in file sv.c |
2919 | |
954c1994 |
2920 | =item sv_setnv_mg |
2921 | |
2922 | Like C<sv_setnv>, but also handles 'set' magic. |
2923 | |
2924 | void sv_setnv_mg(SV *sv, NV num) |
2925 | |
497711e7 |
2926 | =for hackers |
2927 | Found in file sv.c |
2928 | |
954c1994 |
2929 | =item sv_setpv |
2930 | |
2931 | Copies a string into an SV. The string must be null-terminated. Does not |
2932 | handle 'set' magic. See C<sv_setpv_mg>. |
2933 | |
2934 | void sv_setpv(SV* sv, const char* ptr) |
2935 | |
497711e7 |
2936 | =for hackers |
2937 | Found in file sv.c |
2938 | |
954c1994 |
2939 | =item sv_setpvf |
2940 | |
2941 | Processes its arguments like C<sprintf> and sets an SV to the formatted |
2942 | output. Does not handle 'set' magic. See C<sv_setpvf_mg>. |
2943 | |
2944 | void sv_setpvf(SV* sv, const char* pat, ...) |
2945 | |
497711e7 |
2946 | =for hackers |
2947 | Found in file sv.c |
2948 | |
954c1994 |
2949 | =item sv_setpvf_mg |
2950 | |
2951 | Like C<sv_setpvf>, but also handles 'set' magic. |
2952 | |
2953 | void sv_setpvf_mg(SV *sv, const char* pat, ...) |
2954 | |
497711e7 |
2955 | =for hackers |
2956 | Found in file sv.c |
2957 | |
954c1994 |
2958 | =item sv_setpviv |
2959 | |
2960 | Copies an integer into the given SV, also updating its string value. |
2961 | Does not handle 'set' magic. See C<sv_setpviv_mg>. |
2962 | |
2963 | void sv_setpviv(SV* sv, IV num) |
2964 | |
497711e7 |
2965 | =for hackers |
2966 | Found in file sv.c |
2967 | |
954c1994 |
2968 | =item sv_setpviv_mg |
2969 | |
2970 | Like C<sv_setpviv>, but also handles 'set' magic. |
2971 | |
2972 | void sv_setpviv_mg(SV *sv, IV iv) |
2973 | |
497711e7 |
2974 | =for hackers |
2975 | Found in file sv.c |
2976 | |
954c1994 |
2977 | =item sv_setpvn |
2978 | |
2979 | Copies a string into an SV. The C<len> parameter indicates the number of |
2980 | bytes to be copied. Does not handle 'set' magic. See C<sv_setpvn_mg>. |
2981 | |
2982 | void sv_setpvn(SV* sv, const char* ptr, STRLEN len) |
2983 | |
497711e7 |
2984 | =for hackers |
2985 | Found in file sv.c |
2986 | |
954c1994 |
2987 | =item sv_setpvn_mg |
2988 | |
2989 | Like C<sv_setpvn>, but also handles 'set' magic. |
2990 | |
2991 | void sv_setpvn_mg(SV *sv, const char *ptr, STRLEN len) |
2992 | |
497711e7 |
2993 | =for hackers |
2994 | Found in file sv.c |
2995 | |
954c1994 |
2996 | =item sv_setpv_mg |
2997 | |
2998 | Like C<sv_setpv>, but also handles 'set' magic. |
2999 | |
3000 | void sv_setpv_mg(SV *sv, const char *ptr) |
3001 | |
497711e7 |
3002 | =for hackers |
3003 | Found in file sv.c |
3004 | |
954c1994 |
3005 | =item sv_setref_iv |
3006 | |
3007 | Copies an integer into a new SV, optionally blessing the SV. The C<rv> |
3008 | argument will be upgraded to an RV. That RV will be modified to point to |
3009 | the new SV. The C<classname> argument indicates the package for the |
3010 | blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV |
3011 | will be returned and will have a reference count of 1. |
3012 | |
3013 | SV* sv_setref_iv(SV* rv, const char* classname, IV iv) |
3014 | |
497711e7 |
3015 | =for hackers |
3016 | Found in file sv.c |
3017 | |
954c1994 |
3018 | =item sv_setref_nv |
3019 | |
3020 | Copies a double into a new SV, optionally blessing the SV. The C<rv> |
3021 | argument will be upgraded to an RV. That RV will be modified to point to |
3022 | the new SV. The C<classname> argument indicates the package for the |
3023 | blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV |
3024 | will be returned and will have a reference count of 1. |
3025 | |
3026 | SV* sv_setref_nv(SV* rv, const char* classname, NV nv) |
3027 | |
497711e7 |
3028 | =for hackers |
3029 | Found in file sv.c |
3030 | |
954c1994 |
3031 | =item sv_setref_pv |
3032 | |
3033 | Copies a pointer into a new SV, optionally blessing the SV. The C<rv> |
3034 | argument will be upgraded to an RV. That RV will be modified to point to |
3035 | the new SV. If the C<pv> argument is NULL then C<PL_sv_undef> will be placed |
3036 | into the SV. The C<classname> argument indicates the package for the |
3037 | blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV |
3038 | will be returned and will have a reference count of 1. |
3039 | |
3040 | Do not use with other Perl types such as HV, AV, SV, CV, because those |
3041 | objects will become corrupted by the pointer copy process. |
3042 | |
3043 | Note that C<sv_setref_pvn> copies the string while this copies the pointer. |
3044 | |
3045 | SV* sv_setref_pv(SV* rv, const char* classname, void* pv) |
3046 | |
497711e7 |
3047 | =for hackers |
3048 | Found in file sv.c |
3049 | |
954c1994 |
3050 | =item sv_setref_pvn |
3051 | |
3052 | Copies a string into a new SV, optionally blessing the SV. The length of the |
3053 | string must be specified with C<n>. The C<rv> argument will be upgraded to |
3054 | an RV. That RV will be modified to point to the new SV. The C<classname> |
3055 | argument indicates the package for the blessing. Set C<classname> to |
3056 | C<Nullch> to avoid the blessing. The new SV will be returned and will have |
3057 | a reference count of 1. |
3058 | |
3059 | Note that C<sv_setref_pv> copies the pointer while this copies the string. |
3060 | |
3061 | SV* sv_setref_pvn(SV* rv, const char* classname, char* pv, STRLEN n) |
3062 | |
497711e7 |
3063 | =for hackers |
3064 | Found in file sv.c |
3065 | |
954c1994 |
3066 | =item sv_setsv |
3067 | |
3068 | Copies the contents of the source SV C<ssv> into the destination SV C<dsv>. |
3069 | The source SV may be destroyed if it is mortal. Does not handle 'set' |
3070 | magic. See the macro forms C<SvSetSV>, C<SvSetSV_nosteal> and |
3071 | C<sv_setsv_mg>. |
3072 | |
3073 | void sv_setsv(SV* dsv, SV* ssv) |
3074 | |
497711e7 |
3075 | =for hackers |
3076 | Found in file sv.c |
3077 | |
954c1994 |
3078 | =item sv_setsv_mg |
3079 | |
3080 | Like C<sv_setsv>, but also handles 'set' magic. |
3081 | |
3082 | void sv_setsv_mg(SV *dstr, SV *sstr) |
3083 | |
497711e7 |
3084 | =for hackers |
3085 | Found in file sv.c |
3086 | |
954c1994 |
3087 | =item sv_setuv |
3088 | |
3089 | Copies an unsigned integer into the given SV. Does not handle 'set' magic. |
3090 | See C<sv_setuv_mg>. |
3091 | |
3092 | void sv_setuv(SV* sv, UV num) |
3093 | |
497711e7 |
3094 | =for hackers |
3095 | Found in file sv.c |
3096 | |
954c1994 |
3097 | =item sv_setuv_mg |
3098 | |
3099 | Like C<sv_setuv>, but also handles 'set' magic. |
3100 | |
3101 | void sv_setuv_mg(SV *sv, UV u) |
3102 | |
497711e7 |
3103 | =for hackers |
3104 | Found in file sv.c |
3105 | |
c461cf8f |
3106 | =item sv_true |
3107 | |
3108 | Returns true if the SV has a true value by Perl's rules. |
3109 | |
3110 | I32 sv_true(SV *sv) |
3111 | |
3112 | =for hackers |
3113 | Found in file sv.c |
3114 | |
3115 | =item sv_unmagic |
3116 | |
3117 | Removes magic from an SV. |
3118 | |
3119 | int sv_unmagic(SV* sv, int type) |
3120 | |
3121 | =for hackers |
3122 | Found in file sv.c |
3123 | |
954c1994 |
3124 | =item sv_unref |
3125 | |
3126 | Unsets the RV status of the SV, and decrements the reference count of |
3127 | whatever was being referenced by the RV. This can almost be thought of |
b06226ff |
3128 | as a reversal of C<newSVrv>. This is C<sv_unref_flags> with the C<flag> |
ae154d6d |
3129 | being zero. See C<SvROK_off>. |
954c1994 |
3130 | |
3131 | void sv_unref(SV* sv) |
3132 | |
497711e7 |
3133 | =for hackers |
3134 | Found in file sv.c |
3135 | |
840a7b70 |
3136 | =item sv_unref_flags |
3137 | |
3138 | Unsets the RV status of the SV, and decrements the reference count of |
3139 | whatever was being referenced by the RV. This can almost be thought of |
3140 | as a reversal of C<newSVrv>. The C<cflags> argument can contain |
3141 | C<SV_IMMEDIATE_UNREF> to force the reference count to be decremented |
3142 | (otherwise the decrementing is conditional on the reference count being |
3143 | different from one or the reference being a readonly SV). |
ae154d6d |
3144 | See C<SvROK_off>. |
840a7b70 |
3145 | |
3146 | void sv_unref_flags(SV* sv, U32 flags) |
3147 | |
3148 | =for hackers |
3149 | Found in file sv.c |
3150 | |
954c1994 |
3151 | =item sv_upgrade |
3152 | |
3153 | Upgrade an SV to a more complex form. Use C<SvUPGRADE>. See |
3154 | C<svtype>. |
3155 | |
3156 | bool sv_upgrade(SV* sv, U32 mt) |
3157 | |
497711e7 |
3158 | =for hackers |
3159 | Found in file sv.c |
3160 | |
954c1994 |
3161 | =item sv_usepvn |
3162 | |
3163 | Tells an SV to use C<ptr> to find its string value. Normally the string is |
1c846c1f |
3164 | stored inside the SV but sv_usepvn allows the SV to use an outside string. |
954c1994 |
3165 | The C<ptr> should point to memory that was allocated by C<malloc>. The |
3166 | string length, C<len>, must be supplied. This function will realloc the |
3167 | memory pointed to by C<ptr>, so that pointer should not be freed or used by |
3168 | the programmer after giving it to sv_usepvn. Does not handle 'set' magic. |
3169 | See C<sv_usepvn_mg>. |
3170 | |
3171 | void sv_usepvn(SV* sv, char* ptr, STRLEN len) |
3172 | |
497711e7 |
3173 | =for hackers |
3174 | Found in file sv.c |
3175 | |
954c1994 |
3176 | =item sv_usepvn_mg |
3177 | |
3178 | Like C<sv_usepvn>, but also handles 'set' magic. |
3179 | |
3180 | void sv_usepvn_mg(SV *sv, char *ptr, STRLEN len) |
3181 | |
497711e7 |
3182 | =for hackers |
3183 | Found in file sv.c |
3184 | |
c461cf8f |
3185 | =item sv_utf8_downgrade |
3186 | |
3187 | Attempt to convert the PV of an SV from UTF8-encoded to byte encoding. |
3188 | This may not be possible if the PV contains non-byte encoding characters; |
3189 | if this is the case, either returns false or, if C<fail_ok> is not |
3190 | true, croaks. |
3191 | |
3192 | NOTE: this function is experimental and may change or be |
3193 | removed without notice. |
3194 | |
3195 | bool sv_utf8_downgrade(SV *sv, bool fail_ok) |
3196 | |
3197 | =for hackers |
3198 | Found in file sv.c |
3199 | |
3200 | =item sv_utf8_encode |
3201 | |
3202 | Convert the PV of an SV to UTF8-encoded, but then turn off the C<SvUTF8> |
1c846c1f |
3203 | flag so that it looks like bytes again. Nothing calls this. |
c461cf8f |
3204 | |
3205 | NOTE: this function is experimental and may change or be |
3206 | removed without notice. |
3207 | |
3208 | void sv_utf8_encode(SV *sv) |
3209 | |
3210 | =for hackers |
3211 | Found in file sv.c |
3212 | |
3213 | =item sv_utf8_upgrade |
3214 | |
3215 | Convert the PV of an SV to its UTF8-encoded form. |
3216 | |
3217 | void sv_utf8_upgrade(SV *sv) |
3218 | |
3219 | =for hackers |
3220 | Found in file sv.c |
3221 | |
954c1994 |
3222 | =item sv_vcatpvfn |
3223 | |
3224 | Processes its arguments like C<vsprintf> and appends the formatted output |
3225 | to an SV. Uses an array of SVs if the C style variable argument list is |
3226 | missing (NULL). When running with taint checks enabled, indicates via |
3227 | C<maybe_tainted> if results are untrustworthy (often due to the use of |
3228 | locales). |
3229 | |
3230 | void sv_vcatpvfn(SV* sv, const char* pat, STRLEN patlen, va_list* args, SV** svargs, I32 svmax, bool *maybe_tainted) |
3231 | |
497711e7 |
3232 | =for hackers |
3233 | Found in file sv.c |
3234 | |
954c1994 |
3235 | =item sv_vsetpvfn |
3236 | |
3237 | Works like C<vcatpvfn> but copies the text into the SV instead of |
3238 | appending it. |
3239 | |
3240 | void sv_vsetpvfn(SV* sv, const char* pat, STRLEN patlen, va_list* args, SV** svargs, I32 svmax, bool *maybe_tainted) |
3241 | |
497711e7 |
3242 | =for hackers |
3243 | Found in file sv.c |
3244 | |
954c1994 |
3245 | =item THIS |
3246 | |
3247 | Variable which is setup by C<xsubpp> to designate the object in a C++ |
3248 | XSUB. This is always the proper type for the C++ object. See C<CLASS> and |
3249 | L<perlxs/"Using XS With C++">. |
3250 | |
3251 | (whatever) THIS |
3252 | |
497711e7 |
3253 | =for hackers |
3254 | Found in file XSUB.h |
3255 | |
954c1994 |
3256 | =item toLOWER |
3257 | |
3258 | Converts the specified character to lowercase. |
3259 | |
3260 | char toLOWER(char ch) |
3261 | |
497711e7 |
3262 | =for hackers |
3263 | Found in file handy.h |
3264 | |
954c1994 |
3265 | =item toUPPER |
3266 | |
3267 | Converts the specified character to uppercase. |
3268 | |
3269 | char toUPPER(char ch) |
3270 | |
497711e7 |
3271 | =for hackers |
3272 | Found in file handy.h |
3273 | |
b06226ff |
3274 | =item utf8_distance |
3275 | |
3276 | Returns the number of UTF8 characters between the UTF-8 pointers C<a> |
3277 | and C<b>. |
3278 | |
3279 | WARNING: use only if you *know* that the pointers point inside the |
3280 | same UTF-8 buffer. |
3281 | |
3282 | IV utf8_distance(U8 *a, U8 *b) |
3283 | |
3284 | =for hackers |
3285 | Found in file utf8.c |
3286 | |
3287 | =item utf8_hop |
3288 | |
8850bf83 |
3289 | Return the UTF-8 pointer C<s> displaced by C<off> characters, either |
3290 | forward or backward. |
b06226ff |
3291 | |
3292 | WARNING: do not use the following unless you *know* C<off> is within |
8850bf83 |
3293 | the UTF-8 data pointed to by C<s> *and* that on entry C<s> is aligned |
3294 | on the first byte of character or just after the last byte of a character. |
b06226ff |
3295 | |
3296 | U8* utf8_hop(U8 *s, I32 off) |
3297 | |
3298 | =for hackers |
3299 | Found in file utf8.c |
3300 | |
3301 | =item utf8_length |
3302 | |
3303 | Return the length of the UTF-8 char encoded string C<s> in characters. |
3304 | Stops at C<e> (inclusive). If C<e E<lt> s> or if the scan would end |
3305 | up past C<e>, croaks. |
3306 | |
3307 | STRLEN utf8_length(U8* s, U8 *e) |
3308 | |
3309 | =for hackers |
3310 | Found in file utf8.c |
3311 | |
497711e7 |
3312 | =item utf8_to_bytes |
3313 | |
246fae53 |
3314 | Converts a string C<s> of length C<len> from UTF8 into byte encoding. |
3315 | Unlike C<bytes_to_utf8>, this over-writes the original string, and |
3316 | updates len to contain the new length. |
67e989fb |
3317 | Returns zero on failure, setting C<len> to -1. |
497711e7 |
3318 | |
eebe1485 |
3319 | NOTE: this function is experimental and may change or be |
3320 | removed without notice. |
3321 | |
3322 | U8* utf8_to_bytes(U8 *s, STRLEN *len) |
497711e7 |
3323 | |
3324 | =for hackers |
3325 | Found in file utf8.c |
3326 | |
b6b716fe |
3327 | =item utf8_to_uv |
3328 | |
3329 | Returns the character value of the first character in the string C<s> |
dcad2880 |
3330 | which is assumed to be in UTF8 encoding and no longer than C<curlen>; |
1aa99e6b |
3331 | C<retlen> will be set to the length, in bytes, of that character. |
b6b716fe |
3332 | |
dcad2880 |
3333 | If C<s> does not point to a well-formed UTF8 character, the behaviour |
e9e021e6 |
3334 | is dependent on the value of C<flags>: if it contains UTF8_CHECK_ONLY, |
3335 | it is assumed that the caller will raise a warning, and this function |
28d3d195 |
3336 | will silently just set C<retlen> to C<-1> and return zero. If the |
3337 | C<flags> does not contain UTF8_CHECK_ONLY, warnings about |
3338 | malformations will be given, C<retlen> will be set to the expected |
3339 | length of the UTF-8 character in bytes, and zero will be returned. |
3340 | |
3341 | The C<flags> can also contain various flags to allow deviations from |
3342 | the strict UTF-8 encoding (see F<utf8.h>). |
444155da |
3343 | |
eebe1485 |
3344 | UV utf8_to_uv(U8 *s, STRLEN curlen, STRLEN* retlen, U32 flags) |
444155da |
3345 | |
3346 | =for hackers |
3347 | Found in file utf8.c |
3348 | |
dcad2880 |
3349 | =item utf8_to_uv_simple |
444155da |
3350 | |
3351 | Returns the character value of the first character in the string C<s> |
dcad2880 |
3352 | which is assumed to be in UTF8 encoding; C<retlen> will be set to the |
1aa99e6b |
3353 | length, in bytes, of that character. |
444155da |
3354 | |
dcad2880 |
3355 | If C<s> does not point to a well-formed UTF8 character, zero is |
3356 | returned and retlen is set, if possible, to -1. |
b6b716fe |
3357 | |
eebe1485 |
3358 | UV utf8_to_uv_simple(U8 *s, STRLEN* retlen) |
3359 | |
3360 | =for hackers |
3361 | Found in file utf8.c |
3362 | |
3363 | =item uv_to_utf8 |
3364 | |
3365 | Adds the UTF8 representation of the Unicode codepoint C<uv> to the end |
3366 | of the string C<d>; C<d> should be have at least C<UTF8_MAXLEN+1> free |
3367 | bytes available. The return value is the pointer to the byte after the |
3368 | end of the new character. In other words, |
3369 | |
3370 | d = uv_to_utf8(d, uv); |
3371 | |
3372 | is the recommended Unicode-aware way of saying |
3373 | |
3374 | *(d++) = uv; |
3375 | |
3376 | U8* uv_to_utf8(U8 *d, UV uv) |
b6b716fe |
3377 | |
3378 | =for hackers |
3379 | Found in file utf8.c |
3380 | |
954c1994 |
3381 | =item warn |
3382 | |
3383 | This is the XSUB-writer's interface to Perl's C<warn> function. Use this |
3384 | function the same way you use the C C<printf> function. See |
3385 | C<croak>. |
3386 | |
3387 | void warn(const char* pat, ...) |
3388 | |
497711e7 |
3389 | =for hackers |
3390 | Found in file util.c |
3391 | |
954c1994 |
3392 | =item XPUSHi |
3393 | |
3394 | Push an integer onto the stack, extending the stack if necessary. Handles |
3395 | 'set' magic. See C<PUSHi>. |
3396 | |
3397 | void XPUSHi(IV iv) |
3398 | |
497711e7 |
3399 | =for hackers |
3400 | Found in file pp.h |
3401 | |
954c1994 |
3402 | =item XPUSHn |
3403 | |
3404 | Push a double onto the stack, extending the stack if necessary. Handles |
3405 | 'set' magic. See C<PUSHn>. |
3406 | |
3407 | void XPUSHn(NV nv) |
3408 | |
497711e7 |
3409 | =for hackers |
3410 | Found in file pp.h |
3411 | |
954c1994 |
3412 | =item XPUSHp |
3413 | |
3414 | Push a string onto the stack, extending the stack if necessary. The C<len> |
3415 | indicates the length of the string. Handles 'set' magic. See |
3416 | C<PUSHp>. |
3417 | |
3418 | void XPUSHp(char* str, STRLEN len) |
3419 | |
497711e7 |
3420 | =for hackers |
3421 | Found in file pp.h |
3422 | |
954c1994 |
3423 | =item XPUSHs |
3424 | |
3425 | Push an SV onto the stack, extending the stack if necessary. Does not |
3426 | handle 'set' magic. See C<PUSHs>. |
3427 | |
3428 | void XPUSHs(SV* sv) |
3429 | |
497711e7 |
3430 | =for hackers |
3431 | Found in file pp.h |
3432 | |
954c1994 |
3433 | =item XPUSHu |
3434 | |
1c846c1f |
3435 | Push an unsigned integer onto the stack, extending the stack if necessary. |
954c1994 |
3436 | See C<PUSHu>. |
3437 | |
3438 | void XPUSHu(UV uv) |
3439 | |
497711e7 |
3440 | =for hackers |
3441 | Found in file pp.h |
3442 | |
954c1994 |
3443 | =item XS |
3444 | |
3445 | Macro to declare an XSUB and its C parameter list. This is handled by |
3446 | C<xsubpp>. |
3447 | |
497711e7 |
3448 | =for hackers |
3449 | Found in file XSUB.h |
3450 | |
954c1994 |
3451 | =item XSRETURN |
3452 | |
3453 | Return from XSUB, indicating number of items on the stack. This is usually |
3454 | handled by C<xsubpp>. |
3455 | |
3456 | void XSRETURN(int nitems) |
3457 | |
497711e7 |
3458 | =for hackers |
3459 | Found in file XSUB.h |
3460 | |
954c1994 |
3461 | =item XSRETURN_EMPTY |
3462 | |
3463 | Return an empty list from an XSUB immediately. |
3464 | |
3465 | XSRETURN_EMPTY; |
3466 | |
497711e7 |
3467 | =for hackers |
3468 | Found in file XSUB.h |
3469 | |
954c1994 |
3470 | =item XSRETURN_IV |
3471 | |
3472 | Return an integer from an XSUB immediately. Uses C<XST_mIV>. |
3473 | |
3474 | void XSRETURN_IV(IV iv) |
3475 | |
497711e7 |
3476 | =for hackers |
3477 | Found in file XSUB.h |
3478 | |
954c1994 |
3479 | =item XSRETURN_NO |
3480 | |
3481 | Return C<&PL_sv_no> from an XSUB immediately. Uses C<XST_mNO>. |
3482 | |
3483 | XSRETURN_NO; |
3484 | |
497711e7 |
3485 | =for hackers |
3486 | Found in file XSUB.h |
3487 | |
954c1994 |
3488 | =item XSRETURN_NV |
3489 | |
3490 | Return an double from an XSUB immediately. Uses C<XST_mNV>. |
3491 | |
3492 | void XSRETURN_NV(NV nv) |
3493 | |
497711e7 |
3494 | =for hackers |
3495 | Found in file XSUB.h |
3496 | |
954c1994 |
3497 | =item XSRETURN_PV |
3498 | |
3499 | Return a copy of a string from an XSUB immediately. Uses C<XST_mPV>. |
3500 | |
3501 | void XSRETURN_PV(char* str) |
3502 | |
497711e7 |
3503 | =for hackers |
3504 | Found in file XSUB.h |
3505 | |
954c1994 |
3506 | =item XSRETURN_UNDEF |
3507 | |
3508 | Return C<&PL_sv_undef> from an XSUB immediately. Uses C<XST_mUNDEF>. |
3509 | |
3510 | XSRETURN_UNDEF; |
3511 | |
497711e7 |
3512 | =for hackers |
3513 | Found in file XSUB.h |
3514 | |
954c1994 |
3515 | =item XSRETURN_YES |
3516 | |
3517 | Return C<&PL_sv_yes> from an XSUB immediately. Uses C<XST_mYES>. |
3518 | |
3519 | XSRETURN_YES; |
3520 | |
497711e7 |
3521 | =for hackers |
3522 | Found in file XSUB.h |
3523 | |
954c1994 |
3524 | =item XST_mIV |
3525 | |
3526 | Place an integer into the specified position C<pos> on the stack. The |
3527 | value is stored in a new mortal SV. |
3528 | |
3529 | void XST_mIV(int pos, IV iv) |
3530 | |
497711e7 |
3531 | =for hackers |
3532 | Found in file XSUB.h |
3533 | |
954c1994 |
3534 | =item XST_mNO |
3535 | |
3536 | Place C<&PL_sv_no> into the specified position C<pos> on the |
3537 | stack. |
3538 | |
3539 | void XST_mNO(int pos) |
3540 | |
497711e7 |
3541 | =for hackers |
3542 | Found in file XSUB.h |
3543 | |
954c1994 |
3544 | =item XST_mNV |
3545 | |
3546 | Place a double into the specified position C<pos> on the stack. The value |
3547 | is stored in a new mortal SV. |
3548 | |
3549 | void XST_mNV(int pos, NV nv) |
3550 | |
497711e7 |
3551 | =for hackers |
3552 | Found in file XSUB.h |
3553 | |
954c1994 |
3554 | =item XST_mPV |
3555 | |
3556 | Place a copy of a string into the specified position C<pos> on the stack. |
3557 | The value is stored in a new mortal SV. |
3558 | |
3559 | void XST_mPV(int pos, char* str) |
3560 | |
497711e7 |
3561 | =for hackers |
3562 | Found in file XSUB.h |
3563 | |
954c1994 |
3564 | =item XST_mUNDEF |
3565 | |
3566 | Place C<&PL_sv_undef> into the specified position C<pos> on the |
3567 | stack. |
3568 | |
3569 | void XST_mUNDEF(int pos) |
3570 | |
497711e7 |
3571 | =for hackers |
3572 | Found in file XSUB.h |
3573 | |
954c1994 |
3574 | =item XST_mYES |
3575 | |
3576 | Place C<&PL_sv_yes> into the specified position C<pos> on the |
3577 | stack. |
3578 | |
3579 | void XST_mYES(int pos) |
3580 | |
497711e7 |
3581 | =for hackers |
3582 | Found in file XSUB.h |
3583 | |
954c1994 |
3584 | =item XS_VERSION |
3585 | |
3586 | The version identifier for an XS module. This is usually |
3587 | handled automatically by C<ExtUtils::MakeMaker>. See C<XS_VERSION_BOOTCHECK>. |
3588 | |
497711e7 |
3589 | =for hackers |
3590 | Found in file XSUB.h |
3591 | |
954c1994 |
3592 | =item XS_VERSION_BOOTCHECK |
3593 | |
3594 | Macro to verify that a PM module's $VERSION variable matches the XS |
3595 | module's C<XS_VERSION> variable. This is usually handled automatically by |
3596 | C<xsubpp>. See L<perlxs/"The VERSIONCHECK: Keyword">. |
3597 | |
3598 | XS_VERSION_BOOTCHECK; |
3599 | |
497711e7 |
3600 | =for hackers |
3601 | Found in file XSUB.h |
3602 | |
954c1994 |
3603 | =item Zero |
3604 | |
3605 | The XSUB-writer's interface to the C C<memzero> function. The C<dest> is the |
3606 | destination, C<nitems> is the number of items, and C<type> is the type. |
3607 | |
3608 | void Zero(void* dest, int nitems, type) |
3609 | |
497711e7 |
3610 | =for hackers |
3611 | Found in file handy.h |
3612 | |
954c1994 |
3613 | =back |
3614 | |
3615 | =head1 AUTHORS |
3616 | |
3617 | Until May 1997, this document was maintained by Jeff Okamoto |
3618 | <okamoto@corp.hp.com>. It is now maintained as part of Perl itself. |
3619 | |
3620 | With lots of help and suggestions from Dean Roehrich, Malcolm Beattie, |
3621 | Andreas Koenig, Paul Hudson, Ilya Zakharevich, Paul Marquess, Neil |
3622 | Bowers, Matthew Green, Tim Bunce, Spider Boardman, Ulrich Pfeifer, |
3623 | Stephen McCamant, and Gurusamy Sarathy. |
3624 | |
3625 | API Listing originally by Dean Roehrich <roehrich@cray.com>. |
3626 | |
3627 | Updated to be autogenerated from comments in the source by Benjamin Stuhl. |
3628 | |
3629 | =head1 SEE ALSO |
3630 | |
3631 | perlguts(1), perlxs(1), perlxstut(1), perlintern(1) |
3632 | |