Mercurial > pub > dyncall > dyncall
comparison doc/manual/manual_bindings.tex @ 490:17287342e273
manual:
- removed all API description and referred to manual instead, to avoid outdated and/or duplicated doc
- cleanups and clarificaions
author | Tassilo Philipp |
---|---|
date | Sun, 20 Mar 2022 14:26:55 +0100 |
parents | b47168dacba6 |
children | 48eede2fa034 |
comparison
equal
deleted
inserted
replaced
489:63f623bff0b9 | 490:17287342e273 |
---|---|
103 \sigchar{L} & unsigned long long, uint64\_t \\ | 103 \sigchar{L} & unsigned long long, uint64\_t \\ |
104 \sigchar{f} & float \\ | 104 \sigchar{f} & float \\ |
105 \sigchar{d} & double \\ | 105 \sigchar{d} & double \\ |
106 \sigchar{p} & void* \\ | 106 \sigchar{p} & void* \\ |
107 \sigchar{Z} & const char* (pointing to C string) \\ | 107 \sigchar{Z} & const char* (pointing to C string) \\ |
108 \sigchar{A} & aggregate (struct, union) by-value \\ | |
108 \end{tabular*} | 109 \end{tabular*} |
109 \caption{Type signature encoding for function call data types} | 110 \caption{Type signature encoding for function call data types} |
110 \label{sigchar} | 111 \label{sigchar} |
111 \end{center} | 112 \end{center} |
112 \end{table} | 113 \end{table} |
130 \begin{center} | 131 \begin{center} |
131 \begin{tabular*}{0.75\textwidth}{cl} | 132 \begin{tabular*}{0.75\textwidth}{cl} |
132 Signature character & Calling Convention \\ | 133 Signature character & Calling Convention \\ |
133 \hline | 134 \hline |
134 \sigchar{:} & platform's default calling convention \\ | 135 \sigchar{:} & platform's default calling convention \\ |
136 \sigchar{*} & platform's default C++/thiscall calling convention \\ | |
135 \sigchar{e} & vararg function \\ | 137 \sigchar{e} & vararg function \\ |
136 \sigchar{.} & vararg function's variadic/ellipsis part (...), to be specified before first vararg \\ | 138 \sigchar{.} & vararg function's variadic/ellipsis part (...), to be specified before first vararg \\ |
137 \sigchar{c} & only on x86: cdecl \\ | 139 \sigchar{c} & only on x86: cdecl \\ |
138 \sigchar{s} & only on x86: stdcall \\ | 140 \sigchar{s} & only on x86: stdcall \\ |
139 \sigchar{F} & only on x86: fastcall (MS) \\ | 141 \sigchar{F} & only on x86: fastcall (MS) \\ |
152 \pagebreak | 154 \pagebreak |
153 | 155 |
154 \paragraph{Examples of C function prototypes} | 156 \paragraph{Examples of C function prototypes} |
155 | 157 |
156 \begin{table}[h] | 158 \begin{table}[h] |
157 \begin{center} | |
158 \begin{tabular*}{0.75\textwidth}{rll} | 159 \begin{tabular*}{0.75\textwidth}{rll} |
159 & C function prototype & dyncall signature \\ | 160 & C function prototype & dyncall signature \\ |
160 \hline | 161 \hline |
161 void & f1(); & \sigstr{)v}\\ | 162 void & f1(); & \sigstr{)v}\\ |
162 int & f2(int, int); & \sigstr{ii)i}\\ | 163 int & f2(int, int); & \sigstr{ii)i}\\ |
163 long long & f3(void*); & \sigstr{p)L}\\ | 164 long long & f3(void*); & \sigstr{p)L}\\ |
164 void & f3(int**); & \sigstr{p)v}\\ | 165 void & f3(int**); & \sigstr{p)v}\\ |
165 double & f4(int, bool, char, double, const char*); & \sigstr{iBcdZ)d}\\ | 166 double & f4(int, bool, char, double, const char*); & \sigstr{iBcdZ)d}\\ |
166 void & f5(short a, long long b, ...) & \sigstr{\_esl\_.di)v} (for (promoted) varargs: double, int)\\ | 167 void & f5(short, long long, ...); & \sigstr{\_esl\_.di)v} (for (promoted) varargs: double, int)\\ |
167 \end{tabular*} | 168 struct A & f6(int, union B); & \sigstr{iA)A}\\ |
168 \caption{Type signature examples of C function prototypes} | 169 short & Cls::f(unsigned char, ...); & \sigstr{\_*p\_eC\_.i)A} (C++: this-ptr as 1st arg, int as vararg)\\ |
170 \end{tabular*} | |
171 \caption{Type signature examples of function prototypes} | |
169 \label{sigex} | 172 \label{sigex} |
170 \end{center} | |
171 \end{table} | 173 \end{table} |
172 | 174 |
173 | 175 |
174 | 176 |
175 \subsection{Erlang language bindings} | 177 \subsection{Erlang language bindings} |
235 | 237 |
236 The python module {\tt pydc} implements the Python language bindings, | 238 The python module {\tt pydc} implements the Python language bindings, |
237 namely {\tt load}, {\tt find}, {\tt free}, {\tt call}, {\tt new\_callback}, {\tt free\_callback}. | 239 namely {\tt load}, {\tt find}, {\tt free}, {\tt call}, {\tt new\_callback}, {\tt free\_callback}. |
238 | 240 |
239 \begin{table}[h] | 241 \begin{table}[h] |
240 \begin{center} | 242 \begin{tabular*}{1.0\textwidth}{lll} |
241 \begin{tabular*}{0.75\textwidth}{lll} | |
242 Signature character & accepted Python 2 types & accepted Python 3 types \\ | 243 Signature character & accepted Python 2 types & accepted Python 3 types \\ |
243 \hline | 244 \hline |
244 \sigchar{v} & no return type & no return type \\ | 245 \sigchar{v} & no return type & no return type \\ |
245 \sigchar{B} & bool & bool \\ | 246 \sigchar{B} & bool & bool \\ |
246 \sigchar{c}, \sigchar{C} & int, string (with single char) & int, string (with single char) \\ | 247 \sigchar{c}, \sigchar{C} & int, string (with single char) & int, string (with single char) \\ |
253 \sigchar{p} & bytearray, int, long, None, (PyCObject, PyCapsule) & bytearray, int, None, (PyCObject, PyCapsule) \\ | 254 \sigchar{p} & bytearray, int, long, None, (PyCObject, PyCapsule) & bytearray, int, None, (PyCObject, PyCapsule) \\ |
254 \sigchar{Z} & string, unicode, bytearray & string, bytes, bytearray \\ | 255 \sigchar{Z} & string, unicode, bytearray & string, bytes, bytearray \\ |
255 \end{tabular*} | 256 \end{tabular*} |
256 \caption{Type signature encoding for Python bindings} | 257 \caption{Type signature encoding for Python bindings} |
257 \label{Pysigchar} | 258 \label{Pysigchar} |
258 \end{center} | |
259 \end{table} | 259 \end{table} |
260 | 260 |
261 This is a very brief description that omits many details. For more, refer to the README.txt file of the binding. | 261 This is a very brief description that omits many details. For more, refer to the README.txt file of the binding. |
262 | 262 |
263 \pagebreak | 263 \pagebreak |