home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _19ebf58df57057be7531d339458c4194 < prev    next >
Encoding:
Text File  |  2004-06-01  |  15.6 KB  |  498 lines

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2.  
  3. <HTML>
  4. <HEAD>
  5. <TITLE>PerlEz - Perl host DLL</TITLE>
  6. <LINK REL="stylesheet" HREF="../../Active.css" TYPE="text/css">
  7. <LINK REV="made" HREF="mailto:">
  8. </HEAD>
  9.  
  10. <BODY>
  11.  
  12. <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#EAE2BB">
  13. <tr> 
  14. <td width="57"><a target=_blank href="http://www.ActiveState.com/ActivePerl/">
  15. <img src="../../images/activeperl_logo.gif" width="57" height="48" border="0" alt="ActivePerl"></a></td>
  16. <td><div align="center" class="heading">ActivePerl User Guide</div></td>
  17. <td width="112"><a target=_blank  href="http://www.ActiveState.com">
  18. <img src="../../images/AS_logo.gif" width="112" height="48" border="0"  alt="ActiveState" /></a></td>
  19. </tr>
  20. <tr>
  21. <td class="lineColour" colspan="3"></td>
  22. </tr>
  23. </table>
  24.  
  25. <h1>PerlEz - Perl Host DLL</h1>
  26.  
  27. <A NAME="__index__"></A>
  28. <!-- INDEX BEGIN -->
  29.  
  30. <ul>
  31.     <li><a class="doc" href="#datatypes">Datatypes</a></li>
  32.     <li><a class="doc" href="#perlezcreate">PerlEzCreate</a></li>
  33.     <li><a class="doc" href="#perlezcreateopt">PerlEzCreateOpt</a></li>
  34.     <li><a class="doc" href="#perlezdelete">PerlEzDelete</a></li>
  35.     <li><a class="doc" href="#perlezevalstring">PerlEzEvalString</a></li>
  36.     <li><a class="doc" href="#perlezcall1">PerlEzCall1</a></li>
  37.     <li><a class="doc" href="#perlezcall2">PerlEzCall2</a></li>
  38.     <li><a class="doc" href="#perlezcall4">PerlEzCall4</a></li>
  39.     <li><a class="doc" href="#perlezcall8">PerlEzCall8</a></li>
  40.     <li><a class="doc" href="#perlezcall">PerlEzCall</a></li>
  41.     <li><a class="doc" href="#perlezcallcontext">PerlEzCallContext</a></li>
  42.     <li><a class="doc" href="#perlezsetmagicscalarfunctions">PerlEzSetMagicScalarFunctions</a></li>
  43.     <li><a class="doc" href="#perlezsetmagicscalarname">PerlEzSetMagicScalarName</a></li>
  44.     <li><a class="doc" href="#format string">Format String</a></li>
  45.     <li><a class="doc" href="#error codes">Error Codes</a></li>
  46.     <li><a class="doc" href="#authors">Authors</a></li>
  47. </ul>
  48. <!-- INDEX END -->
  49.  
  50. <P>
  51. <P>This document attempts to describe the functions of the PerlEz host Dynamically
  52. Linked Library (DLL). Please refer any questions or comments to the author below.</P>
  53. <P>
  54. <H2><A NAME="datatypes">Datatypes</A></H2>
  55. <P>PerlEz has one specific data type, PERLEZHANDLE; this is a non-zero handle to
  56. a Perl interpreter that is created and can be accessed by the routines described below.</P>
  57. <P>
  58. <H2><A NAME="perlezcreate">PerlEzCreate</A></H2>
  59. <PRE>
  60.  PERLEZHANDLE PerlEzCreate(LPCSTR lpFileName, LPCSTR lpOptions);</PRE>
  61. <DL>
  62. <DT><STRONG><A NAME="item_DESCRIPTION%3A">DESCRIPTION:</A></STRONG><BR>
  63. <DD>
  64. <LI>
  65. Creates a Perl interpreter. The return value is required parameter for all subsequent æPerlEzÆ calls.
  66. Multiple interpreters can be created, but only one will be executing at a time.
  67. <P></P>
  68. <DT><STRONG><A NAME="item_PARAMS%3A">PARAMS:</A></STRONG><BR>
  69. <DD>
  70. <LI>
  71. lpFileName a pointer to a ASCIIZ string that is the name of a file; can be NULL
  72. <P></P>
  73. <LI>
  74. lpOptions a pointer to a ASCIIZ string that are the command line options that
  75. will be provided before the script; can be NULL. This parameter is used for setting @INC or debugging.
  76. <P></P>
  77. <DT><STRONG><A NAME="item_RETURNS%3A">RETURNS:</A></STRONG><BR>
  78. <DD>
  79. <LI>
  80. A non zero handle to a Perl interpreter if successful; zero otherwise. Call PerlEzDelete to release this handle.
  81. <P>See also <A HREF="#perlezdelete">PerlEzDelete</A> <A HREF="#perlezcreateopt">PerlEzCreateOpt</A></P>
  82. <P></P></DL>
  83. <P>
  84. <H2><A NAME="perlezcreateopt">PerlEzCreateOpt</A></H2>
  85. <PRE>
  86.  PERLEZHANDLE PerlEzCreateOpt(LPCSTR lpFileName, LPCSTR lpOptions, LPCSTR lpScriptOpts);</PRE>
  87. <DL>
  88. <DT><STRONG>DESCRIPTION:</STRONG><BR>
  89. <DD>
  90. <LI>
  91. Creates a Perl interpreter. The return value is required parameter for all subsequent æPerlEzÆ calls.
  92. Multiple interpreters can be created, but only one will be executing at a time.
  93. <P></P>
  94. <DT><STRONG>PARAMS:</STRONG><BR>
  95. <DD>
  96. <LI>
  97. lpFileName a pointer to a ASCIIZ string that is the name of a file; can be NULL
  98. <P></P>
  99. <LI>
  100. lpOptions a pointer to a ASCIIZ string that are the command line options that
  101. will be provided before the script; can be NULL. This parameter is used for setting @INC or debugging.
  102. <P></P>
  103. <LI>
  104. lpScriptOpts a pointer to a ASCIIZ string that are the command line options that
  105. will be provided as parameters to the script; can be NULL.
  106. <P></P>
  107. <DT><STRONG>RETURNS:</STRONG><BR>
  108. <DD>
  109. <LI>
  110. A non zero handle to a Perl interpreter if successful; zero otherwise. Call PerlEzDelete to release this handle.
  111. <P>See also <A HREF="#perlezdelete">PerlEzDelete</A> <A HREF="#perlezcreate">PerlEzCreate</A></P>
  112. <P></P></DL>
  113. <P>
  114. <H2><A NAME="perlezdelete">PerlEzDelete</A></H2>
  115. <PRE>
  116.  BOOL PerlEzDelete(PERLEZHANDLE hHandle);</PRE>
  117. <DL>
  118. <DT><STRONG>DESCRIPTION:</STRONG><BR>
  119. <DD>
  120. <LI>
  121. Deletes a previously created Perl interpreter. Releases all resources allocated by PerlEzCreate or PerlEzCreateOpt.
  122. <P></P>
  123. <DT><STRONG>PARAMS:</STRONG><BR>
  124. <DD>
  125. <LI>
  126. hHandle    a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
  127. <P></P>
  128. <DT><STRONG>RETURNS:</STRONG><BR>
  129. <DD>
  130. <LI>
  131. True if no error false otherwise.
  132. <P></P></DL>
  133. <P>
  134. <H2><A NAME="perlezevalstring">PerlEzEvalString</A></H2>
  135. <PRE>
  136.  int PerlEzEvalString(PERLEZHANDLE hHandle, LPCSTR lpString, LPSTR lpBuffer, DWORD dwBufSize);</PRE>
  137. <DL>
  138. <DT><STRONG>DESCRIPTION:</STRONG><BR>
  139. <DD>
  140. <LI>
  141. Evaluates the string a returns the result in lpBuffer. If there is an error $! is returned in lpBuffer.
  142. <P></P>
  143. <DT><STRONG>PARAMS:</STRONG><BR>
  144. <DD>
  145. <LI>
  146. hHandle    a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
  147. <P></P>
  148. <LI>
  149. lpString a pointer to the ASCIIZ string to evaluate
  150. <P></P>
  151. <LI>
  152. lpBuffer a pointer to the buffer where the result will be placed
  153. <P></P>
  154. <LI>
  155. dwBufSize the size in bytes of the space where lpBuffer points
  156. <P></P>
  157. <DT><STRONG>RETURNS:</STRONG><BR>
  158. <DD>
  159. <LI>
  160. A zero if no error; otherwise error code. See <A HREF="#error codes">Error Codes</A>
  161. <P></P></DL>
  162. <P>
  163. <H2><A NAME="perlezcall1">PerlEzCall1</A></H2>
  164. <PRE>
  165.  int PerlEzCall1(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPSTR lpBuffer, DWORD dwBufSize, LPCSTR lpFormat, LPVOID lpVoid);</PRE>
  166. <DL>
  167. <DT><STRONG>DESCRIPTION:</STRONG><BR>
  168. <DD>
  169. <LI>
  170. Calls the function lpFunction and returns the result in the buffer lpBuffer.
  171. <P></P>
  172. <DT><STRONG>PARAMS:</STRONG><BR>
  173. <DD>
  174. <LI>
  175. hHandle    a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
  176. <P></P>
  177. <LI>
  178. lpFunction a pointer name of the function to call
  179. <P></P>
  180. <LI>
  181. lpBuffer a pointer to the buffer where the result will be placed
  182. <P></P>
  183. <LI>
  184. dwBufSize the size in bytes of the space where lpBuffer points
  185. <P></P>
  186. <LI>
  187. lpFormat a pointer to the parameter specifier; can be NULL. See <A HREF="#format string">Format String</A>
  188. <P></P>
  189. <LI>
  190. lpVoid a pointer to a parameter will be interpreted based on lpFormat
  191. <P></P>
  192. <DT><STRONG>RETURNS:</STRONG><BR>
  193. <DD>
  194. <LI>
  195. A zero if no error; otherwise error code. See <A HREF="#error codes">Error Codes</A>
  196. <P></P></DL>
  197. <P>
  198. <H2><A NAME="perlezcall2">PerlEzCall2</A></H2>
  199. <PRE>
  200.  int PerlEzCall2(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPSTR lpBuffer, DWORD dwBufSize,
  201.   LPCSTR lpFormat, LPVOID lpVoid1, LPVOID lpVoid2);</PRE>
  202. <DL>
  203. <DT><STRONG>DESCRIPTION:</STRONG><BR>
  204. <DD>
  205. <LI>
  206. Calls the function lpFunction and returns the result in the buffer lpBuffer.
  207. <P></P>
  208. <DT><STRONG>PARAMS:</STRONG><BR>
  209. <DD>
  210. <LI>
  211. hHandle    a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
  212. <P></P>
  213. <LI>
  214. lpFunction a pointer name of the function to call
  215. <P></P>
  216. <LI>
  217. lpBuffer a pointer to the buffer where the result will be placed
  218. <P></P>
  219. <LI>
  220. dwBufSize the size in bytes of the space where lpBuffer points
  221. <P></P>
  222. <LI>
  223. lpFormat a pointer to the parameter specifier; can be NULL. See <A HREF="#format string">Format String</A>
  224. <P></P>
  225. <LI>
  226. lpVoid1...2 pointers to parameters that will be interpreted based on lpFormat
  227. <P></P>
  228. <DT><STRONG>RETURNS:</STRONG><BR>
  229. <DD>
  230. <LI>
  231. A zero if no error; otherwise error code. See <A HREF="#error codes">Error Codes</A>
  232. <P></P></DL>
  233. <P>
  234. <H2><A NAME="perlezcall4">PerlEzCall4</A></H2>
  235. <PRE>
  236.  int PerlEzCall4(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPSTR lpBuffer, DWORD dwBufSize,
  237.    LPCSTR lpFormat, LPVOID lpVoid1, LPVOID lpVoid2, LPVOID lpVoid3, LPVOID lpVoid4);</PRE>
  238. <DL>
  239. <DT><STRONG>DESCRIPTION:</STRONG><BR>
  240. <DD>
  241. <LI>
  242. Calls the function lpFunction and returns the result in the buffer lpBuffer.
  243. <P></P>
  244. <DT><STRONG>PARAMS:</STRONG><BR>
  245. <DD>
  246. <LI>
  247. hHandle    a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
  248. <P></P>
  249. <LI>
  250. lpFunction a pointer name of the function to call
  251. <P></P>
  252. <LI>
  253. lpBuffer a pointer to the buffer where the result will be placed
  254. <P></P>
  255. <LI>
  256. dwBufSize the size in bytes of the space where lpBuffer points
  257. <P></P>
  258. <LI>
  259. lpFormat a pointer to the parameter specifier; can be NULL. See <A HREF="#format string">Format String</A>
  260. <P></P>
  261. <LI>
  262. lpVoid1...4 pointers to parameters that will be interpreted based on lpFormat
  263. <P></P>
  264. <DT><STRONG>RETURNS:</STRONG><BR>
  265. <DD>
  266. <LI>
  267. A zero if no error; otherwise error code. See <A HREF="#error codes">Error Codes</A>
  268. <P></P></DL>
  269. <P>
  270. <H2><A NAME="perlezcall8">PerlEzCall8</A></H2>
  271. <PRE>
  272.  int PerlEzCall8(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPSTR lpBuffer, DWORD dwBufSize,
  273.    LPCSTR lpFormat, LPVOID lpVoid1, LPVOID lpVoid2, LPVOID lpVoid3, LPVOID lpVoid4, LPVOID lpVoid5,
  274.    LPVOID lpVoid6, LPVOID lpVoid7, LPVOID lpVoid8);</PRE>
  275. <DL>
  276. <DT><STRONG>DESCRIPTION:</STRONG><BR>
  277. <DD>
  278. <LI>
  279. Calls the function lpFunction and returns the result in the buffer lpBuffer.
  280. <P></P>
  281. <DT><STRONG>PARAMS:</STRONG><BR>
  282. <DD>
  283. <LI>
  284. hHandle    a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
  285. <P></P>
  286. <LI>
  287. lpFunction a pointer name of the function to call
  288. <P></P>
  289. <LI>
  290. lpBuffer a pointer to the buffer where the result will be placed
  291. <P></P>
  292. <LI>
  293. dwBufSize the size in bytes of the space where lpBuffer points
  294. <P></P>
  295. <LI>
  296. lpFormat a pointer to the parameter specifier; can be NULL. See <A HREF="#format string">Format String</A>
  297. <P></P>
  298. <LI>
  299. lpVoid1...8 pointers to parameters that will be interpreted based on lpFormat
  300. <P></P>
  301. <DT><STRONG>RETURNS:</STRONG><BR>
  302. <DD>
  303. <LI>
  304. A zero if no error; otherwise error code. See <A HREF="#error codes">Error Codes</A>
  305. <P></P></DL>
  306. <P>
  307. <H2><A NAME="perlezcall">PerlEzCall</A></H2>
  308. <PRE>
  309.  int PerlEzCall(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPSTR lpBuffer, DWORD dwBufSize,
  310.    LPCSTR lpFormat, ...);</PRE>
  311. <DL>
  312. <DT><STRONG>DESCRIPTION:</STRONG><BR>
  313. <DD>
  314. <LI>
  315. Calls the function lpFunction and returns the result in the buffer lpBuffer.
  316. <P></P>
  317. <DT><STRONG>PARAMS:</STRONG><BR>
  318. <DD>
  319. <LI>
  320. hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
  321. <P></P>
  322. <LI>
  323. lpFunction a pointer name of the function to call
  324. <P></P>
  325. <LI>
  326. lpBuffer a pointer to the buffer where the result will be placed
  327. <P></P>
  328. <LI>
  329. dwBufSize the size in bytes of the space where lpBuffer points
  330. <P></P>
  331. <LI>
  332. lpFormat a pointer to the parameter specifier; can be NULL. See <A HREF="#format string">Format String</A>
  333. <P></P>
  334. <LI>
  335. ... parameters to be interpreted based on lpFormat
  336. <P></P>
  337. <DT><STRONG>RETURNS:</STRONG><BR>
  338. <DD>
  339. <LI>
  340. A zero if no error; otherwise error code. See <A HREF="#error codes">Error Codes</A>
  341. <P></P></DL>
  342. <P>
  343. <H2><A NAME="perlezcallcontext">PerlEzCallContext</A></H2>
  344. <PRE>
  345.  int PerlEzCallContext(PERLEZHANDLE hHandle, LPCSTR lpFunction, LPVOID lpContextInfo,
  346.    LPSTR lpBuffer, DWORD dwBufSize, LPCSTR lpFormat, ...);</PRE>
  347. <DL>
  348. <DT><STRONG>DESCRIPTION:</STRONG><BR>
  349. <DD>
  350. <LI>
  351. Calls the function lpFunction and returns the result in the buffer lpBuffer.
  352. <P></P>
  353. <DT><STRONG>PARAMS:</STRONG><BR>
  354. <DD>
  355. <LI>
  356. hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
  357. <P></P>
  358. <LI>
  359. lpFunction a pointer name of the function to call
  360. <P></P>
  361. <LI>
  362. lpContextInfo context info for magic fetch and store functions
  363. <P></P>
  364. <LI>
  365. lpBuffer a pointer to the buffer where the result will be placed
  366. <P></P>
  367. <LI>
  368. dwBufSize the size in bytes of the space where lpBuffer points
  369. <P></P>
  370. <LI>
  371. lpFormat a pointer to the parameter specifier; can be NULL. See <A HREF="#format string">Format String</A>
  372. <P></P>
  373. <LI>
  374. ... parameters to be interpreted based on lpFormat
  375. <P></P>
  376. <DT><STRONG>RETURNS:</STRONG><BR>
  377. <DD>
  378. <LI>
  379. A zero if no error; otherwise error code. See <A HREF="#error codes">Error Codes</A>
  380. <P></P></DL>
  381. <P>
  382. <H2><A NAME="perlezsetmagicscalarfunctions">PerlEzSetMagicScalarFunctions</A></H2>
  383. <PRE>
  384.  int PerlEzSetMagicScalarFunctions(PERLEZHANDLE hHandle, LPFETCHVALUEFUNCTION lpfFetch,
  385.                 LPSTOREVALUEFUNCTION lpfStore);</PRE>
  386. <DL>
  387. <DT><STRONG>DESCRIPTION:</STRONG><BR>
  388. <DD>
  389. <LI>
  390. Sets the call back function pointers for magic scalar variables.
  391. <P></P>
  392. <DT><STRONG>PARAMS:</STRONG><BR>
  393. <DD>
  394. <LI>
  395. hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
  396. <P></P>
  397. <LI>
  398. lpfFetch a pointer to the call back function for fetching a string. 
  399. if lpfFetch is NULL, then the scalar is write only.
  400. <P></P>
  401. <LI>
  402. lpfStore a pointer to the call back function for storinging a string.
  403. if lpfStore is NULL, then the scalar is read only.
  404. <P></P>
  405. <DT><STRONG>RETURNS:</STRONG><BR>
  406. <DD>
  407. <LI>
  408. A zero if no error; otherwise error code. See <A HREF="#error codes">Error Codes</A>
  409. NOTE: if lpfFetch and lpfStore are both NULL, then it is an error.
  410. <P>See also <A HREF="#perlezsetmagicscalarname">PerlEzSetMagicScalarName</A></P>
  411. <P></P></DL>
  412. <P>
  413. <H2><A NAME="perlezsetmagicscalarname">PerlEzSetMagicScalarName</A></H2>
  414. <PRE>
  415.  int PerlEzSetMagicScalarName(PERLEZHANDLE hHandle, LPCSTR pVariableName);</PRE>
  416. <DL>
  417. <DT><STRONG>DESCRIPTION:</STRONG><BR>
  418. <DD>
  419. <LI>
  420. Creates the variable if it does not exists and sets it to be tied to
  421. the call back function pointer for magic variables.
  422. <P></P>
  423. <DT><STRONG>PARAMS:</STRONG><BR>
  424. <DD>
  425. <LI>
  426. hHandle a handle returned by the call to PerlEzCreate or PerlEzCreateOpt
  427. <P></P>
  428. <LI>
  429. pVariableName a pointer to the name of the variable.
  430. <P></P>
  431. <DT><STRONG>RETURNS:</STRONG><BR>
  432. <DD>
  433. <LI>
  434. A zero if no error; otherwise error code. See <A HREF="#error codes">Error Codes</A>
  435. <P>See also <A HREF="#perlezsetmagicscalarfunctions">PerlEzSetMagicScalarFunctions</A></P>
  436. <P></P></DL>
  437. <P>
  438. <H2><A NAME="format string">Format String</A></H2>
  439. <P>The format string is a series of characters that represents the type of parameters being supplied.</P>
  440. <DL>
  441. <DT><STRONG><A NAME="item_s">s</A></STRONG><BR>
  442. <DD>
  443. <LI>
  444. this parameter is a pointer to a null terminated string.
  445. <P></P>
  446. <DT><STRONG><A NAME="item_i">i</A></STRONG><BR>
  447. <DD>
  448. <LI>
  449. this parameter is to be considered an integer.
  450. <P></P>
  451. <DT><STRONG><A NAME="item_d">d</A></STRONG><BR>
  452. <DD>
  453. <LI>
  454. this parameter is to be considered a double.
  455. <P></P>
  456. <DT><STRONG><A NAME="item_l%5Bs_%7C_i_%7C_d%5Dx">l[s | i | d]x</A></STRONG><BR>
  457. <DD>
  458. <LI>
  459. the next 'x' parameters will be put into an anonymous list of the type specifed. Either 's', 'i', or 'd'
  460. <P></P></DL>
  461. <P>
  462. <H2><A NAME="error codes">Error Codes</A></H2>
  463. <OL>
  464. <LI>
  465. More space is needed to return a result
  466. <P></P>
  467. <LI>
  468. Error string returned in the buffer
  469. <P></P>
  470. <LI>
  471. More space needed to return the error message
  472. <P></P>
  473. <LI>
  474. Format string is invalid
  475. <P></P>
  476. <LI>
  477. Function call caused an exception
  478. <P></P>
  479. <LI>
  480. Handle is invalid
  481. <P></P>
  482. <LI>
  483. The second call to PerlEzSetMagicFunction failed
  484. <P></P>
  485. <LI>
  486. Invalid parameter was passed to the routine
  487. <P></P>
  488. <LI>
  489. Cannot allocate more memory
  490. <P></P></OL>
  491. <P>
  492. <H2><A NAME="authors">Authors</A></H2>
  493. <P>This document is maintained by Douglas Lankshear <<A HREF="mailto:dougl@ActiveState.com">dougl@ActiveState.com</A>></P>
  494.  
  495. </BODY>
  496.  
  497. </HTML>
  498.