1 /***********************************************************
2 Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
7 Permission to use, copy, modify, and distribute this software and its
8 documentation for any purpose and without fee is hereby granted,
9 provided that the above copyright notice appear in all copies and that
10 both that copyright notice and this permission notice appear in
11 supporting documentation, and that the names of Stichting Mathematisch
12 Centrum or CWI or Corporation for National Research Initiatives or
13 CNRI not be used in advertising or publicity pertaining to
14 distribution of the software without specific, written prior
17 While CWI is the initial source for this software, a modified version
18 is made available by the Corporation for National Research Initiatives
19 (CNRI) at the Internet address ftp://ftp.python.org.
21 STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
22 REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
23 MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
24 CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
25 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
26 PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
27 TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
28 PERFORMANCE OF THIS SOFTWARE.
30 ******************************************************************/
34 #error Please port this code to your architecture first...
38 ** Define to include testroutines (at the end)
45 #include <CodeFragments.h>
47 /* Prototypes for routines not in any include file (shame, shame) */
48 extern PyObject
*ResObj_New
Py_PROTO((Handle
));
49 extern int ResObj_Convert
Py_PROTO((PyObject
*, Handle
*));
51 static PyObject
*ErrorObject
;
55 #define PARANOID(arg) \
56 if ( arg == 0 ) {PyErr_SetString(ErrorObject, "Internal error: NULL arg!"); return 0; }
58 #define PARANOID(arg) /*pass*/
61 /* Prototypes we use for routines and arguments */
63 typedef long anything
;
64 typedef anything (*anyroutine
) Py_PROTO((...));
67 #define MAXNAME 31 /* Maximum size of names, for printing only */
68 #define MAXARG 8 /* Maximum number of arguments */
71 ** Routines to convert arguments between Python and C.
72 ** Note return-value converters return NULL if this argument (or return value)
73 ** doesn't return anything. The call-wrapper code collects all return values,
74 ** and does the expected thing based on the number of return values: return None, a single
75 ** value or a tuple of values.
77 ** Hence, optional return values are also implementable.
79 typedef anything (*py2c_converter
) Py_PROTO((PyObject
*));
80 typedef PyObject
*(*c2py_converter
) Py_PROTO((anything
));
81 typedef PyObject
*(*rv2py_converter
) Py_PROTO((anything
));
84 /* Dummy routine for arguments that are output-only */
92 /* Routine to allocate storage for output integers */
99 if( (ptr
=malloc(sizeof(anything
))) == 0 )
101 return (anything
)ptr
;
104 /* Dummy routine for arguments that are input-only */
112 /* Dummy routine for void return value */
120 /* Routine to de-allocate storage for input-only arguments */
131 ** OSErr return value.
137 OSErr err
= (OSErr
)arg
;
140 return PyMac_Error(err
);
145 ** Input integers of all sizes (PPC only)
151 return PyInt_AsLong(arg
);
155 ** Integer return values of all sizes (PPC only)
161 return PyInt_FromLong((long)arg
);
165 ** Integer output parameters
174 rv
= PyInt_FromLong(*(long *)arg
);
186 rv
= PyInt_FromLong((long)*(short *)arg
);
198 rv
= PyInt_FromLong((long)*(char *)arg
);
210 return (anything
)PyString_AsString(arg
);
214 ** Pascal-style strings
223 if( (size
= PyString_Size(arg
)) < 0)
226 PyErr_SetString(ErrorObject
, "Pstring must be <= 255 chars");
229 if( (p
=(unsigned char *)malloc(256)) == 0 ) {
234 memcpy(p
+1, PyString_AsString(arg
), size
);
239 py2c_out_pstring(arg
)
244 if( (p
=(unsigned char *)malloc(256)) == 0 ) {
253 c2py_out_pstring(arg
)
256 unsigned char *p
= (unsigned char *)arg
;
260 rv
= PyString_FromStringAndSize((char *)p
+1, p
[0]);
269 unsigned char *p
= (unsigned char *)arg
;
272 if ( arg
== NULL
) return NULL
;
273 rv
= PyString_FromStringAndSize((char *)p
+1, p
[0]);
284 if ( arg
== Py_None
)
286 return (anything
)PyCObject_AsVoidPtr(arg
);
290 c2py_out_cobject(arg
)
293 void **ptr
= (void **)arg
;
301 rv
= PyCObject_FromVoidPtr(*ptr
, 0);
311 void *ptr
= (void *)arg
;
314 if ( ptr
== 0 ) return NULL
;
315 rv
= PyCObject_FromVoidPtr(ptr
, 0);
327 ResObj_Convert(arg
, &h
);
335 Handle
*rv
= (Handle
*)arg
;
343 prv
= ResObj_New(*rv
);
353 Handle rv
= (Handle
)arg
;
355 if ( rv
== NULL
) return NULL
;
356 return ResObj_New(rv
);
360 char *name
; /* Name */
361 py2c_converter get
; /* Get argument */
362 int get_uses_arg
; /* True if the above consumes an argument */
363 c2py_converter put
; /* Put result value */
366 static conventry converters
[] = {
367 {"InByte", py2c_in_int
, 1, c2py_dummy
},
368 {"InShort", py2c_in_int
, 1, c2py_dummy
},
369 {"InLong", py2c_in_int
, 1, c2py_dummy
},
370 {"OutLong", py2c_alloc
, 0, c2py_out_long
},
371 {"OutShort", py2c_alloc
, 0, c2py_out_short
},
372 {"OutByte", py2c_alloc
, 0, c2py_out_byte
},
373 {"InString", py2c_in_string
, 1, c2py_dummy
},
374 {"InPstring", py2c_in_pstring
,1, c2py_free
},
375 {"OutPstring", py2c_out_pstring
,0, c2py_out_pstring
},
376 {"InCobject", py2c_in_cobject
,1, c2py_dummy
},
377 {"OutCobject", py2c_alloc
, 0, c2py_out_cobject
},
378 {"InHandle", py2c_in_handle
, 1, c2py_dummy
},
379 {"OutHandle", py2c_alloc
, 0, c2py_out_handle
},
388 static rvconventry rvconverters
[] = {
389 {"None", rv2py_none
},
390 {"OSErr", rv2py_oserr
},
392 {"Short", rv2py_int
},
394 {"Pstring", rv2py_pstring
},
395 {"Cobject", rv2py_cobject
},
396 {"Handle", rv2py_handle
},
407 for(i
=0; converters
[i
].name
; i
++ )
408 if ( strcmp(name
, converters
[i
].name
) == 0 )
409 return &converters
[i
];
410 sprintf(buf
, "Unknown argtype: %s", name
);
411 PyErr_SetString(ErrorObject
, buf
);
422 for(i
=0; rvconverters
[i
].name
; i
++ )
423 if ( strcmp(name
, rvconverters
[i
].name
) == 0 )
424 return &rvconverters
[i
];
425 sprintf(buf
, "Unknown return value type: %s", name
);
426 PyErr_SetString(ErrorObject
, buf
);
431 argparse_conv(obj
, ptr
)
439 if( (name
=PyString_AsString(obj
)) == NULL
)
441 if( (item
=getconverter(name
)) == NULL
)
448 argparse_rvconv(obj
, ptr
)
456 if( (name
=PyString_AsString(obj
)) == NULL
)
458 if( (item
=getrvconverter(name
)) == NULL
)
464 /* ----------------------------------------------------- */
466 /* Declarations for objects of type fragment */
470 CFragConnectionID conn_id
;
471 char name
[MAXNAME
+1];
474 staticforward PyTypeObject Cdftype
;
478 /* ---------------------------------------------------------------- */
480 /* Declarations for objects of type routine */
485 char name
[MAXNAME
+1];
488 staticforward PyTypeObject Cdrtype
;
492 /* ---------------------------------------------------------------- */
494 /* Declarations for objects of type callable */
499 cdrobject
*routine
; /* The routine to call */
500 int npargs
; /* Python argument count */
501 int ncargs
; /* C argument count + 1 */
502 rvconventry
*rvconv
; /* Return value converter */
503 conventry
*argconv
[MAXARG
]; /* Value converter list */
506 staticforward PyTypeObject Cdctype
;
510 /* -------------------------------------------------------- */
513 static struct PyMethodDef cdr_methods
[] = {
515 {NULL
, NULL
} /* sentinel */
522 newcdrobject(name
, routine
)
529 self
= PyObject_NEW(cdrobject
, &Cdrtype
);
532 if ( name
[0] > MAXNAME
)
536 memcpy(self
->name
, name
+1, nlen
);
537 self
->name
[nlen
] = '\0';
556 sprintf(buf
, "<Calldll routine %s address 0x%x>", self
->name
, self
->rtn
);
557 s
= PyString_FromString(buf
);
561 static char Cdrtype__doc__
[] =
565 static PyTypeObject Cdrtype
= {
566 PyObject_HEAD_INIT(&PyType_Type
)
568 "routine", /*tp_name*/
569 sizeof(cdrobject
), /*tp_basicsize*/
572 (destructor
)cdr_dealloc
, /*tp_dealloc*/
573 (printfunc
)0, /*tp_print*/
574 (getattrfunc
)0, /*tp_getattr*/
575 (setattrfunc
)0, /*tp_setattr*/
576 (cmpfunc
)0, /*tp_compare*/
577 (reprfunc
)cdr_repr
, /*tp_repr*/
579 0, /*tp_as_sequence*/
581 (hashfunc
)0, /*tp_hash*/
582 (ternaryfunc
)0, /*tp_call*/
583 (reprfunc
)0, /*tp_str*/
585 /* Space for future expansion */
587 Cdrtype__doc__
/* Documentation string */
590 /* End of code for routine objects */
591 /* -------------------------------------------------------- */
594 static struct PyMethodDef cdc_methods
[] = {
596 {NULL
, NULL
} /* sentinel */
603 newcdcobject(routine
, npargs
, ncargs
, rvconv
, argconv
)
608 conventry
*argconv
[];
613 self
= PyObject_NEW(cdcobject
, &Cdctype
);
616 self
->routine
= routine
;
618 self
->npargs
= npargs
;
619 self
->ncargs
= ncargs
;
620 self
->rvconv
= rvconv
;
621 for(i
=0; i
<MAXARG
; i
++)
623 self
->argconv
[i
] = argconv
[i
];
625 self
->argconv
[i
] = 0;
633 Py_XDECREF(self
->routine
);
646 sprintf(buf
, "<callable %s = %s(", self
->rvconv
->name
, self
->routine
->name
);
647 for(i
=0; i
< self
->ncargs
; i
++) {
648 strcat(buf
, self
->argconv
[i
]->name
);
649 if ( i
< self
->ncargs
-1 )
654 s
= PyString_FromString(buf
);
659 ** And this is what we all do it for: call a C function.
662 cdc_call(self
, args
, kwargs
)
669 anything c_args
[MAXARG
] = {0, 0, 0, 0, 0, 0, 0, 0};
674 PyObject
*returnvalues
[MAXARG
+1];
678 PyErr_SetString(PyExc_TypeError
, "Keyword args not allowed");
681 if( !PyTuple_Check(args
) ) {
682 PyErr_SetString(PyExc_TypeError
, "Arguments not in tuple");
685 if( PyTuple_Size(args
) != self
->npargs
) {
686 sprintf(buf
, "%d arguments, expected %d", PyTuple_Size(args
), self
->npargs
);
687 PyErr_SetString(PyExc_TypeError
, buf
);
691 /* Decode arguments */
693 for(i
=0; i
<self
->ncargs
; i
++) {
694 cp
= self
->argconv
[i
];
695 if ( cp
->get_uses_arg
) {
696 curarg
= PyTuple_GET_ITEM(args
, pargindex
);
699 curarg
= (PyObject
*)NULL
;
701 c_args
[i
] = (*cp
->get
)(curarg
);
703 if (PyErr_Occurred())
707 func
= self
->routine
->rtn
;
708 c_rv
= (*func
)(c_args
[0], c_args
[1], c_args
[2], c_args
[3],
709 c_args
[4], c_args
[5], c_args
[6], c_args
[7]);
711 /* Decode return value, and store into returnvalues if needed */
713 curarg
= (*self
->rvconv
->rtn
)(c_rv
);
715 returnvalues
[pargindex
++] = curarg
;
717 /* Decode returnvalue parameters and cleanup any storage allocated */
718 for(i
=0; i
<self
->ncargs
; i
++) {
719 cp
= self
->argconv
[i
];
720 curarg
= (*cp
->put
)(c_args
[i
]);
722 returnvalues
[pargindex
++] = curarg
;
723 /* NOTE: We only check errors at the end (so we free() everything) */
725 if ( PyErr_Occurred() ) {
726 /* An error did occur. Free the python objects created */
727 for(i
=0; i
<pargindex
; i
++)
728 Py_XDECREF(returnvalues
[i
]);
732 /* Zero and one return values cases are special: */
733 if ( pargindex
== 0 ) {
737 if ( pargindex
== 1 )
738 return returnvalues
[0];
740 /* More than one return value: put in a tuple */
741 rv
= PyTuple_New(pargindex
);
742 for(i
=0; i
<pargindex
; i
++)
744 PyTuple_SET_ITEM(rv
, i
, returnvalues
[i
]);
746 Py_XDECREF(returnvalues
[i
]);
750 static char Cdctype__doc__
[] =
754 static PyTypeObject Cdctype
= {
755 PyObject_HEAD_INIT(&PyType_Type
)
757 "callable", /*tp_name*/
758 sizeof(cdcobject
), /*tp_basicsize*/
761 (destructor
)cdc_dealloc
, /*tp_dealloc*/
762 (printfunc
)0, /*tp_print*/
763 (getattrfunc
)0, /*tp_getattr*/
764 (setattrfunc
)0, /*tp_setattr*/
765 (cmpfunc
)0, /*tp_compare*/
766 (reprfunc
)cdc_repr
, /*tp_repr*/
768 0, /*tp_as_sequence*/
770 (hashfunc
)0, /*tp_hash*/
771 (ternaryfunc
)cdc_call
, /*tp_call*/
772 (reprfunc
)0, /*tp_str*/
774 /* Space for future expansion */
776 Cdctype__doc__
/* Documentation string */
779 /* End of code for callable objects */
780 /* ---------------------------------------------------------------- */
782 static char cdf_keys__doc__
[] =
783 "Return list of symbol names in fragment";
794 CFragSymbolClass dummy2
;
798 if (!PyArg_ParseTuple(args
, ""))
800 if ( (err
=CountSymbols(self
->conn_id
, &symcount
)) < 0 )
801 return PyMac_Error(err
);
802 if ( (rv
=PyList_New(symcount
)) == NULL
)
804 for (i
=0; i
<symcount
; i
++) {
805 if ((err
=GetIndSymbol(self
->conn_id
, i
, symname
, &dummy1
, &dummy2
)) < 0 ) {
807 return PyMac_Error(err
);
809 if ((obj
=PyString_FromStringAndSize((char *)symname
+1, symname
[0])) == NULL
) {
811 return PyMac_Error(err
);
813 if (PyList_SetItem(rv
, i
, obj
) < 0 ) {
822 static struct PyMethodDef cdf_methods
[] = {
823 {"keys", (PyCFunction
)cdf_keys
, METH_VARARGS
,
826 {NULL
, NULL
} /* sentinel */
833 newcdfobject(conn_id
, name
)
834 CFragConnectionID conn_id
;
840 self
= PyObject_NEW(cdfobject
, &Cdftype
);
843 self
->conn_id
= conn_id
;
844 if ( name
[0] > MAXNAME
)
848 strncpy(self
->name
, (char *)name
+1, nlen
);
849 self
->name
[nlen
] = '\0';
867 sprintf(buf
, "<fragment %s connection, id 0x%x>", self
->name
, self
->conn_id
);
868 s
= PyString_FromString(buf
);
873 cdf_getattr_helper(self
, name
)
877 unsigned char *rtn_name
;
881 CFragSymbolClass
class;
884 rtn_name
= Pstring(name
);
885 err
= FindSymbol(self
->conn_id
, rtn_name
, (Ptr
*)&rtn
, &class);
887 sprintf(buf
, "%.*s: %s", rtn_name
[0], rtn_name
+1, PyMac_StrError(err
));
888 PyErr_SetString(ErrorObject
, buf
);
891 if( class != kTVectorCFragSymbol
) {
892 PyErr_SetString(ErrorObject
, "Symbol is not a routine");
896 return (PyObject
*)newcdrobject(rtn_name
, rtn
);
900 cdf_getattr(self
, name
)
906 if ((rv
=Py_FindMethod(cdf_methods
, (PyObject
*)self
, name
)))
909 return cdf_getattr_helper(self
, name
);
912 /* -------------------------------------------------------- */
913 /* Code to access cdf objects as mappings */
922 err
= CountSymbols(self
->conn_id
, &symcount
);
931 cdf_subscript(self
, key
)
937 if ((name
=PyString_AsString(key
)) == 0 )
939 return cdf_getattr_helper(self
, name
);
943 cdf_ass_sub(self
, v
, w
)
947 /* XXXX Put w in self under key v */
951 static PyMappingMethods cdf_as_mapping
= {
952 (inquiry
)cdf_length
, /*mp_length*/
953 (binaryfunc
)cdf_subscript
, /*mp_subscript*/
954 (objobjargproc
)cdf_ass_sub
, /*mp_ass_subscript*/
957 /* -------------------------------------------------------- */
959 static char Cdftype__doc__
[] =
960 "Code Fragment library symbol table"
963 static PyTypeObject Cdftype
= {
964 PyObject_HEAD_INIT(&PyType_Type
)
966 "fragment", /*tp_name*/
967 sizeof(cdfobject
), /*tp_basicsize*/
970 (destructor
)cdf_dealloc
, /*tp_dealloc*/
971 (printfunc
)0, /*tp_print*/
972 (getattrfunc
)cdf_getattr
, /*tp_getattr*/
973 (setattrfunc
)0, /*tp_setattr*/
974 (cmpfunc
)0, /*tp_compare*/
975 (reprfunc
)cdf_repr
, /*tp_repr*/
977 0, /*tp_as_sequence*/
978 &cdf_as_mapping
, /*tp_as_mapping*/
979 (hashfunc
)0, /*tp_hash*/
980 (ternaryfunc
)0, /*tp_call*/
981 (reprfunc
)0, /*tp_str*/
983 /* Space for future expansion */
985 Cdftype__doc__
/* Documentation string */
988 /* End of code for fragment objects */
989 /* -------------------------------------------------------- */
992 static char cdll_getlibrary__doc__
[] =
993 "Load a shared library fragment and return the symbol table"
997 cdll_getlibrary(self
, args
)
998 PyObject
*self
; /* Not used */
1005 CFragConnectionID conn_id
;
1008 if (!PyArg_ParseTuple(args
, "O&", PyMac_GetStr255
, frag_name
))
1011 /* Find the library connection ID */
1012 err
= GetSharedLibrary(frag_name
, kCompiledCFragArch
, kLoadCFrag
, &conn_id
, &main_addr
,
1015 sprintf(buf
, "%.*s: %s", errMessage
[0], errMessage
+1, PyMac_StrError(err
));
1016 PyErr_SetString(ErrorObject
, buf
);
1019 return (PyObject
*)newcdfobject(conn_id
, frag_name
);
1022 static char cdll_getdiskfragment__doc__
[] =
1023 "Load a fragment from a disk file and return the symbol table"
1027 cdll_getdiskfragment(self
, args
)
1028 PyObject
*self
; /* Not used */
1036 CFragConnectionID conn_id
;
1038 Boolean isfolder
, didsomething
;
1040 if (!PyArg_ParseTuple(args
, "O&O&", PyMac_GetFSSpec
, &fsspec
,
1041 PyMac_GetStr255
, frag_name
))
1043 err
= ResolveAliasFile(&fsspec
, 1, &isfolder
, &didsomething
);
1045 return PyErr_Mac(ErrorObject
, err
);
1047 /* Load the fragment (or return the connID if it is already loaded */
1048 err
= GetDiskFragment(&fsspec
, 0, 0, frag_name
,
1049 kLoadCFrag
, &conn_id
, &main_addr
,
1052 sprintf(buf
, "%.*s: %s", errMessage
[0], errMessage
+1, PyMac_StrError(err
));
1053 PyErr_SetString(ErrorObject
, buf
);
1056 return (PyObject
*)newcdfobject(conn_id
, frag_name
);
1059 static char cdll_newcall__doc__
[] =
1064 cdll_newcall(self
, args
)
1065 PyObject
*self
; /* Not used */
1069 conventry
*argconv
[MAXARG
] = {0, 0, 0, 0, 0, 0, 0, 0};
1070 rv2py_converter rvconv
;
1073 /* Note: the next format depends on MAXARG */
1074 if (!PyArg_ParseTuple(args
, "O!O&|O&O&O&O&O&O&O&O&", &Cdrtype
, &routine
,
1075 argparse_rvconv
, &rvconv
,
1076 argparse_conv
, &argconv
[0], argparse_conv
, &argconv
[1],
1077 argparse_conv
, &argconv
[2], argparse_conv
, &argconv
[3],
1078 argparse_conv
, &argconv
[4], argparse_conv
, &argconv
[5],
1079 argparse_conv
, &argconv
[6], argparse_conv
, &argconv
[7]))
1082 for(ncargs
=0; ncargs
< MAXARG
&& argconv
[ncargs
]; ncargs
++) {
1083 if( argconv
[ncargs
]->get_uses_arg
) npargs
++;
1085 return (PyObject
*)newcdcobject(routine
, npargs
, ncargs
, rvconv
, argconv
);
1088 /* List of methods defined in the module */
1090 static struct PyMethodDef cdll_methods
[] = {
1091 {"getlibrary", (PyCFunction
)cdll_getlibrary
, METH_VARARGS
,
1092 cdll_getlibrary__doc__
},
1093 {"getdiskfragment", (PyCFunction
)cdll_getdiskfragment
, METH_VARARGS
,
1094 cdll_getdiskfragment__doc__
},
1095 {"newcall", (PyCFunction
)cdll_newcall
, METH_VARARGS
,
1096 cdll_newcall__doc__
},
1098 {NULL
, (PyCFunction
)NULL
, 0, NULL
} /* sentinel */
1102 /* Initialization function for the module (*must* be called initcalldll) */
1104 static char calldll_module_documentation
[] =
1113 /* Create the module and add the functions */
1114 m
= Py_InitModule4("calldll", cdll_methods
,
1115 calldll_module_documentation
,
1116 (PyObject
*)NULL
,PYTHON_API_VERSION
);
1118 /* Add some symbolic constants to the module */
1119 d
= PyModule_GetDict(m
);
1120 ErrorObject
= PyString_FromString("calldll.error");
1121 PyDict_SetItemString(d
, "error", ErrorObject
);
1123 /* XXXX Add constants here */
1125 /* Check for errors */
1126 if (PyErr_Occurred())
1127 Py_FatalError("can't initialize module calldll");
1133 int cdll_b_bbbbbbbb(char a1
,char a2
,char a3
,char a4
,char a5
,char a6
,char a7
,char a8
)
1135 return a1
+a2
+a3
+a4
+a5
+a6
+a7
+a8
;
1138 short cdll_h_hhhhhhhh(short a1
,short a2
,short a3
,short a4
,short a5
,short a6
,short a7
,short a8
)
1140 return a1
+a2
+a3
+a4
+a5
+a6
+a7
+a8
;
1143 int cdll_l_llllllll(int a1
,int a2
,int a3
,int a4
,int a5
,int a6
,int a7
,int a8
)
1145 return a1
+a2
+a3
+a4
+a5
+a6
+a7
+a8
;
1148 void cdll_N_ssssssss(char *a1
,char *a2
,char *a3
,char *a4
,char *a5
,char *a6
,char *a7
,char *a8
)
1150 printf("cdll_N_ssssssss args: %s %s %s %s %s %s %s %s\n", a1
, a2
, a3
, a4
,
1154 OSErr
cdll_o_l(long l
)
1159 void cdll_N_pp(unsigned char *in
, unsigned char *out
)
1162 strcpy((char *)out
+1, "Was: ");
1163 memcpy(out
+6, in
+1, in
[0]);
1166 void cdll_N_bb(char a1
, char *a2
)
1171 void cdll_N_hh(short a1
, short *a2
)
1176 void cdll_N_ll(long a1
, long *a2
)
1181 void cdll_N_sH(char *a1
, Handle a2
)
1186 SetHandleSize(a2
, len
);
1188 memcpy(*a2
, a1
, len
);