Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3546 lines
74 KiB

  1. =head1 NAME
  2. perlapi - autogenerated documentation for the perl public API
  3. =head1 DESCRIPTION
  4. This file contains the documentation of the perl public API generated by
  5. embed.pl, specifically a listing of functions, macros, flags, and variables
  6. that may be used by extension writers. The interfaces of any functions that
  7. are not listed here are subject to change without notice. For this reason,
  8. blindly using functions listed in proto.h is to be avoided when writing
  9. extensions.
  10. Note that all Perl API global variables must be referenced with the C<PL_>
  11. prefix. Some macros are provided for compatibility with the older,
  12. unadorned names, but this support may be disabled in a future release.
  13. The listing is alphabetical, case insensitive.
  14. =over 8
  15. =item AvFILL
  16. Same as C<av_len()>. Deprecated, use C<av_len()> instead.
  17. int AvFILL(AV* av)
  18. =for hackers
  19. Found in file av.h
  20. =item av_clear
  21. Clears an array, making it empty. Does not free the memory used by the
  22. array itself.
  23. void av_clear(AV* ar)
  24. =for hackers
  25. Found in file av.c
  26. =item av_delete
  27. Deletes the element indexed by C<key> from the array. Returns the
  28. deleted element. C<flags> is currently ignored.
  29. SV* av_delete(AV* ar, I32 key, I32 flags)
  30. =for hackers
  31. Found in file av.c
  32. =item av_exists
  33. Returns true if the element indexed by C<key> has been initialized.
  34. This relies on the fact that uninitialized array elements are set to
  35. C<&PL_sv_undef>.
  36. bool av_exists(AV* ar, I32 key)
  37. =for hackers
  38. Found in file av.c
  39. =item av_extend
  40. Pre-extend an array. The C<key> is the index to which the array should be
  41. extended.
  42. void av_extend(AV* ar, I32 key)
  43. =for hackers
  44. Found in file av.c
  45. =item av_fetch
  46. Returns the SV at the specified index in the array. The C<key> is the
  47. index. If C<lval> is set then the fetch will be part of a store. Check
  48. that the return value is non-null before dereferencing it to a C<SV*>.
  49. See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for
  50. more information on how to use this function on tied arrays.
  51. SV** av_fetch(AV* ar, I32 key, I32 lval)
  52. =for hackers
  53. Found in file av.c
  54. =item av_fill
  55. Ensure than an array has a given number of elements, equivalent to
  56. Perl's C<$#array = $fill;>.
  57. void av_fill(AV* ar, I32 fill)
  58. =for hackers
  59. Found in file av.c
  60. =item av_len
  61. Returns the highest index in the array. Returns -1 if the array is
  62. empty.
  63. I32 av_len(AV* ar)
  64. =for hackers
  65. Found in file av.c
  66. =item av_make
  67. Creates a new AV and populates it with a list of SVs. The SVs are copied
  68. into the array, so they may be freed after the call to av_make. The new AV
  69. will have a reference count of 1.
  70. AV* av_make(I32 size, SV** svp)
  71. =for hackers
  72. Found in file av.c
  73. =item av_pop
  74. Pops an SV off the end of the array. Returns C<&PL_sv_undef> if the array
  75. is empty.
  76. SV* av_pop(AV* ar)
  77. =for hackers
  78. Found in file av.c
  79. =item av_push
  80. Pushes an SV onto the end of the array. The array will grow automatically
  81. to accommodate the addition.
  82. void av_push(AV* ar, SV* val)
  83. =for hackers
  84. Found in file av.c
  85. =item av_shift
  86. Shifts an SV off the beginning of the array.
  87. SV* av_shift(AV* ar)
  88. =for hackers
  89. Found in file av.c
  90. =item av_store
  91. Stores an SV in an array. The array index is specified as C<key>. The
  92. return value will be NULL if the operation failed or if the value did not
  93. need to be actually stored within the array (as in the case of tied
  94. arrays). Otherwise it can be dereferenced to get the original C<SV*>. Note
  95. that the caller is responsible for suitably incrementing the reference
  96. count of C<val> before the call, and decrementing it if the function
  97. returned NULL.
  98. See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for
  99. more information on how to use this function on tied arrays.
  100. SV** av_store(AV* ar, I32 key, SV* val)
  101. =for hackers
  102. Found in file av.c
  103. =item av_undef
  104. Undefines the array. Frees the memory used by the array itself.
  105. void av_undef(AV* ar)
  106. =for hackers
  107. Found in file av.c
  108. =item av_unshift
  109. Unshift the given number of C<undef> values onto the beginning of the
  110. array. The array will grow automatically to accommodate the addition. You
  111. must then use C<av_store> to assign values to these new elements.
  112. void av_unshift(AV* ar, I32 num)
  113. =for hackers
  114. Found in file av.c
  115. =item bytes_from_utf8
  116. Converts a string C<s> of length C<len> from UTF8 into byte encoding.
  117. Unlike <utf8_to_bytes> but like C<bytes_to_utf8>, returns a pointer to
  118. the newly-created string, and updates C<len> to contain the new
  119. length. Returns the original string if no conversion occurs, C<len>
  120. is unchanged. Do nothing if C<is_utf8> points to 0. Sets C<is_utf8> to
  121. 0 if C<s> is converted or contains all 7bit characters.
  122. NOTE: this function is experimental and may change or be
  123. removed without notice.
  124. U8* bytes_from_utf8(U8 *s, STRLEN *len, bool *is_utf8)
  125. =for hackers
  126. Found in file utf8.c
  127. =item bytes_to_utf8
  128. Converts a string C<s> of length C<len> from ASCII into UTF8 encoding.
  129. Returns a pointer to the newly-created string, and sets C<len> to
  130. reflect the new length.
  131. NOTE: this function is experimental and may change or be
  132. removed without notice.
  133. U8* bytes_to_utf8(U8 *s, STRLEN *len)
  134. =for hackers
  135. Found in file utf8.c
  136. =item call_argv
  137. Performs a callback to the specified Perl sub. See L<perlcall>.
  138. NOTE: the perl_ form of this function is deprecated.
  139. I32 call_argv(const char* sub_name, I32 flags, char** argv)
  140. =for hackers
  141. Found in file perl.c
  142. =item call_method
  143. Performs a callback to the specified Perl method. The blessed object must
  144. be on the stack. See L<perlcall>.
  145. NOTE: the perl_ form of this function is deprecated.
  146. I32 call_method(const char* methname, I32 flags)
  147. =for hackers
  148. Found in file perl.c
  149. =item call_pv
  150. Performs a callback to the specified Perl sub. See L<perlcall>.
  151. NOTE: the perl_ form of this function is deprecated.
  152. I32 call_pv(const char* sub_name, I32 flags)
  153. =for hackers
  154. Found in file perl.c
  155. =item call_sv
  156. Performs a callback to the Perl sub whose name is in the SV. See
  157. L<perlcall>.
  158. NOTE: the perl_ form of this function is deprecated.
  159. I32 call_sv(SV* sv, I32 flags)
  160. =for hackers
  161. Found in file perl.c
  162. =item CLASS
  163. Variable which is setup by C<xsubpp> to indicate the
  164. class name for a C++ XS constructor. This is always a C<char*>. See C<THIS>.
  165. char* CLASS
  166. =for hackers
  167. Found in file XSUB.h
  168. =item Copy
  169. The XSUB-writer's interface to the C C<memcpy> function. The C<src> is the
  170. source, C<dest> is the destination, C<nitems> is the number of items, and C<type> is
  171. the type. May fail on overlapping copies. See also C<Move>.
  172. void Copy(void* src, void* dest, int nitems, type)
  173. =for hackers
  174. Found in file handy.h
  175. =item croak
  176. This is the XSUB-writer's interface to Perl's C<die> function.
  177. Normally use this function the same way you use the C C<printf>
  178. function. See C<warn>.
  179. If you want to throw an exception object, assign the object to
  180. C<$@> and then pass C<Nullch> to croak():
  181. errsv = get_sv("@", TRUE);
  182. sv_setsv(errsv, exception_object);
  183. croak(Nullch);
  184. void croak(const char* pat, ...)
  185. =for hackers
  186. Found in file util.c
  187. =item CvSTASH
  188. Returns the stash of the CV.
  189. HV* CvSTASH(CV* cv)
  190. =for hackers
  191. Found in file cv.h
  192. =item dMARK
  193. Declare a stack marker variable, C<mark>, for the XSUB. See C<MARK> and
  194. C<dORIGMARK>.
  195. dMARK;
  196. =for hackers
  197. Found in file pp.h
  198. =item dORIGMARK
  199. Saves the original stack mark for the XSUB. See C<ORIGMARK>.
  200. dORIGMARK;
  201. =for hackers
  202. Found in file pp.h
  203. =item dSP
  204. Declares a local copy of perl's stack pointer for the XSUB, available via
  205. the C<SP> macro. See C<SP>.
  206. dSP;
  207. =for hackers
  208. Found in file pp.h
  209. =item dXSARGS
  210. Sets up stack and mark pointers for an XSUB, calling dSP and dMARK. This
  211. is usually handled automatically by C<xsubpp>. Declares the C<items>
  212. variable to indicate the number of items on the stack.
  213. dXSARGS;
  214. =for hackers
  215. Found in file XSUB.h
  216. =item dXSI32
  217. Sets up the C<ix> variable for an XSUB which has aliases. This is usually
  218. handled automatically by C<xsubpp>.
  219. dXSI32;
  220. =for hackers
  221. Found in file XSUB.h
  222. =item ENTER
  223. Opening bracket on a callback. See C<LEAVE> and L<perlcall>.
  224. ENTER;
  225. =for hackers
  226. Found in file scope.h
  227. =item eval_pv
  228. Tells Perl to C<eval> the given string and return an SV* result.
  229. NOTE: the perl_ form of this function is deprecated.
  230. SV* eval_pv(const char* p, I32 croak_on_error)
  231. =for hackers
  232. Found in file perl.c
  233. =item eval_sv
  234. Tells Perl to C<eval> the string in the SV.
  235. NOTE: the perl_ form of this function is deprecated.
  236. I32 eval_sv(SV* sv, I32 flags)
  237. =for hackers
  238. Found in file perl.c
  239. =item EXTEND
  240. Used to extend the argument stack for an XSUB's return values. Once
  241. used, guarantees that there is room for at least C<nitems> to be pushed
  242. onto the stack.
  243. void EXTEND(SP, int nitems)
  244. =for hackers
  245. Found in file pp.h
  246. =item fbm_compile
  247. Analyses the string in order to make fast searches on it using fbm_instr()
  248. -- the Boyer-Moore algorithm.
  249. void fbm_compile(SV* sv, U32 flags)
  250. =for hackers
  251. Found in file util.c
  252. =item fbm_instr
  253. Returns the location of the SV in the string delimited by C<str> and
  254. C<strend>. It returns C<Nullch> if the string can't be found. The C<sv>
  255. does not have to be fbm_compiled, but the search will not be as fast
  256. then.
  257. char* fbm_instr(unsigned char* big, unsigned char* bigend, SV* littlesv, U32 flags)
  258. =for hackers
  259. Found in file util.c
  260. =item FREETMPS
  261. Closing bracket for temporaries on a callback. See C<SAVETMPS> and
  262. L<perlcall>.
  263. FREETMPS;
  264. =for hackers
  265. Found in file scope.h
  266. =item get_av
  267. Returns the AV of the specified Perl array. If C<create> is set and the
  268. Perl variable does not exist then it will be created. If C<create> is not
  269. set and the variable does not exist then NULL is returned.
  270. NOTE: the perl_ form of this function is deprecated.
  271. AV* get_av(const char* name, I32 create)
  272. =for hackers
  273. Found in file perl.c
  274. =item get_cv
  275. Returns the CV of the specified Perl subroutine. If C<create> is set and
  276. the Perl subroutine does not exist then it will be declared (which has the
  277. same effect as saying C<sub name;>). If C<create> is not set and the
  278. subroutine does not exist then NULL is returned.
  279. NOTE: the perl_ form of this function is deprecated.
  280. CV* get_cv(const char* name, I32 create)
  281. =for hackers
  282. Found in file perl.c
  283. =item get_hv
  284. Returns the HV of the specified Perl hash. If C<create> is set and the
  285. Perl variable does not exist then it will be created. If C<create> is not
  286. set and the variable does not exist then NULL is returned.
  287. NOTE: the perl_ form of this function is deprecated.
  288. HV* get_hv(const char* name, I32 create)
  289. =for hackers
  290. Found in file perl.c
  291. =item get_sv
  292. Returns the SV of the specified Perl scalar. If C<create> is set and the
  293. Perl variable does not exist then it will be created. If C<create> is not
  294. set and the variable does not exist then NULL is returned.
  295. NOTE: the perl_ form of this function is deprecated.
  296. SV* get_sv(const char* name, I32 create)
  297. =for hackers
  298. Found in file perl.c
  299. =item GIMME
  300. A backward-compatible version of C<GIMME_V> which can only return
  301. C<G_SCALAR> or C<G_ARRAY>; in a void context, it returns C<G_SCALAR>.
  302. Deprecated. Use C<GIMME_V> instead.
  303. U32 GIMME
  304. =for hackers
  305. Found in file op.h
  306. =item GIMME_V
  307. The XSUB-writer's equivalent to Perl's C<wantarray>. Returns C<G_VOID>,
  308. C<G_SCALAR> or C<G_ARRAY> for void, scalar or list context,
  309. respectively.
  310. U32 GIMME_V
  311. =for hackers
  312. Found in file op.h
  313. =item GvSV
  314. Return the SV from the GV.
  315. SV* GvSV(GV* gv)
  316. =for hackers
  317. Found in file gv.h
  318. =item gv_fetchmeth
  319. Returns the glob with the given C<name> and a defined subroutine or
  320. C<NULL>. The glob lives in the given C<stash>, or in the stashes
  321. accessible via @ISA and @UNIVERSAL.
  322. The argument C<level> should be either 0 or -1. If C<level==0>, as a
  323. side-effect creates a glob with the given C<name> in the given C<stash>
  324. which in the case of success contains an alias for the subroutine, and sets
  325. up caching info for this glob. Similarly for all the searched stashes.
  326. This function grants C<"SUPER"> token as a postfix of the stash name. The
  327. GV returned from C<gv_fetchmeth> may be a method cache entry, which is not
  328. visible to Perl code. So when calling C<call_sv>, you should not use
  329. the GV directly; instead, you should use the method's CV, which can be
  330. obtained from the GV with the C<GvCV> macro.
  331. GV* gv_fetchmeth(HV* stash, const char* name, STRLEN len, I32 level)
  332. =for hackers
  333. Found in file gv.c
  334. =item gv_fetchmethod
  335. See L<gv_fetchmethod_autoload>.
  336. GV* gv_fetchmethod(HV* stash, const char* name)
  337. =for hackers
  338. Found in file gv.c
  339. =item gv_fetchmethod_autoload
  340. Returns the glob which contains the subroutine to call to invoke the method
  341. on the C<stash>. In fact in the presence of autoloading this may be the
  342. glob for "AUTOLOAD". In this case the corresponding variable $AUTOLOAD is
  343. already setup.
  344. The third parameter of C<gv_fetchmethod_autoload> determines whether
  345. AUTOLOAD lookup is performed if the given method is not present: non-zero
  346. means yes, look for AUTOLOAD; zero means no, don't look for AUTOLOAD.
  347. Calling C<gv_fetchmethod> is equivalent to calling C<gv_fetchmethod_autoload>
  348. with a non-zero C<autoload> parameter.
  349. These functions grant C<"SUPER"> token as a prefix of the method name. Note
  350. that if you want to keep the returned glob for a long time, you need to
  351. check for it being "AUTOLOAD", since at the later time the call may load a
  352. different subroutine due to $AUTOLOAD changing its value. Use the glob
  353. created via a side effect to do this.
  354. These functions have the same side-effects and as C<gv_fetchmeth> with
  355. C<level==0>. C<name> should be writable if contains C<':'> or C<'
  356. ''>. The warning against passing the GV returned by C<gv_fetchmeth> to
  357. C<call_sv> apply equally to these functions.
  358. GV* gv_fetchmethod_autoload(HV* stash, const char* name, I32 autoload)
  359. =for hackers
  360. Found in file gv.c
  361. =item gv_stashpv
  362. Returns a pointer to the stash for a specified package. C<name> should
  363. be a valid UTF-8 string. If C<create> is set then the package will be
  364. created if it does not already exist. If C<create> is not set and the
  365. package does not exist then NULL is returned.
  366. HV* gv_stashpv(const char* name, I32 create)
  367. =for hackers
  368. Found in file gv.c
  369. =item gv_stashsv
  370. Returns a pointer to the stash for a specified package, which must be a
  371. valid UTF-8 string. See C<gv_stashpv>.
  372. HV* gv_stashsv(SV* sv, I32 create)
  373. =for hackers
  374. Found in file gv.c
  375. =item G_ARRAY
  376. Used to indicate list context. See C<GIMME_V>, C<GIMME> and
  377. L<perlcall>.
  378. =for hackers
  379. Found in file cop.h
  380. =item G_DISCARD
  381. Indicates that arguments returned from a callback should be discarded. See
  382. L<perlcall>.
  383. =for hackers
  384. Found in file cop.h
  385. =item G_EVAL
  386. Used to force a Perl C<eval> wrapper around a callback. See
  387. L<perlcall>.
  388. =for hackers
  389. Found in file cop.h
  390. =item G_NOARGS
  391. Indicates that no arguments are being sent to a callback. See
  392. L<perlcall>.
  393. =for hackers
  394. Found in file cop.h
  395. =item G_SCALAR
  396. Used to indicate scalar context. See C<GIMME_V>, C<GIMME>, and
  397. L<perlcall>.
  398. =for hackers
  399. Found in file cop.h
  400. =item G_VOID
  401. Used to indicate void context. See C<GIMME_V> and L<perlcall>.
  402. =for hackers
  403. Found in file cop.h
  404. =item HEf_SVKEY
  405. This flag, used in the length slot of hash entries and magic structures,
  406. specifies the structure contains a C<SV*> pointer where a C<char*> pointer
  407. is to be expected. (For information only--not to be used).
  408. =for hackers
  409. Found in file hv.h
  410. =item HeHASH
  411. Returns the computed hash stored in the hash entry.
  412. U32 HeHASH(HE* he)
  413. =for hackers
  414. Found in file hv.h
  415. =item HeKEY
  416. Returns the actual pointer stored in the key slot of the hash entry. The
  417. pointer may be either C<char*> or C<SV*>, depending on the value of
  418. C<HeKLEN()>. Can be assigned to. The C<HePV()> or C<HeSVKEY()> macros are
  419. usually preferable for finding the value of a key.
  420. void* HeKEY(HE* he)
  421. =for hackers
  422. Found in file hv.h
  423. =item HeKLEN
  424. If this is negative, and amounts to C<HEf_SVKEY>, it indicates the entry
  425. holds an C<SV*> key. Otherwise, holds the actual length of the key. Can
  426. be assigned to. The C<HePV()> macro is usually preferable for finding key
  427. lengths.
  428. STRLEN HeKLEN(HE* he)
  429. =for hackers
  430. Found in file hv.h
  431. =item HePV
  432. Returns the key slot of the hash entry as a C<char*> value, doing any
  433. necessary dereferencing of possibly C<SV*> keys. The length of the string
  434. is placed in C<len> (this is a macro, so do I<not> use C<&len>). If you do
  435. not care about what the length of the key is, you may use the global
  436. variable C<PL_na>, though this is rather less efficient than using a local
  437. variable. Remember though, that hash keys in perl are free to contain
  438. embedded nulls, so using C<strlen()> or similar is not a good way to find
  439. the length of hash keys. This is very similar to the C<SvPV()> macro
  440. described elsewhere in this document.
  441. char* HePV(HE* he, STRLEN len)
  442. =for hackers
  443. Found in file hv.h
  444. =item HeSVKEY
  445. Returns the key as an C<SV*>, or C<Nullsv> if the hash entry does not
  446. contain an C<SV*> key.
  447. SV* HeSVKEY(HE* he)
  448. =for hackers
  449. Found in file hv.h
  450. =item HeSVKEY_force
  451. Returns the key as an C<SV*>. Will create and return a temporary mortal
  452. C<SV*> if the hash entry contains only a C<char*> key.
  453. SV* HeSVKEY_force(HE* he)
  454. =for hackers
  455. Found in file hv.h
  456. =item HeSVKEY_set
  457. Sets the key to a given C<SV*>, taking care to set the appropriate flags to
  458. indicate the presence of an C<SV*> key, and returns the same
  459. C<SV*>.
  460. SV* HeSVKEY_set(HE* he, SV* sv)
  461. =for hackers
  462. Found in file hv.h
  463. =item HeVAL
  464. Returns the value slot (type C<SV*>) stored in the hash entry.
  465. SV* HeVAL(HE* he)
  466. =for hackers
  467. Found in file hv.h
  468. =item HvNAME
  469. Returns the package name of a stash. See C<SvSTASH>, C<CvSTASH>.
  470. char* HvNAME(HV* stash)
  471. =for hackers
  472. Found in file hv.h
  473. =item hv_clear
  474. Clears a hash, making it empty.
  475. void hv_clear(HV* tb)
  476. =for hackers
  477. Found in file hv.c
  478. =item hv_delete
  479. Deletes a key/value pair in the hash. The value SV is removed from the
  480. hash and returned to the caller. The C<klen> is the length of the key.
  481. The C<flags> value will normally be zero; if set to G_DISCARD then NULL
  482. will be returned.
  483. SV* hv_delete(HV* tb, const char* key, U32 klen, I32 flags)
  484. =for hackers
  485. Found in file hv.c
  486. =item hv_delete_ent
  487. Deletes a key/value pair in the hash. The value SV is removed from the
  488. hash and returned to the caller. The C<flags> value will normally be zero;
  489. if set to G_DISCARD then NULL will be returned. C<hash> can be a valid
  490. precomputed hash value, or 0 to ask for it to be computed.
  491. SV* hv_delete_ent(HV* tb, SV* key, I32 flags, U32 hash)
  492. =for hackers
  493. Found in file hv.c
  494. =item hv_exists
  495. Returns a boolean indicating whether the specified hash key exists. The
  496. C<klen> is the length of the key.
  497. bool hv_exists(HV* tb, const char* key, U32 klen)
  498. =for hackers
  499. Found in file hv.c
  500. =item hv_exists_ent
  501. Returns a boolean indicating whether the specified hash key exists. C<hash>
  502. can be a valid precomputed hash value, or 0 to ask for it to be
  503. computed.
  504. bool hv_exists_ent(HV* tb, SV* key, U32 hash)
  505. =for hackers
  506. Found in file hv.c
  507. =item hv_fetch
  508. Returns the SV which corresponds to the specified key in the hash. The
  509. C<klen> is the length of the key. If C<lval> is set then the fetch will be
  510. part of a store. Check that the return value is non-null before
  511. dereferencing it to a C<SV*>.
  512. See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more
  513. information on how to use this function on tied hashes.
  514. SV** hv_fetch(HV* tb, const char* key, U32 klen, I32 lval)
  515. =for hackers
  516. Found in file hv.c
  517. =item hv_fetch_ent
  518. Returns the hash entry which corresponds to the specified key in the hash.
  519. C<hash> must be a valid precomputed hash number for the given C<key>, or 0
  520. if you want the function to compute it. IF C<lval> is set then the fetch
  521. will be part of a store. Make sure the return value is non-null before
  522. accessing it. The return value when C<tb> is a tied hash is a pointer to a
  523. static location, so be sure to make a copy of the structure if you need to
  524. store it somewhere.
  525. See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more
  526. information on how to use this function on tied hashes.
  527. HE* hv_fetch_ent(HV* tb, SV* key, I32 lval, U32 hash)
  528. =for hackers
  529. Found in file hv.c
  530. =item hv_iterinit
  531. Prepares a starting point to traverse a hash table. Returns the number of
  532. keys in the hash (i.e. the same as C<HvKEYS(tb)>). The return value is
  533. currently only meaningful for hashes without tie magic.
  534. NOTE: Before version 5.004_65, C<hv_iterinit> used to return the number of
  535. hash buckets that happen to be in use. If you still need that esoteric
  536. value, you can get it through the macro C<HvFILL(tb)>.
  537. I32 hv_iterinit(HV* tb)
  538. =for hackers
  539. Found in file hv.c
  540. =item hv_iterkey
  541. Returns the key from the current position of the hash iterator. See
  542. C<hv_iterinit>.
  543. char* hv_iterkey(HE* entry, I32* retlen)
  544. =for hackers
  545. Found in file hv.c
  546. =item hv_iterkeysv
  547. Returns the key as an C<SV*> from the current position of the hash
  548. iterator. The return value will always be a mortal copy of the key. Also
  549. see C<hv_iterinit>.
  550. SV* hv_iterkeysv(HE* entry)
  551. =for hackers
  552. Found in file hv.c
  553. =item hv_iternext
  554. Returns entries from a hash iterator. See C<hv_iterinit>.
  555. HE* hv_iternext(HV* tb)
  556. =for hackers
  557. Found in file hv.c
  558. =item hv_iternextsv
  559. Performs an C<hv_iternext>, C<hv_iterkey>, and C<hv_iterval> in one
  560. operation.
  561. SV* hv_iternextsv(HV* hv, char** key, I32* retlen)
  562. =for hackers
  563. Found in file hv.c
  564. =item hv_iterval
  565. Returns the value from the current position of the hash iterator. See
  566. C<hv_iterkey>.
  567. SV* hv_iterval(HV* tb, HE* entry)
  568. =for hackers
  569. Found in file hv.c
  570. =item hv_magic
  571. Adds magic to a hash. See C<sv_magic>.
  572. void hv_magic(HV* hv, GV* gv, int how)
  573. =for hackers
  574. Found in file hv.c
  575. =item hv_store
  576. Stores an SV in a hash. The hash key is specified as C<key> and C<klen> is
  577. the length of the key. The C<hash> parameter is the precomputed hash
  578. value; if it is zero then Perl will compute it. The return value will be
  579. NULL if the operation failed or if the value did not need to be actually
  580. stored within the hash (as in the case of tied hashes). Otherwise it can
  581. be dereferenced to get the original C<SV*>. Note that the caller is
  582. responsible for suitably incrementing the reference count of C<val> before
  583. the call, and decrementing it if the function returned NULL.
  584. See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more
  585. information on how to use this function on tied hashes.
  586. SV** hv_store(HV* tb, const char* key, U32 klen, SV* val, U32 hash)
  587. =for hackers
  588. Found in file hv.c
  589. =item hv_store_ent
  590. Stores C<val> in a hash. The hash key is specified as C<key>. The C<hash>
  591. parameter is the precomputed hash value; if it is zero then Perl will
  592. compute it. The return value is the new hash entry so created. It will be
  593. NULL if the operation failed or if the value did not need to be actually
  594. stored within the hash (as in the case of tied hashes). Otherwise the
  595. contents of the return value can be accessed using the C<He???> macros
  596. described here. Note that the caller is responsible for suitably
  597. incrementing the reference count of C<val> before the call, and
  598. decrementing it if the function returned NULL.
  599. See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more
  600. information on how to use this function on tied hashes.
  601. HE* hv_store_ent(HV* tb, SV* key, SV* val, U32 hash)
  602. =for hackers
  603. Found in file hv.c
  604. =item hv_undef
  605. Undefines the hash.
  606. void hv_undef(HV* tb)
  607. =for hackers
  608. Found in file hv.c
  609. =item isALNUM
  610. Returns a boolean indicating whether the C C<char> is an ASCII alphanumeric
  611. character (including underscore) or digit.
  612. bool isALNUM(char ch)
  613. =for hackers
  614. Found in file handy.h
  615. =item isALPHA
  616. Returns a boolean indicating whether the C C<char> is an ASCII alphabetic
  617. character.
  618. bool isALPHA(char ch)
  619. =for hackers
  620. Found in file handy.h
  621. =item isDIGIT
  622. Returns a boolean indicating whether the C C<char> is an ASCII
  623. digit.
  624. bool isDIGIT(char ch)
  625. =for hackers
  626. Found in file handy.h
  627. =item isLOWER
  628. Returns a boolean indicating whether the C C<char> is a lowercase
  629. character.
  630. bool isLOWER(char ch)
  631. =for hackers
  632. Found in file handy.h
  633. =item isSPACE
  634. Returns a boolean indicating whether the C C<char> is whitespace.
  635. bool isSPACE(char ch)
  636. =for hackers
  637. Found in file handy.h
  638. =item isUPPER
  639. Returns a boolean indicating whether the C C<char> is an uppercase
  640. character.
  641. bool isUPPER(char ch)
  642. =for hackers
  643. Found in file handy.h
  644. =item is_utf8_char
  645. Tests if some arbitrary number of bytes begins in a valid UTF-8 character.
  646. The actual number of bytes in the UTF-8 character will be returned if it
  647. is valid, otherwise 0.
  648. STRLEN is_utf8_char(U8 *p)
  649. =for hackers
  650. Found in file utf8.c
  651. =item is_utf8_string
  652. Returns true if first C<len> bytes of the given string form valid a UTF8
  653. string, false otherwise.
  654. bool is_utf8_string(U8 *s, STRLEN len)
  655. =for hackers
  656. Found in file utf8.c
  657. =item items
  658. Variable which is setup by C<xsubpp> to indicate the number of
  659. items on the stack. See L<perlxs/"Variable-length Parameter Lists">.
  660. I32 items
  661. =for hackers
  662. Found in file XSUB.h
  663. =item ix
  664. Variable which is setup by C<xsubpp> to indicate which of an
  665. XSUB's aliases was used to invoke it. See L<perlxs/"The ALIAS: Keyword">.
  666. I32 ix
  667. =for hackers
  668. Found in file XSUB.h
  669. =item LEAVE
  670. Closing bracket on a callback. See C<ENTER> and L<perlcall>.
  671. LEAVE;
  672. =for hackers
  673. Found in file scope.h
  674. =item looks_like_number
  675. Test if an the content of an SV looks like a number (or is a
  676. number).
  677. I32 looks_like_number(SV* sv)
  678. =for hackers
  679. Found in file sv.c
  680. =item MARK
  681. Stack marker variable for the XSUB. See C<dMARK>.
  682. =for hackers
  683. Found in file pp.h
  684. =item mg_clear
  685. Clear something magical that the SV represents. See C<sv_magic>.
  686. int mg_clear(SV* sv)
  687. =for hackers
  688. Found in file mg.c
  689. =item mg_copy
  690. Copies the magic from one SV to another. See C<sv_magic>.
  691. int mg_copy(SV* sv, SV* nsv, const char* key, I32 klen)
  692. =for hackers
  693. Found in file mg.c
  694. =item mg_find
  695. Finds the magic pointer for type matching the SV. See C<sv_magic>.
  696. MAGIC* mg_find(SV* sv, int type)
  697. =for hackers
  698. Found in file mg.c
  699. =item mg_free
  700. Free any magic storage used by the SV. See C<sv_magic>.
  701. int mg_free(SV* sv)
  702. =for hackers
  703. Found in file mg.c
  704. =item mg_get
  705. Do magic after a value is retrieved from the SV. See C<sv_magic>.
  706. int mg_get(SV* sv)
  707. =for hackers
  708. Found in file mg.c
  709. =item mg_length
  710. Report on the SV's length. See C<sv_magic>.
  711. U32 mg_length(SV* sv)
  712. =for hackers
  713. Found in file mg.c
  714. =item mg_magical
  715. Turns on the magical status of an SV. See C<sv_magic>.
  716. void mg_magical(SV* sv)
  717. =for hackers
  718. Found in file mg.c
  719. =item mg_set
  720. Do magic after a value is assigned to the SV. See C<sv_magic>.
  721. int mg_set(SV* sv)
  722. =for hackers
  723. Found in file mg.c
  724. =item Move
  725. The XSUB-writer's interface to the C C<memmove> function. The C<src> is the
  726. source, C<dest> is the destination, C<nitems> is the number of items, and C<type> is
  727. the type. Can do overlapping moves. See also C<Copy>.
  728. void Move(void* src, void* dest, int nitems, type)
  729. =for hackers
  730. Found in file handy.h
  731. =item New
  732. The XSUB-writer's interface to the C C<malloc> function.
  733. void New(int id, void* ptr, int nitems, type)
  734. =for hackers
  735. Found in file handy.h
  736. =item newAV
  737. Creates a new AV. The reference count is set to 1.
  738. AV* newAV()
  739. =for hackers
  740. Found in file av.c
  741. =item Newc
  742. The XSUB-writer's interface to the C C<malloc> function, with
  743. cast.
  744. void Newc(int id, void* ptr, int nitems, type, cast)
  745. =for hackers
  746. Found in file handy.h
  747. =item newCONSTSUB
  748. Creates a constant sub equivalent to Perl C<sub FOO () { 123 }> which is
  749. eligible for inlining at compile-time.
  750. void newCONSTSUB(HV* stash, char* name, SV* sv)
  751. =for hackers
  752. Found in file op.c
  753. =item newHV
  754. Creates a new HV. The reference count is set to 1.
  755. HV* newHV()
  756. =for hackers
  757. Found in file hv.c
  758. =item newRV_inc
  759. Creates an RV wrapper for an SV. The reference count for the original SV is
  760. incremented.
  761. SV* newRV_inc(SV* sv)
  762. =for hackers
  763. Found in file sv.h
  764. =item newRV_noinc
  765. Creates an RV wrapper for an SV. The reference count for the original
  766. SV is B<not> incremented.
  767. SV* newRV_noinc(SV *sv)
  768. =for hackers
  769. Found in file sv.c
  770. =item NEWSV
  771. Creates a new SV. A non-zero C<len> parameter indicates the number of
  772. bytes of preallocated string space the SV should have. An extra byte for a
  773. tailing NUL is also reserved. (SvPOK is not set for the SV even if string
  774. space is allocated.) The reference count for the new SV is set to 1.
  775. C<id> is an integer id between 0 and 1299 (used to identify leaks).
  776. SV* NEWSV(int id, STRLEN len)
  777. =for hackers
  778. Found in file handy.h
  779. =item newSViv
  780. Creates a new SV and copies an integer into it. The reference count for the
  781. SV is set to 1.
  782. SV* newSViv(IV i)
  783. =for hackers
  784. Found in file sv.c
  785. =item newSVnv
  786. Creates a new SV and copies a floating point value into it.
  787. The reference count for the SV is set to 1.
  788. SV* newSVnv(NV n)
  789. =for hackers
  790. Found in file sv.c
  791. =item newSVpv
  792. Creates a new SV and copies a string into it. The reference count for the
  793. SV is set to 1. If C<len> is zero, Perl will compute the length using
  794. strlen(). For efficiency, consider using C<newSVpvn> instead.
  795. SV* newSVpv(const char* s, STRLEN len)
  796. =for hackers
  797. Found in file sv.c
  798. =item newSVpvf
  799. Creates a new SV an initialize it with the string formatted like
  800. C<sprintf>.
  801. SV* newSVpvf(const char* pat, ...)
  802. =for hackers
  803. Found in file sv.c
  804. =item newSVpvn
  805. Creates a new SV and copies a string into it. The reference count for the
  806. SV is set to 1. Note that if C<len> is zero, Perl will create a zero length
  807. string. You are responsible for ensuring that the source string is at least
  808. C<len> bytes long.
  809. SV* newSVpvn(const char* s, STRLEN len)
  810. =for hackers
  811. Found in file sv.c
  812. =item newSVrv
  813. Creates a new SV for the RV, C<rv>, to point to. If C<rv> is not an RV then
  814. it will be upgraded to one. If C<classname> is non-null then the new SV will
  815. be blessed in the specified package. The new SV is returned and its
  816. reference count is 1.
  817. SV* newSVrv(SV* rv, const char* classname)
  818. =for hackers
  819. Found in file sv.c
  820. =item newSVsv
  821. Creates a new SV which is an exact duplicate of the original SV.
  822. SV* newSVsv(SV* old)
  823. =for hackers
  824. Found in file sv.c
  825. =item newSVuv
  826. Creates a new SV and copies an unsigned integer into it.
  827. The reference count for the SV is set to 1.
  828. SV* newSVuv(UV u)
  829. =for hackers
  830. Found in file sv.c
  831. =item newXS
  832. Used by C<xsubpp> to hook up XSUBs as Perl subs.
  833. =for hackers
  834. Found in file op.c
  835. =item newXSproto
  836. Used by C<xsubpp> to hook up XSUBs as Perl subs. Adds Perl prototypes to
  837. the subs.
  838. =for hackers
  839. Found in file XSUB.h
  840. =item Newz
  841. The XSUB-writer's interface to the C C<malloc> function. The allocated
  842. memory is zeroed with C<memzero>.
  843. void Newz(int id, void* ptr, int nitems, type)
  844. =for hackers
  845. Found in file handy.h
  846. =item Nullav
  847. Null AV pointer.
  848. =for hackers
  849. Found in file av.h
  850. =item Nullch
  851. Null character pointer.
  852. =for hackers
  853. Found in file handy.h
  854. =item Nullcv
  855. Null CV pointer.
  856. =for hackers
  857. Found in file cv.h
  858. =item Nullhv
  859. Null HV pointer.
  860. =for hackers
  861. Found in file hv.h
  862. =item Nullsv
  863. Null SV pointer.
  864. =for hackers
  865. Found in file handy.h
  866. =item ORIGMARK
  867. The original stack mark for the XSUB. See C<dORIGMARK>.
  868. =for hackers
  869. Found in file pp.h
  870. =item perl_alloc
  871. Allocates a new Perl interpreter. See L<perlembed>.
  872. PerlInterpreter* perl_alloc()
  873. =for hackers
  874. Found in file perl.c
  875. =item perl_construct
  876. Initializes a new Perl interpreter. See L<perlembed>.
  877. void perl_construct(PerlInterpreter* interp)
  878. =for hackers
  879. Found in file perl.c
  880. =item perl_destruct
  881. Shuts down a Perl interpreter. See L<perlembed>.
  882. void perl_destruct(PerlInterpreter* interp)
  883. =for hackers
  884. Found in file perl.c
  885. =item perl_free
  886. Releases a Perl interpreter. See L<perlembed>.
  887. void perl_free(PerlInterpreter* interp)
  888. =for hackers
  889. Found in file perl.c
  890. =item perl_parse
  891. Tells a Perl interpreter to parse a Perl script. See L<perlembed>.
  892. int perl_parse(PerlInterpreter* interp, XSINIT_t xsinit, int argc, char** argv, char** env)
  893. =for hackers
  894. Found in file perl.c
  895. =item perl_run
  896. Tells a Perl interpreter to run. See L<perlembed>.
  897. int perl_run(PerlInterpreter* interp)
  898. =for hackers
  899. Found in file perl.c
  900. =item PL_modglobal
  901. C<PL_modglobal> is a general purpose, interpreter global HV for use by
  902. extensions that need to keep information on a per-interpreter basis.
  903. In a pinch, it can also be used as a symbol table for extensions
  904. to share data among each other. It is a good idea to use keys
  905. prefixed by the package name of the extension that owns the data.
  906. HV* PL_modglobal
  907. =for hackers
  908. Found in file intrpvar.h
  909. =item PL_na
  910. A convenience variable which is typically used with C<SvPV> when one
  911. doesn't care about the length of the string. It is usually more efficient
  912. to either declare a local variable and use that instead or to use the
  913. C<SvPV_nolen> macro.
  914. STRLEN PL_na
  915. =for hackers
  916. Found in file thrdvar.h
  917. =item PL_sv_no
  918. This is the C<false> SV. See C<PL_sv_yes>. Always refer to this as
  919. C<&PL_sv_no>.
  920. SV PL_sv_no
  921. =for hackers
  922. Found in file intrpvar.h
  923. =item PL_sv_undef
  924. This is the C<undef> SV. Always refer to this as C<&PL_sv_undef>.
  925. SV PL_sv_undef
  926. =for hackers
  927. Found in file intrpvar.h
  928. =item PL_sv_yes
  929. This is the C<true> SV. See C<PL_sv_no>. Always refer to this as
  930. C<&PL_sv_yes>.
  931. SV PL_sv_yes
  932. =for hackers
  933. Found in file intrpvar.h
  934. =item POPi
  935. Pops an integer off the stack.
  936. IV POPi
  937. =for hackers
  938. Found in file pp.h
  939. =item POPl
  940. Pops a long off the stack.
  941. long POPl
  942. =for hackers
  943. Found in file pp.h
  944. =item POPn
  945. Pops a double off the stack.
  946. NV POPn
  947. =for hackers
  948. Found in file pp.h
  949. =item POPp
  950. Pops a string off the stack.
  951. char* POPp
  952. =for hackers
  953. Found in file pp.h
  954. =item POPs
  955. Pops an SV off the stack.
  956. SV* POPs
  957. =for hackers
  958. Found in file pp.h
  959. =item PUSHi
  960. Push an integer onto the stack. The stack must have room for this element.
  961. Handles 'set' magic. See C<XPUSHi>.
  962. void PUSHi(IV iv)
  963. =for hackers
  964. Found in file pp.h
  965. =item PUSHMARK
  966. Opening bracket for arguments on a callback. See C<PUTBACK> and
  967. L<perlcall>.
  968. PUSHMARK;
  969. =for hackers
  970. Found in file pp.h
  971. =item PUSHn
  972. Push a double onto the stack. The stack must have room for this element.
  973. Handles 'set' magic. See C<XPUSHn>.
  974. void PUSHn(NV nv)
  975. =for hackers
  976. Found in file pp.h
  977. =item PUSHp
  978. Push a string onto the stack. The stack must have room for this element.
  979. The C<len> indicates the length of the string. Handles 'set' magic. See
  980. C<XPUSHp>.
  981. void PUSHp(char* str, STRLEN len)
  982. =for hackers
  983. Found in file pp.h
  984. =item PUSHs
  985. Push an SV onto the stack. The stack must have room for this element.
  986. Does not handle 'set' magic. See C<XPUSHs>.
  987. void PUSHs(SV* sv)
  988. =for hackers
  989. Found in file pp.h
  990. =item PUSHu
  991. Push an unsigned integer onto the stack. The stack must have room for this
  992. element. See C<XPUSHu>.
  993. void PUSHu(UV uv)
  994. =for hackers
  995. Found in file pp.h
  996. =item PUTBACK
  997. Closing bracket for XSUB arguments. This is usually handled by C<xsubpp>.
  998. See C<PUSHMARK> and L<perlcall> for other uses.
  999. PUTBACK;
  1000. =for hackers
  1001. Found in file pp.h
  1002. =item Renew
  1003. The XSUB-writer's interface to the C C<realloc> function.
  1004. void Renew(void* ptr, int nitems, type)
  1005. =for hackers
  1006. Found in file handy.h
  1007. =item Renewc
  1008. The XSUB-writer's interface to the C C<realloc> function, with
  1009. cast.
  1010. void Renewc(void* ptr, int nitems, type, cast)
  1011. =for hackers
  1012. Found in file handy.h
  1013. =item require_pv
  1014. Tells Perl to C<require> a module.
  1015. NOTE: the perl_ form of this function is deprecated.
  1016. void require_pv(const char* pv)
  1017. =for hackers
  1018. Found in file perl.c
  1019. =item RETVAL
  1020. Variable which is setup by C<xsubpp> to hold the return value for an
  1021. XSUB. This is always the proper type for the XSUB. See
  1022. L<perlxs/"The RETVAL Variable">.
  1023. (whatever) RETVAL
  1024. =for hackers
  1025. Found in file XSUB.h
  1026. =item Safefree
  1027. The XSUB-writer's interface to the C C<free> function.
  1028. void Safefree(void* ptr)
  1029. =for hackers
  1030. Found in file handy.h
  1031. =item savepv
  1032. Copy a string to a safe spot. This does not use an SV.
  1033. char* savepv(const char* sv)
  1034. =for hackers
  1035. Found in file util.c
  1036. =item savepvn
  1037. Copy a string to a safe spot. The C<len> indicates number of bytes to
  1038. copy. This does not use an SV.
  1039. char* savepvn(const char* sv, I32 len)
  1040. =for hackers
  1041. Found in file util.c
  1042. =item SAVETMPS
  1043. Opening bracket for temporaries on a callback. See C<FREETMPS> and
  1044. L<perlcall>.
  1045. SAVETMPS;
  1046. =for hackers
  1047. Found in file scope.h
  1048. =item SP
  1049. Stack pointer. This is usually handled by C<xsubpp>. See C<dSP> and
  1050. C<SPAGAIN>.
  1051. =for hackers
  1052. Found in file pp.h
  1053. =item SPAGAIN
  1054. Refetch the stack pointer. Used after a callback. See L<perlcall>.
  1055. SPAGAIN;
  1056. =for hackers
  1057. Found in file pp.h
  1058. =item ST
  1059. Used to access elements on the XSUB's stack.
  1060. SV* ST(int ix)
  1061. =for hackers
  1062. Found in file XSUB.h
  1063. =item strEQ
  1064. Test two strings to see if they are equal. Returns true or false.
  1065. bool strEQ(char* s1, char* s2)
  1066. =for hackers
  1067. Found in file handy.h
  1068. =item strGE
  1069. Test two strings to see if the first, C<s1>, is greater than or equal to
  1070. the second, C<s2>. Returns true or false.
  1071. bool strGE(char* s1, char* s2)
  1072. =for hackers
  1073. Found in file handy.h
  1074. =item strGT
  1075. Test two strings to see if the first, C<s1>, is greater than the second,
  1076. C<s2>. Returns true or false.
  1077. bool strGT(char* s1, char* s2)
  1078. =for hackers
  1079. Found in file handy.h
  1080. =item strLE
  1081. Test two strings to see if the first, C<s1>, is less than or equal to the
  1082. second, C<s2>. Returns true or false.
  1083. bool strLE(char* s1, char* s2)
  1084. =for hackers
  1085. Found in file handy.h
  1086. =item strLT
  1087. Test two strings to see if the first, C<s1>, is less than the second,
  1088. C<s2>. Returns true or false.
  1089. bool strLT(char* s1, char* s2)
  1090. =for hackers
  1091. Found in file handy.h
  1092. =item strNE
  1093. Test two strings to see if they are different. Returns true or
  1094. false.
  1095. bool strNE(char* s1, char* s2)
  1096. =for hackers
  1097. Found in file handy.h
  1098. =item strnEQ
  1099. Test two strings to see if they are equal. The C<len> parameter indicates
  1100. the number of bytes to compare. Returns true or false. (A wrapper for
  1101. C<strncmp>).
  1102. bool strnEQ(char* s1, char* s2, STRLEN len)
  1103. =for hackers
  1104. Found in file handy.h
  1105. =item strnNE
  1106. Test two strings to see if they are different. The C<len> parameter
  1107. indicates the number of bytes to compare. Returns true or false. (A
  1108. wrapper for C<strncmp>).
  1109. bool strnNE(char* s1, char* s2, STRLEN len)
  1110. =for hackers
  1111. Found in file handy.h
  1112. =item StructCopy
  1113. This is an architecture-independent macro to copy one structure to another.
  1114. void StructCopy(type src, type dest, type)
  1115. =for hackers
  1116. Found in file handy.h
  1117. =item SvCUR
  1118. Returns the length of the string which is in the SV. See C<SvLEN>.
  1119. STRLEN SvCUR(SV* sv)
  1120. =for hackers
  1121. Found in file sv.h
  1122. =item SvCUR_set
  1123. Set the length of the string which is in the SV. See C<SvCUR>.
  1124. void SvCUR_set(SV* sv, STRLEN len)
  1125. =for hackers
  1126. Found in file sv.h
  1127. =item SvEND
  1128. Returns a pointer to the last character in the string which is in the SV.
  1129. See C<SvCUR>. Access the character as *(SvEND(sv)).
  1130. char* SvEND(SV* sv)
  1131. =for hackers
  1132. Found in file sv.h
  1133. =item SvGETMAGIC
  1134. Invokes C<mg_get> on an SV if it has 'get' magic. This macro evaluates its
  1135. argument more than once.
  1136. void SvGETMAGIC(SV* sv)
  1137. =for hackers
  1138. Found in file sv.h
  1139. =item SvGROW
  1140. Expands the character buffer in the SV so that it has room for the
  1141. indicated number of bytes (remember to reserve space for an extra trailing
  1142. NUL character). Calls C<sv_grow> to perform the expansion if necessary.
  1143. Returns a pointer to the character buffer.
  1144. void SvGROW(SV* sv, STRLEN len)
  1145. =for hackers
  1146. Found in file sv.h
  1147. =item SvIOK
  1148. Returns a boolean indicating whether the SV contains an integer.
  1149. bool SvIOK(SV* sv)
  1150. =for hackers
  1151. Found in file sv.h
  1152. =item SvIOKp
  1153. Returns a boolean indicating whether the SV contains an integer. Checks
  1154. the B<private> setting. Use C<SvIOK>.
  1155. bool SvIOKp(SV* sv)
  1156. =for hackers
  1157. Found in file sv.h
  1158. =item SvIOK_notUV
  1159. Returns a boolean indicating whether the SV contains an signed integer.
  1160. void SvIOK_notUV(SV* sv)
  1161. =for hackers
  1162. Found in file sv.h
  1163. =item SvIOK_off
  1164. Unsets the IV status of an SV.
  1165. void SvIOK_off(SV* sv)
  1166. =for hackers
  1167. Found in file sv.h
  1168. =item SvIOK_on
  1169. Tells an SV that it is an integer.
  1170. void SvIOK_on(SV* sv)
  1171. =for hackers
  1172. Found in file sv.h
  1173. =item SvIOK_only
  1174. Tells an SV that it is an integer and disables all other OK bits.
  1175. void SvIOK_only(SV* sv)
  1176. =for hackers
  1177. Found in file sv.h
  1178. =item SvIOK_only_UV
  1179. Tells and SV that it is an unsigned integer and disables all other OK bits.
  1180. void SvIOK_only_UV(SV* sv)
  1181. =for hackers
  1182. Found in file sv.h
  1183. =item SvIOK_UV
  1184. Returns a boolean indicating whether the SV contains an unsigned integer.
  1185. void SvIOK_UV(SV* sv)
  1186. =for hackers
  1187. Found in file sv.h
  1188. =item SvIV
  1189. Coerces the given SV to an integer and returns it.
  1190. IV SvIV(SV* sv)
  1191. =for hackers
  1192. Found in file sv.h
  1193. =item SvIVX
  1194. Returns the integer which is stored in the SV, assuming SvIOK is
  1195. true.
  1196. IV SvIVX(SV* sv)
  1197. =for hackers
  1198. Found in file sv.h
  1199. =item SvLEN
  1200. Returns the size of the string buffer in the SV, not including any part
  1201. attributable to C<SvOOK>. See C<SvCUR>.
  1202. STRLEN SvLEN(SV* sv)
  1203. =for hackers
  1204. Found in file sv.h
  1205. =item SvNIOK
  1206. Returns a boolean indicating whether the SV contains a number, integer or
  1207. double.
  1208. bool SvNIOK(SV* sv)
  1209. =for hackers
  1210. Found in file sv.h
  1211. =item SvNIOKp
  1212. Returns a boolean indicating whether the SV contains a number, integer or
  1213. double. Checks the B<private> setting. Use C<SvNIOK>.
  1214. bool SvNIOKp(SV* sv)
  1215. =for hackers
  1216. Found in file sv.h
  1217. =item SvNIOK_off
  1218. Unsets the NV/IV status of an SV.
  1219. void SvNIOK_off(SV* sv)
  1220. =for hackers
  1221. Found in file sv.h
  1222. =item SvNOK
  1223. Returns a boolean indicating whether the SV contains a double.
  1224. bool SvNOK(SV* sv)
  1225. =for hackers
  1226. Found in file sv.h
  1227. =item SvNOKp
  1228. Returns a boolean indicating whether the SV contains a double. Checks the
  1229. B<private> setting. Use C<SvNOK>.
  1230. bool SvNOKp(SV* sv)
  1231. =for hackers
  1232. Found in file sv.h
  1233. =item SvNOK_off
  1234. Unsets the NV status of an SV.
  1235. void SvNOK_off(SV* sv)
  1236. =for hackers
  1237. Found in file sv.h
  1238. =item SvNOK_on
  1239. Tells an SV that it is a double.
  1240. void SvNOK_on(SV* sv)
  1241. =for hackers
  1242. Found in file sv.h
  1243. =item SvNOK_only
  1244. Tells an SV that it is a double and disables all other OK bits.
  1245. void SvNOK_only(SV* sv)
  1246. =for hackers
  1247. Found in file sv.h
  1248. =item SvNV
  1249. Coerce the given SV to a double and return it.
  1250. NV SvNV(SV* sv)
  1251. =for hackers
  1252. Found in file sv.h
  1253. =item SvNVX
  1254. Returns the double which is stored in the SV, assuming SvNOK is
  1255. true.
  1256. NV SvNVX(SV* sv)
  1257. =for hackers
  1258. Found in file sv.h
  1259. =item SvOK
  1260. Returns a boolean indicating whether the value is an SV.
  1261. bool SvOK(SV* sv)
  1262. =for hackers
  1263. Found in file sv.h
  1264. =item SvOOK
  1265. Returns a boolean indicating whether the SvIVX is a valid offset value for
  1266. the SvPVX. This hack is used internally to speed up removal of characters
  1267. from the beginning of a SvPV. When SvOOK is true, then the start of the
  1268. allocated string buffer is really (SvPVX - SvIVX).
  1269. bool SvOOK(SV* sv)
  1270. =for hackers
  1271. Found in file sv.h
  1272. =item SvPOK
  1273. Returns a boolean indicating whether the SV contains a character
  1274. string.
  1275. bool SvPOK(SV* sv)
  1276. =for hackers
  1277. Found in file sv.h
  1278. =item SvPOKp
  1279. Returns a boolean indicating whether the SV contains a character string.
  1280. Checks the B<private> setting. Use C<SvPOK>.
  1281. bool SvPOKp(SV* sv)
  1282. =for hackers
  1283. Found in file sv.h
  1284. =item SvPOK_off
  1285. Unsets the PV status of an SV.
  1286. void SvPOK_off(SV* sv)
  1287. =for hackers
  1288. Found in file sv.h
  1289. =item SvPOK_on
  1290. Tells an SV that it is a string.
  1291. void SvPOK_on(SV* sv)
  1292. =for hackers
  1293. Found in file sv.h
  1294. =item SvPOK_only
  1295. Tells an SV that it is a string and disables all other OK bits.
  1296. void SvPOK_only(SV* sv)
  1297. =for hackers
  1298. Found in file sv.h
  1299. =item SvPOK_only_UTF8
  1300. Tells an SV that it is a UTF8 string (do not use frivolously)
  1301. and disables all other OK bits.
  1302. void SvPOK_only_UTF8(SV* sv)
  1303. =for hackers
  1304. Found in file sv.h
  1305. =item SvPV
  1306. Returns a pointer to the string in the SV, or a stringified form of the SV
  1307. if the SV does not contain a string. Handles 'get' magic.
  1308. char* SvPV(SV* sv, STRLEN len)
  1309. =for hackers
  1310. Found in file sv.h
  1311. =item SvPVX
  1312. Returns a pointer to the string in the SV. The SV must contain a
  1313. string.
  1314. char* SvPVX(SV* sv)
  1315. =for hackers
  1316. Found in file sv.h
  1317. =item SvPV_force
  1318. Like <SvPV> but will force the SV into becoming a string (SvPOK). You want
  1319. force if you are going to update the SvPVX directly.
  1320. char* SvPV_force(SV* sv, STRLEN len)
  1321. =for hackers
  1322. Found in file sv.h
  1323. =item SvPV_nolen
  1324. Returns a pointer to the string in the SV, or a stringified form of the SV
  1325. if the SV does not contain a string. Handles 'get' magic.
  1326. char* SvPV_nolen(SV* sv)
  1327. =for hackers
  1328. Found in file sv.h
  1329. =item SvREFCNT
  1330. Returns the value of the object's reference count.
  1331. U32 SvREFCNT(SV* sv)
  1332. =for hackers
  1333. Found in file sv.h
  1334. =item SvREFCNT_dec
  1335. Decrements the reference count of the given SV.
  1336. void SvREFCNT_dec(SV* sv)
  1337. =for hackers
  1338. Found in file sv.h
  1339. =item SvREFCNT_inc
  1340. Increments the reference count of the given SV.
  1341. SV* SvREFCNT_inc(SV* sv)
  1342. =for hackers
  1343. Found in file sv.h
  1344. =item SvROK
  1345. Tests if the SV is an RV.
  1346. bool SvROK(SV* sv)
  1347. =for hackers
  1348. Found in file sv.h
  1349. =item SvROK_off
  1350. Unsets the RV status of an SV.
  1351. void SvROK_off(SV* sv)
  1352. =for hackers
  1353. Found in file sv.h
  1354. =item SvROK_on
  1355. Tells an SV that it is an RV.
  1356. void SvROK_on(SV* sv)
  1357. =for hackers
  1358. Found in file sv.h
  1359. =item SvRV
  1360. Dereferences an RV to return the SV.
  1361. SV* SvRV(SV* sv)
  1362. =for hackers
  1363. Found in file sv.h
  1364. =item SvSETMAGIC
  1365. Invokes C<mg_set> on an SV if it has 'set' magic. This macro evaluates its
  1366. argument more than once.
  1367. void SvSETMAGIC(SV* sv)
  1368. =for hackers
  1369. Found in file sv.h
  1370. =item SvSetSV
  1371. Calls C<sv_setsv> if dsv is not the same as ssv. May evaluate arguments
  1372. more than once.
  1373. void SvSetSV(SV* dsb, SV* ssv)
  1374. =for hackers
  1375. Found in file sv.h
  1376. =item SvSetSV_nosteal
  1377. Calls a non-destructive version of C<sv_setsv> if dsv is not the same as
  1378. ssv. May evaluate arguments more than once.
  1379. void SvSetSV_nosteal(SV* dsv, SV* ssv)
  1380. =for hackers
  1381. Found in file sv.h
  1382. =item SvSTASH
  1383. Returns the stash of the SV.
  1384. HV* SvSTASH(SV* sv)
  1385. =for hackers
  1386. Found in file sv.h
  1387. =item SvTAINT
  1388. Taints an SV if tainting is enabled
  1389. void SvTAINT(SV* sv)
  1390. =for hackers
  1391. Found in file sv.h
  1392. =item SvTAINTED
  1393. Checks to see if an SV is tainted. Returns TRUE if it is, FALSE if
  1394. not.
  1395. bool SvTAINTED(SV* sv)
  1396. =for hackers
  1397. Found in file sv.h
  1398. =item SvTAINTED_off
  1399. Untaints an SV. Be I<very> careful with this routine, as it short-circuits
  1400. some of Perl's fundamental security features. XS module authors should not
  1401. use this function unless they fully understand all the implications of
  1402. unconditionally untainting the value. Untainting should be done in the
  1403. standard perl fashion, via a carefully crafted regexp, rather than directly
  1404. untainting variables.
  1405. void SvTAINTED_off(SV* sv)
  1406. =for hackers
  1407. Found in file sv.h
  1408. =item SvTAINTED_on
  1409. Marks an SV as tainted.
  1410. void SvTAINTED_on(SV* sv)
  1411. =for hackers
  1412. Found in file sv.h
  1413. =item SvTRUE
  1414. Returns a boolean indicating whether Perl would evaluate the SV as true or
  1415. false, defined or undefined. Does not handle 'get' magic.
  1416. bool SvTRUE(SV* sv)
  1417. =for hackers
  1418. Found in file sv.h
  1419. =item svtype
  1420. An enum of flags for Perl types. These are found in the file B<sv.h>
  1421. in the C<svtype> enum. Test these flags with the C<SvTYPE> macro.
  1422. =for hackers
  1423. Found in file sv.h
  1424. =item SvTYPE
  1425. Returns the type of the SV. See C<svtype>.
  1426. svtype SvTYPE(SV* sv)
  1427. =for hackers
  1428. Found in file sv.h
  1429. =item SVt_IV
  1430. Integer type flag for scalars. See C<svtype>.
  1431. =for hackers
  1432. Found in file sv.h
  1433. =item SVt_NV
  1434. Double type flag for scalars. See C<svtype>.
  1435. =for hackers
  1436. Found in file sv.h
  1437. =item SVt_PV
  1438. Pointer type flag for scalars. See C<svtype>.
  1439. =for hackers
  1440. Found in file sv.h
  1441. =item SVt_PVAV
  1442. Type flag for arrays. See C<svtype>.
  1443. =for hackers
  1444. Found in file sv.h
  1445. =item SVt_PVCV
  1446. Type flag for code refs. See C<svtype>.
  1447. =for hackers
  1448. Found in file sv.h
  1449. =item SVt_PVHV
  1450. Type flag for hashes. See C<svtype>.
  1451. =for hackers
  1452. Found in file sv.h
  1453. =item SVt_PVMG
  1454. Type flag for blessed scalars. See C<svtype>.
  1455. =for hackers
  1456. Found in file sv.h
  1457. =item SvUPGRADE
  1458. Used to upgrade an SV to a more complex form. Uses C<sv_upgrade> to
  1459. perform the upgrade if necessary. See C<svtype>.
  1460. void SvUPGRADE(SV* sv, svtype type)
  1461. =for hackers
  1462. Found in file sv.h
  1463. =item SvUTF8
  1464. Returns a boolean indicating whether the SV contains UTF-8 encoded data.
  1465. void SvUTF8(SV* sv)
  1466. =for hackers
  1467. Found in file sv.h
  1468. =item SvUTF8_off
  1469. Unsets the UTF8 status of an SV.
  1470. void SvUTF8_off(SV *sv)
  1471. =for hackers
  1472. Found in file sv.h
  1473. =item SvUTF8_on
  1474. Tells an SV that it is a string and encoded in UTF8. Do not use frivolously.
  1475. void SvUTF8_on(SV *sv)
  1476. =for hackers
  1477. Found in file sv.h
  1478. =item SvUV
  1479. Coerces the given SV to an unsigned integer and returns it.
  1480. UV SvUV(SV* sv)
  1481. =for hackers
  1482. Found in file sv.h
  1483. =item SvUVX
  1484. Returns the unsigned integer which is stored in the SV, assuming SvIOK is
  1485. true.
  1486. UV SvUVX(SV* sv)
  1487. =for hackers
  1488. Found in file sv.h
  1489. =item sv_2mortal
  1490. Marks an SV as mortal. The SV will be destroyed when the current context
  1491. ends.
  1492. SV* sv_2mortal(SV* sv)
  1493. =for hackers
  1494. Found in file sv.c
  1495. =item sv_bless
  1496. Blesses an SV into a specified package. The SV must be an RV. The package
  1497. must be designated by its stash (see C<gv_stashpv()>). The reference count
  1498. of the SV is unaffected.
  1499. SV* sv_bless(SV* sv, HV* stash)
  1500. =for hackers
  1501. Found in file sv.c
  1502. =item sv_catpv
  1503. Concatenates the string onto the end of the string which is in the SV.
  1504. Handles 'get' magic, but not 'set' magic. See C<sv_catpv_mg>.
  1505. void sv_catpv(SV* sv, const char* ptr)
  1506. =for hackers
  1507. Found in file sv.c
  1508. =item sv_catpvf
  1509. Processes its arguments like C<sprintf> and appends the formatted output
  1510. to an SV. Handles 'get' magic, but not 'set' magic. C<SvSETMAGIC()> must
  1511. typically be called after calling this function to handle 'set' magic.
  1512. void sv_catpvf(SV* sv, const char* pat, ...)
  1513. =for hackers
  1514. Found in file sv.c
  1515. =item sv_catpvf_mg
  1516. Like C<sv_catpvf>, but also handles 'set' magic.
  1517. void sv_catpvf_mg(SV *sv, const char* pat, ...)
  1518. =for hackers
  1519. Found in file sv.c
  1520. =item sv_catpvn
  1521. Concatenates the string onto the end of the string which is in the SV. The
  1522. C<len> indicates number of bytes to copy. Handles 'get' magic, but not
  1523. 'set' magic. See C<sv_catpvn_mg>.
  1524. void sv_catpvn(SV* sv, const char* ptr, STRLEN len)
  1525. =for hackers
  1526. Found in file sv.c
  1527. =item sv_catpvn_mg
  1528. Like C<sv_catpvn>, but also handles 'set' magic.
  1529. void sv_catpvn_mg(SV *sv, const char *ptr, STRLEN len)
  1530. =for hackers
  1531. Found in file sv.c
  1532. =item sv_catpv_mg
  1533. Like C<sv_catpv>, but also handles 'set' magic.
  1534. void sv_catpv_mg(SV *sv, const char *ptr)
  1535. =for hackers
  1536. Found in file sv.c
  1537. =item sv_catsv
  1538. Concatenates the string from SV C<ssv> onto the end of the string in
  1539. SV C<dsv>. Modifies C<dsv> but not C<ssv>. Handles 'get' magic, but
  1540. not 'set' magic. See C<sv_catsv_mg>.
  1541. void sv_catsv(SV* dsv, SV* ssv)
  1542. =for hackers
  1543. Found in file sv.c
  1544. =item sv_catsv_mg
  1545. Like C<sv_catsv>, but also handles 'set' magic.
  1546. void sv_catsv_mg(SV *dstr, SV *sstr)
  1547. =for hackers
  1548. Found in file sv.c
  1549. =item sv_chop
  1550. Efficient removal of characters from the beginning of the string buffer.
  1551. SvPOK(sv) must be true and the C<ptr> must be a pointer to somewhere inside
  1552. the string buffer. The C<ptr> becomes the first character of the adjusted
  1553. string.
  1554. void sv_chop(SV* sv, char* ptr)
  1555. =for hackers
  1556. Found in file sv.c
  1557. =item sv_clear
  1558. Clear an SV, making it empty. Does not free the memory used by the SV
  1559. itself.
  1560. void sv_clear(SV* sv)
  1561. =for hackers
  1562. Found in file sv.c
  1563. =item sv_cmp
  1564. Compares the strings in two SVs. Returns -1, 0, or 1 indicating whether the
  1565. string in C<sv1> is less than, equal to, or greater than the string in
  1566. C<sv2>.
  1567. I32 sv_cmp(SV* sv1, SV* sv2)
  1568. =for hackers
  1569. Found in file sv.c
  1570. =item sv_cmp_locale
  1571. Compares the strings in two SVs in a locale-aware manner. See
  1572. L</sv_cmp_locale>
  1573. I32 sv_cmp_locale(SV* sv1, SV* sv2)
  1574. =for hackers
  1575. Found in file sv.c
  1576. =item sv_dec
  1577. Auto-decrement of the value in the SV.
  1578. void sv_dec(SV* sv)
  1579. =for hackers
  1580. Found in file sv.c
  1581. =item sv_derived_from
  1582. Returns a boolean indicating whether the SV is derived from the specified
  1583. class. This is the function that implements C<UNIVERSAL::isa>. It works
  1584. for class names as well as for objects.
  1585. bool sv_derived_from(SV* sv, const char* name)
  1586. =for hackers
  1587. Found in file universal.c
  1588. =item sv_eq
  1589. Returns a boolean indicating whether the strings in the two SVs are
  1590. identical.
  1591. I32 sv_eq(SV* sv1, SV* sv2)
  1592. =for hackers
  1593. Found in file sv.c
  1594. =item sv_free
  1595. Free the memory used by an SV.
  1596. void sv_free(SV* sv)
  1597. =for hackers
  1598. Found in file sv.c
  1599. =item sv_gets
  1600. Get a line from the filehandle and store it into the SV, optionally
  1601. appending to the currently-stored string.
  1602. char* sv_gets(SV* sv, PerlIO* fp, I32 append)
  1603. =for hackers
  1604. Found in file sv.c
  1605. =item sv_grow
  1606. Expands the character buffer in the SV. This will use C<sv_unref> and will
  1607. upgrade the SV to C<SVt_PV>. Returns a pointer to the character buffer.
  1608. Use C<SvGROW>.
  1609. char* sv_grow(SV* sv, STRLEN newlen)
  1610. =for hackers
  1611. Found in file sv.c
  1612. =item sv_inc
  1613. Auto-increment of the value in the SV.
  1614. void sv_inc(SV* sv)
  1615. =for hackers
  1616. Found in file sv.c
  1617. =item sv_insert
  1618. Inserts a string at the specified offset/length within the SV. Similar to
  1619. the Perl substr() function.
  1620. void sv_insert(SV* bigsv, STRLEN offset, STRLEN len, char* little, STRLEN littlelen)
  1621. =for hackers
  1622. Found in file sv.c
  1623. =item sv_isa
  1624. Returns a boolean indicating whether the SV is blessed into the specified
  1625. class. This does not check for subtypes; use C<sv_derived_from> to verify
  1626. an inheritance relationship.
  1627. int sv_isa(SV* sv, const char* name)
  1628. =for hackers
  1629. Found in file sv.c
  1630. =item sv_isobject
  1631. Returns a boolean indicating whether the SV is an RV pointing to a blessed
  1632. object. If the SV is not an RV, or if the object is not blessed, then this
  1633. will return false.
  1634. int sv_isobject(SV* sv)
  1635. =for hackers
  1636. Found in file sv.c
  1637. =item sv_len
  1638. Returns the length of the string in the SV. See also C<SvCUR>.
  1639. STRLEN sv_len(SV* sv)
  1640. =for hackers
  1641. Found in file sv.c
  1642. =item sv_len_utf8
  1643. Returns the number of characters in the string in an SV, counting wide
  1644. UTF8 bytes as a single character.
  1645. STRLEN sv_len_utf8(SV* sv)
  1646. =for hackers
  1647. Found in file sv.c
  1648. =item sv_magic
  1649. Adds magic to an SV.
  1650. void sv_magic(SV* sv, SV* obj, int how, const char* name, I32 namlen)
  1651. =for hackers
  1652. Found in file sv.c
  1653. =item sv_mortalcopy
  1654. Creates a new SV which is a copy of the original SV. The new SV is marked
  1655. as mortal.
  1656. SV* sv_mortalcopy(SV* oldsv)
  1657. =for hackers
  1658. Found in file sv.c
  1659. =item sv_newmortal
  1660. Creates a new SV which is mortal. The reference count of the SV is set to 1.
  1661. SV* sv_newmortal()
  1662. =for hackers
  1663. Found in file sv.c
  1664. =item sv_pvn_force
  1665. Get a sensible string out of the SV somehow.
  1666. char* sv_pvn_force(SV* sv, STRLEN* lp)
  1667. =for hackers
  1668. Found in file sv.c
  1669. =item sv_pvutf8n_force
  1670. Get a sensible UTF8-encoded string out of the SV somehow. See
  1671. L</sv_pvn_force>.
  1672. char* sv_pvutf8n_force(SV* sv, STRLEN* lp)
  1673. =for hackers
  1674. Found in file sv.c
  1675. =item sv_reftype
  1676. Returns a string describing what the SV is a reference to.
  1677. char* sv_reftype(SV* sv, int ob)
  1678. =for hackers
  1679. Found in file sv.c
  1680. =item sv_replace
  1681. Make the first argument a copy of the second, then delete the original.
  1682. void sv_replace(SV* sv, SV* nsv)
  1683. =for hackers
  1684. Found in file sv.c
  1685. =item sv_rvweaken
  1686. Weaken a reference.
  1687. SV* sv_rvweaken(SV *sv)
  1688. =for hackers
  1689. Found in file sv.c
  1690. =item sv_setiv
  1691. Copies an integer into the given SV. Does not handle 'set' magic. See
  1692. C<sv_setiv_mg>.
  1693. void sv_setiv(SV* sv, IV num)
  1694. =for hackers
  1695. Found in file sv.c
  1696. =item sv_setiv_mg
  1697. Like C<sv_setiv>, but also handles 'set' magic.
  1698. void sv_setiv_mg(SV *sv, IV i)
  1699. =for hackers
  1700. Found in file sv.c
  1701. =item sv_setnv
  1702. Copies a double into the given SV. Does not handle 'set' magic. See
  1703. C<sv_setnv_mg>.
  1704. void sv_setnv(SV* sv, NV num)
  1705. =for hackers
  1706. Found in file sv.c
  1707. =item sv_setnv_mg
  1708. Like C<sv_setnv>, but also handles 'set' magic.
  1709. void sv_setnv_mg(SV *sv, NV num)
  1710. =for hackers
  1711. Found in file sv.c
  1712. =item sv_setpv
  1713. Copies a string into an SV. The string must be null-terminated. Does not
  1714. handle 'set' magic. See C<sv_setpv_mg>.
  1715. void sv_setpv(SV* sv, const char* ptr)
  1716. =for hackers
  1717. Found in file sv.c
  1718. =item sv_setpvf
  1719. Processes its arguments like C<sprintf> and sets an SV to the formatted
  1720. output. Does not handle 'set' magic. See C<sv_setpvf_mg>.
  1721. void sv_setpvf(SV* sv, const char* pat, ...)
  1722. =for hackers
  1723. Found in file sv.c
  1724. =item sv_setpvf_mg
  1725. Like C<sv_setpvf>, but also handles 'set' magic.
  1726. void sv_setpvf_mg(SV *sv, const char* pat, ...)
  1727. =for hackers
  1728. Found in file sv.c
  1729. =item sv_setpviv
  1730. Copies an integer into the given SV, also updating its string value.
  1731. Does not handle 'set' magic. See C<sv_setpviv_mg>.
  1732. void sv_setpviv(SV* sv, IV num)
  1733. =for hackers
  1734. Found in file sv.c
  1735. =item sv_setpviv_mg
  1736. Like C<sv_setpviv>, but also handles 'set' magic.
  1737. void sv_setpviv_mg(SV *sv, IV iv)
  1738. =for hackers
  1739. Found in file sv.c
  1740. =item sv_setpvn
  1741. Copies a string into an SV. The C<len> parameter indicates the number of
  1742. bytes to be copied. Does not handle 'set' magic. See C<sv_setpvn_mg>.
  1743. void sv_setpvn(SV* sv, const char* ptr, STRLEN len)
  1744. =for hackers
  1745. Found in file sv.c
  1746. =item sv_setpvn_mg
  1747. Like C<sv_setpvn>, but also handles 'set' magic.
  1748. void sv_setpvn_mg(SV *sv, const char *ptr, STRLEN len)
  1749. =for hackers
  1750. Found in file sv.c
  1751. =item sv_setpv_mg
  1752. Like C<sv_setpv>, but also handles 'set' magic.
  1753. void sv_setpv_mg(SV *sv, const char *ptr)
  1754. =for hackers
  1755. Found in file sv.c
  1756. =item sv_setref_iv
  1757. Copies an integer into a new SV, optionally blessing the SV. The C<rv>
  1758. argument will be upgraded to an RV. That RV will be modified to point to
  1759. the new SV. The C<classname> argument indicates the package for the
  1760. blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV
  1761. will be returned and will have a reference count of 1.
  1762. SV* sv_setref_iv(SV* rv, const char* classname, IV iv)
  1763. =for hackers
  1764. Found in file sv.c
  1765. =item sv_setref_nv
  1766. Copies a double into a new SV, optionally blessing the SV. The C<rv>
  1767. argument will be upgraded to an RV. That RV will be modified to point to
  1768. the new SV. The C<classname> argument indicates the package for the
  1769. blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV
  1770. will be returned and will have a reference count of 1.
  1771. SV* sv_setref_nv(SV* rv, const char* classname, NV nv)
  1772. =for hackers
  1773. Found in file sv.c
  1774. =item sv_setref_pv
  1775. Copies a pointer into a new SV, optionally blessing the SV. The C<rv>
  1776. argument will be upgraded to an RV. That RV will be modified to point to
  1777. the new SV. If the C<pv> argument is NULL then C<PL_sv_undef> will be placed
  1778. into the SV. The C<classname> argument indicates the package for the
  1779. blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV
  1780. will be returned and will have a reference count of 1.
  1781. Do not use with other Perl types such as HV, AV, SV, CV, because those
  1782. objects will become corrupted by the pointer copy process.
  1783. Note that C<sv_setref_pvn> copies the string while this copies the pointer.
  1784. SV* sv_setref_pv(SV* rv, const char* classname, void* pv)
  1785. =for hackers
  1786. Found in file sv.c
  1787. =item sv_setref_pvn
  1788. Copies a string into a new SV, optionally blessing the SV. The length of the
  1789. string must be specified with C<n>. The C<rv> argument will be upgraded to
  1790. an RV. That RV will be modified to point to the new SV. The C<classname>
  1791. argument indicates the package for the blessing. Set C<classname> to
  1792. C<Nullch> to avoid the blessing. The new SV will be returned and will have
  1793. a reference count of 1.
  1794. Note that C<sv_setref_pv> copies the pointer while this copies the string.
  1795. SV* sv_setref_pvn(SV* rv, const char* classname, char* pv, STRLEN n)
  1796. =for hackers
  1797. Found in file sv.c
  1798. =item sv_setsv
  1799. Copies the contents of the source SV C<ssv> into the destination SV C<dsv>.
  1800. The source SV may be destroyed if it is mortal. Does not handle 'set'
  1801. magic. See the macro forms C<SvSetSV>, C<SvSetSV_nosteal> and
  1802. C<sv_setsv_mg>.
  1803. void sv_setsv(SV* dsv, SV* ssv)
  1804. =for hackers
  1805. Found in file sv.c
  1806. =item sv_setsv_mg
  1807. Like C<sv_setsv>, but also handles 'set' magic.
  1808. void sv_setsv_mg(SV *dstr, SV *sstr)
  1809. =for hackers
  1810. Found in file sv.c
  1811. =item sv_setuv
  1812. Copies an unsigned integer into the given SV. Does not handle 'set' magic.
  1813. See C<sv_setuv_mg>.
  1814. void sv_setuv(SV* sv, UV num)
  1815. =for hackers
  1816. Found in file sv.c
  1817. =item sv_setuv_mg
  1818. Like C<sv_setuv>, but also handles 'set' magic.
  1819. void sv_setuv_mg(SV *sv, UV u)
  1820. =for hackers
  1821. Found in file sv.c
  1822. =item sv_true
  1823. Returns true if the SV has a true value by Perl's rules.
  1824. I32 sv_true(SV *sv)
  1825. =for hackers
  1826. Found in file sv.c
  1827. =item sv_unmagic
  1828. Removes magic from an SV.
  1829. int sv_unmagic(SV* sv, int type)
  1830. =for hackers
  1831. Found in file sv.c
  1832. =item sv_unref
  1833. Unsets the RV status of the SV, and decrements the reference count of
  1834. whatever was being referenced by the RV. This can almost be thought of
  1835. as a reversal of C<newSVrv>. See C<SvROK_off>.
  1836. void sv_unref(SV* sv)
  1837. =for hackers
  1838. Found in file sv.c
  1839. =item sv_upgrade
  1840. Upgrade an SV to a more complex form. Use C<SvUPGRADE>. See
  1841. C<svtype>.
  1842. bool sv_upgrade(SV* sv, U32 mt)
  1843. =for hackers
  1844. Found in file sv.c
  1845. =item sv_usepvn
  1846. Tells an SV to use C<ptr> to find its string value. Normally the string is
  1847. stored inside the SV but sv_usepvn allows the SV to use an outside string.
  1848. The C<ptr> should point to memory that was allocated by C<malloc>. The
  1849. string length, C<len>, must be supplied. This function will realloc the
  1850. memory pointed to by C<ptr>, so that pointer should not be freed or used by
  1851. the programmer after giving it to sv_usepvn. Does not handle 'set' magic.
  1852. See C<sv_usepvn_mg>.
  1853. void sv_usepvn(SV* sv, char* ptr, STRLEN len)
  1854. =for hackers
  1855. Found in file sv.c
  1856. =item sv_usepvn_mg
  1857. Like C<sv_usepvn>, but also handles 'set' magic.
  1858. void sv_usepvn_mg(SV *sv, char *ptr, STRLEN len)
  1859. =for hackers
  1860. Found in file sv.c
  1861. =item sv_utf8_downgrade
  1862. Attempt to convert the PV of an SV from UTF8-encoded to byte encoding.
  1863. This may not be possible if the PV contains non-byte encoding characters;
  1864. if this is the case, either returns false or, if C<fail_ok> is not
  1865. true, croaks.
  1866. NOTE: this function is experimental and may change or be
  1867. removed without notice.
  1868. bool sv_utf8_downgrade(SV *sv, bool fail_ok)
  1869. =for hackers
  1870. Found in file sv.c
  1871. =item sv_utf8_encode
  1872. Convert the PV of an SV to UTF8-encoded, but then turn off the C<SvUTF8>
  1873. flag so that it looks like bytes again. Nothing calls this.
  1874. NOTE: this function is experimental and may change or be
  1875. removed without notice.
  1876. void sv_utf8_encode(SV *sv)
  1877. =for hackers
  1878. Found in file sv.c
  1879. =item sv_utf8_upgrade
  1880. Convert the PV of an SV to its UTF8-encoded form.
  1881. NOTE: this function is experimental and may change or be
  1882. removed without notice.
  1883. void sv_utf8_upgrade(SV *sv)
  1884. =for hackers
  1885. Found in file sv.c
  1886. =item sv_vcatpvfn
  1887. Processes its arguments like C<vsprintf> and appends the formatted output
  1888. to an SV. Uses an array of SVs if the C style variable argument list is
  1889. missing (NULL). When running with taint checks enabled, indicates via
  1890. C<maybe_tainted> if results are untrustworthy (often due to the use of
  1891. locales).
  1892. void sv_vcatpvfn(SV* sv, const char* pat, STRLEN patlen, va_list* args, SV** svargs, I32 svmax, bool *maybe_tainted)
  1893. =for hackers
  1894. Found in file sv.c
  1895. =item sv_vsetpvfn
  1896. Works like C<vcatpvfn> but copies the text into the SV instead of
  1897. appending it.
  1898. void sv_vsetpvfn(SV* sv, const char* pat, STRLEN patlen, va_list* args, SV** svargs, I32 svmax, bool *maybe_tainted)
  1899. =for hackers
  1900. Found in file sv.c
  1901. =item THIS
  1902. Variable which is setup by C<xsubpp> to designate the object in a C++
  1903. XSUB. This is always the proper type for the C++ object. See C<CLASS> and
  1904. L<perlxs/"Using XS With C++">.
  1905. (whatever) THIS
  1906. =for hackers
  1907. Found in file XSUB.h
  1908. =item toLOWER
  1909. Converts the specified character to lowercase.
  1910. char toLOWER(char ch)
  1911. =for hackers
  1912. Found in file handy.h
  1913. =item toUPPER
  1914. Converts the specified character to uppercase.
  1915. char toUPPER(char ch)
  1916. =for hackers
  1917. Found in file handy.h
  1918. =item utf8_distance
  1919. Returns the number of UTF8 characters between the UTF-8 pointers C<a>
  1920. and C<b>.
  1921. WARNING: use only if you *know* that the pointers point inside the
  1922. same UTF-8 buffer.
  1923. NOTE: this function is experimental and may change or be
  1924. removed without notice.
  1925. IV utf8_distance(U8 *a, U8 *b)
  1926. =for hackers
  1927. Found in file utf8.c
  1928. =item utf8_hop
  1929. Return the UTF-8 pointer C<s> displaced by C<off> characters, either
  1930. forward or backward.
  1931. WARNING: do not use the following unless you *know* C<off> is within
  1932. the UTF-8 data pointed to by C<s> *and* that on entry C<s> is aligned
  1933. on the first byte of character or just after the last byte of a character.
  1934. NOTE: this function is experimental and may change or be
  1935. removed without notice.
  1936. U8* utf8_hop(U8 *s, I32 off)
  1937. =for hackers
  1938. Found in file utf8.c
  1939. =item utf8_length
  1940. Return the length of the UTF-8 char encoded string C<s> in characters.
  1941. Stops at C<e> (inclusive). If C<e E<lt> s> or if the scan would end
  1942. up past C<e>, croaks.
  1943. NOTE: this function is experimental and may change or be
  1944. removed without notice.
  1945. STRLEN utf8_length(U8* s, U8 *e)
  1946. =for hackers
  1947. Found in file utf8.c
  1948. =item utf8_to_bytes
  1949. Converts a string C<s> of length C<len> from UTF8 into byte encoding.
  1950. Unlike C<bytes_to_utf8>, this over-writes the original string, and
  1951. updates len to contain the new length.
  1952. Returns zero on failure, setting C<len> to -1.
  1953. NOTE: this function is experimental and may change or be
  1954. removed without notice.
  1955. U8* utf8_to_bytes(U8 *s, STRLEN *len)
  1956. =for hackers
  1957. Found in file utf8.c
  1958. =item utf8_to_uv
  1959. Returns the character value of the first character in the string C<s>
  1960. which is assumed to be in UTF8 encoding and no longer than C<curlen>;
  1961. C<retlen> will be set to the length, in bytes, of that character.
  1962. If C<s> does not point to a well-formed UTF8 character, the behaviour
  1963. is dependent on the value of C<flags>: if it contains UTF8_CHECK_ONLY,
  1964. it is assumed that the caller will raise a warning, and this function
  1965. will silently just set C<retlen> to C<-1> and return zero. If the
  1966. C<flags> does not contain UTF8_CHECK_ONLY, warnings about
  1967. malformations will be given, C<retlen> will be set to the expected
  1968. length of the UTF-8 character in bytes, and zero will be returned.
  1969. The C<flags> can also contain various flags to allow deviations from
  1970. the strict UTF-8 encoding (see F<utf8.h>).
  1971. NOTE: this function is experimental and may change or be
  1972. removed without notice.
  1973. UV utf8_to_uv(U8 *s, STRLEN curlen, STRLEN* retlen, U32 flags)
  1974. =for hackers
  1975. Found in file utf8.c
  1976. =item utf8_to_uv_simple
  1977. Returns the character value of the first character in the string C<s>
  1978. which is assumed to be in UTF8 encoding; C<retlen> will be set to the
  1979. length, in bytes, of that character.
  1980. If C<s> does not point to a well-formed UTF8 character, zero is
  1981. returned and retlen is set, if possible, to -1.
  1982. NOTE: this function is experimental and may change or be
  1983. removed without notice.
  1984. UV utf8_to_uv_simple(U8 *s, STRLEN* retlen)
  1985. =for hackers
  1986. Found in file utf8.c
  1987. =item uv_to_utf8
  1988. Adds the UTF8 representation of the Unicode codepoint C<uv> to the end
  1989. of the string C<d>; C<d> should be have at least C<UTF8_MAXLEN+1> free
  1990. bytes available. The return value is the pointer to the byte after the
  1991. end of the new character. In other words,
  1992. d = uv_to_utf8(d, uv);
  1993. is the recommended Unicode-aware way of saying
  1994. *(d++) = uv;
  1995. NOTE: this function is experimental and may change or be
  1996. removed without notice.
  1997. U8* uv_to_utf8(U8 *d, UV uv)
  1998. =for hackers
  1999. Found in file utf8.c
  2000. =item warn
  2001. This is the XSUB-writer's interface to Perl's C<warn> function. Use this
  2002. function the same way you use the C C<printf> function. See
  2003. C<croak>.
  2004. void warn(const char* pat, ...)
  2005. =for hackers
  2006. Found in file util.c
  2007. =item XPUSHi
  2008. Push an integer onto the stack, extending the stack if necessary. Handles
  2009. 'set' magic. See C<PUSHi>.
  2010. void XPUSHi(IV iv)
  2011. =for hackers
  2012. Found in file pp.h
  2013. =item XPUSHn
  2014. Push a double onto the stack, extending the stack if necessary. Handles
  2015. 'set' magic. See C<PUSHn>.
  2016. void XPUSHn(NV nv)
  2017. =for hackers
  2018. Found in file pp.h
  2019. =item XPUSHp
  2020. Push a string onto the stack, extending the stack if necessary. The C<len>
  2021. indicates the length of the string. Handles 'set' magic. See
  2022. C<PUSHp>.
  2023. void XPUSHp(char* str, STRLEN len)
  2024. =for hackers
  2025. Found in file pp.h
  2026. =item XPUSHs
  2027. Push an SV onto the stack, extending the stack if necessary. Does not
  2028. handle 'set' magic. See C<PUSHs>.
  2029. void XPUSHs(SV* sv)
  2030. =for hackers
  2031. Found in file pp.h
  2032. =item XPUSHu
  2033. Push an unsigned integer onto the stack, extending the stack if necessary.
  2034. See C<PUSHu>.
  2035. void XPUSHu(UV uv)
  2036. =for hackers
  2037. Found in file pp.h
  2038. =item XS
  2039. Macro to declare an XSUB and its C parameter list. This is handled by
  2040. C<xsubpp>.
  2041. =for hackers
  2042. Found in file XSUB.h
  2043. =item XSRETURN
  2044. Return from XSUB, indicating number of items on the stack. This is usually
  2045. handled by C<xsubpp>.
  2046. void XSRETURN(int nitems)
  2047. =for hackers
  2048. Found in file XSUB.h
  2049. =item XSRETURN_EMPTY
  2050. Return an empty list from an XSUB immediately.
  2051. XSRETURN_EMPTY;
  2052. =for hackers
  2053. Found in file XSUB.h
  2054. =item XSRETURN_IV
  2055. Return an integer from an XSUB immediately. Uses C<XST_mIV>.
  2056. void XSRETURN_IV(IV iv)
  2057. =for hackers
  2058. Found in file XSUB.h
  2059. =item XSRETURN_NO
  2060. Return C<&PL_sv_no> from an XSUB immediately. Uses C<XST_mNO>.
  2061. XSRETURN_NO;
  2062. =for hackers
  2063. Found in file XSUB.h
  2064. =item XSRETURN_NV
  2065. Return an double from an XSUB immediately. Uses C<XST_mNV>.
  2066. void XSRETURN_NV(NV nv)
  2067. =for hackers
  2068. Found in file XSUB.h
  2069. =item XSRETURN_PV
  2070. Return a copy of a string from an XSUB immediately. Uses C<XST_mPV>.
  2071. void XSRETURN_PV(char* str)
  2072. =for hackers
  2073. Found in file XSUB.h
  2074. =item XSRETURN_UNDEF
  2075. Return C<&PL_sv_undef> from an XSUB immediately. Uses C<XST_mUNDEF>.
  2076. XSRETURN_UNDEF;
  2077. =for hackers
  2078. Found in file XSUB.h
  2079. =item XSRETURN_YES
  2080. Return C<&PL_sv_yes> from an XSUB immediately. Uses C<XST_mYES>.
  2081. XSRETURN_YES;
  2082. =for hackers
  2083. Found in file XSUB.h
  2084. =item XST_mIV
  2085. Place an integer into the specified position C<pos> on the stack. The
  2086. value is stored in a new mortal SV.
  2087. void XST_mIV(int pos, IV iv)
  2088. =for hackers
  2089. Found in file XSUB.h
  2090. =item XST_mNO
  2091. Place C<&PL_sv_no> into the specified position C<pos> on the
  2092. stack.
  2093. void XST_mNO(int pos)
  2094. =for hackers
  2095. Found in file XSUB.h
  2096. =item XST_mNV
  2097. Place a double into the specified position C<pos> on the stack. The value
  2098. is stored in a new mortal SV.
  2099. void XST_mNV(int pos, NV nv)
  2100. =for hackers
  2101. Found in file XSUB.h
  2102. =item XST_mPV
  2103. Place a copy of a string into the specified position C<pos> on the stack.
  2104. The value is stored in a new mortal SV.
  2105. void XST_mPV(int pos, char* str)
  2106. =for hackers
  2107. Found in file XSUB.h
  2108. =item XST_mUNDEF
  2109. Place C<&PL_sv_undef> into the specified position C<pos> on the
  2110. stack.
  2111. void XST_mUNDEF(int pos)
  2112. =for hackers
  2113. Found in file XSUB.h
  2114. =item XST_mYES
  2115. Place C<&PL_sv_yes> into the specified position C<pos> on the
  2116. stack.
  2117. void XST_mYES(int pos)
  2118. =for hackers
  2119. Found in file XSUB.h
  2120. =item XS_VERSION
  2121. The version identifier for an XS module. This is usually
  2122. handled automatically by C<ExtUtils::MakeMaker>. See C<XS_VERSION_BOOTCHECK>.
  2123. =for hackers
  2124. Found in file XSUB.h
  2125. =item XS_VERSION_BOOTCHECK
  2126. Macro to verify that a PM module's $VERSION variable matches the XS
  2127. module's C<XS_VERSION> variable. This is usually handled automatically by
  2128. C<xsubpp>. See L<perlxs/"The VERSIONCHECK: Keyword">.
  2129. XS_VERSION_BOOTCHECK;
  2130. =for hackers
  2131. Found in file XSUB.h
  2132. =item Zero
  2133. The XSUB-writer's interface to the C C<memzero> function. The C<dest> is the
  2134. destination, C<nitems> is the number of items, and C<type> is the type.
  2135. void Zero(void* dest, int nitems, type)
  2136. =for hackers
  2137. Found in file handy.h
  2138. =back
  2139. =head1 AUTHORS
  2140. Until May 1997, this document was maintained by Jeff Okamoto
  2141. <[email protected]>. It is now maintained as part of Perl itself.
  2142. With lots of help and suggestions from Dean Roehrich, Malcolm Beattie,
  2143. Andreas Koenig, Paul Hudson, Ilya Zakharevich, Paul Marquess, Neil
  2144. Bowers, Matthew Green, Tim Bunce, Spider Boardman, Ulrich Pfeifer,
  2145. Stephen McCamant, and Gurusamy Sarathy.
  2146. API Listing originally by Dean Roehrich <[email protected]>.
  2147. Updated to be autogenerated from comments in the source by Benjamin Stuhl.
  2148. =head1 SEE ALSO
  2149. perlguts(1), perlxs(1), perlxstut(1), perlintern(1)