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