00001 /* 00002 * perlArgs.h 00003 * 00004 * Copyright (c) 2002, International Business Machines 00005 * 00006 * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE 00007 * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE 00008 * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. 00009 * 00010 * You can obtain a current copy of the Common Public License from 00011 * http://oss.software.ibm.com/developerworks/opensource/license-cpl.html 00012 * 00013 * Author: Markus Mueller <markus_mueller@de.ibm.com> 00014 * Contributors: 00015 * 00016 * Description: <Some descriptive text> 00017 */ 00018 00019 #include <stdio.h> 00020 #include <stdlib.h> 00021 00022 /* used in perlProvider.h and perlNPI/perlNPI.xs */ 00023 typedef struct { 00024 char * scriptName; 00025 void * my_perl; 00026 } PerlContext; 00027 00028 static inline char * argsforperl(void * arg) 00029 { 00030 //char my_arg[sizeof(void *)/4 + 3]; 00031 char * my_arg; 00032 my_arg = malloc(sizeof(void *)/4 + 3); 00033 //my_arg = (char *)malloc(32/4 + 3); 00034 //my_arg = (char *)alloca(32/4 + 3); 00035 sprintf(my_arg,"%8p",arg); 00036 //return savepv(my_arg); 00037 return my_arg; 00038 } 00039 00040 00041 static inline void * argsfromperl(char * arg) 00042 { 00043 void * my_arg; 00044 sscanf(arg,"%p",&my_arg); 00045 return my_arg; 00046 }