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