Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Side by Side Diff: swig/Lib/typemaps/cdata.swg

Issue 553095: Checkin swig binaries for win, linux and Mac... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: '' Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « swig/Lib/typemaps/carrays.swg ('k') | swig/Lib/typemaps/cmalloc.swg » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* -----------------------------------------------------------------------------
2 * See the LICENSE file for information on copyright, usage and redistribution
3 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
4 *
5 * cdata.swg
6 *
7 * This library file contains macros for manipulating raw C data as strings.
8 * ----------------------------------------------------------------------------- */
9
10 %{
11 typedef struct SWIGCDATA {
12 char *data;
13 size_t len;
14 } SWIGCDATA;
15 %}
16
17 /* -----------------------------------------------------------------------------
18 * Typemaps for returning binary data
19 * ----------------------------------------------------------------------------- */
20
21 %typemap(out,noblock=1,fragment="SWIG_FromCharPtrAndSize") SWIGCDATA {
22 %set_output(SWIG_FromCharPtrAndSize($1.data,$1.len));
23 }
24 %typemap(in) (const void *indata, int inlen) = (char *STRING, int SIZE);
25
26
27 /* -----------------------------------------------------------------------------
28 * %cdata(TYPE [, NAME])
29 *
30 * Convert raw C data to a binary string.
31 * ----------------------------------------------------------------------------- */
32
33 %define %cdata(TYPE,NAME...)
34
35 %insert("header") {
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 #if #NAME == ""
40 static SWIGCDATA cdata_##TYPE(TYPE *ptr, size_t nelements)
41 #else
42 static SWIGCDATA cdata_##NAME(TYPE *ptr, size_t nelements)
43 #endif
44 {
45 SWIGCDATA d;
46 d.data = (char *) ptr;
47 #if #TYPE != "void"
48 d.len = nelements*sizeof(TYPE);
49 #else
50 d.len = nelements;
51 #endif
52 return d;
53 }
54 #ifdef __cplusplus
55 }
56 #endif
57 }
58
59 #ifdef __cplusplus
60 extern "C"
61 #endif
62 #if #NAME == ""
63 SWIGCDATA cdata_##TYPE(TYPE *ptr, size_t nelements = 1);
64 #else
65 SWIGCDATA cdata_##NAME(TYPE *ptr, size_t nelements = 1);
66 #endif
67 %enddef
68
69 %rename(cdata) ::cdata_void(void *ptr, size_t nelements = 1);
70
71 %cdata(void);
72
73 /* Memory move function */
74 void memmove(void *data, const void *indata, size_t inlen);
75
76
77
78
OLDNEW
« no previous file with comments | « swig/Lib/typemaps/carrays.swg ('k') | swig/Lib/typemaps/cmalloc.swg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698