Clearer commentary.
[ZOOM-Perl-moved-to-github.git] / typemap
1 # $Id: typemap,v 1.4 2005-10-13 16:01:48 mike Exp $
2
3 ZOOM_connection                                 T_PTROBJ
4 ZOOM_connection *                               T_PTROBJ
5 ZOOM_options                                    T_PTROBJ
6 ZOOM_options_callback                           T_PTROBJ
7 ZOOM_package                                    T_PTROBJ
8 ZOOM_query                                      T_PTROBJ
9 ZOOM_record                                     T_PTROBJ
10 ZOOM_record *                                   T_PTROBJ
11 ZOOM_resultset                                  T_PTROBJ
12 ZOOM_scanset                                    T_PTROBJ
13 __compar_fn_t                                   T_PTROBJ
14 __const char *                                  T_PTROBJ
15 __const void *                                  T_PTROBJ
16 __const wchar_t *                               T_PTROBJ
17 __extension__ extern lldiv_t                    T_PTROBJ
18 __extension__ extern long long int              T_PTROBJ
19 __extension__ extern unsigned long long int     T_PTROBJ
20 __locale_t                                      T_PTROBJ
21 char * __const *                                T_PTROBJ
22 const __sigset_t *                              T_PTROBJ
23 # The next line was originally autogenerated by h2xs, which gave the
24 # type of "const char *" as T_PTROBJ -- a pointer to an opaque object.
25 # This prevented the return value of ZOOM_record_get() from being
26 # translated into a Perl string.  Instead, I am using T_PV, which
27 # works properly.  This also has the pleasant side-effect that I no
28 # longer have to discard the "const" qualfiers from the arguments to
29 # the functions in the .xs file.
30 const char *                                    T_PV
31 const char **                                   T_PTROBJ
32 const struct timespec *                         T_PTROBJ
33 div_t                                           T_OPAQUE_STRUCT
34 double *                                        T_PTROBJ
35 fd_set *                                        T_PTROBJ
36 int *                                           T_PTROBJ
37 int32_t *                                       T_PTROBJ
38 ldiv_t                                          T_OPAQUE_STRUCT
39 long double                                     T_NV
40 long int                                        T_PTROBJ
41 long int *                                      T_PTROBJ
42 long long int                                   T_PTROBJ
43 struct drand48_data *                           T_PTROBJ
44 struct random_data *                            T_PTROBJ
45 struct timeval *                                T_PTROBJ
46 unsigned int *                                  T_PTROBJ
47 unsigned long int                               T_PTROBJ
48 unsigned short int                              T_PTROBJ
49 unsigned short int *                            T_PTROBJ
50 void ( * __func ) ( int __status, void * __arg )        T_PTROBJ
51 void ( * __func ) ( void )                      T_PTROBJ
52 void **                                         T_PTROBJ
53 #############################################################################
54 INPUT
55 T_OPAQUE_STRUCT
56         if (sv_derived_from($arg, \"${ntype}\")) {
57             STRLEN len;
58             char  *s = SvPV((SV*)SvRV($arg), len);
59
60             if (len != sizeof($var))
61                 croak(\"Size %d of packed data != expected %d\",
62                         len, sizeof($var));
63             $var = *($type *)s;
64         }
65         else
66             croak(\"$var is not of type ${ntype}\")
67 #############################################################################
68 OUTPUT
69 T_OPAQUE_STRUCT
70         sv_setref_pvn($arg, \"${ntype}\", (char *)&$var, sizeof($var));