comparison dwt/internal/C.d @ 45:d8635bb48c7c

Merge with SWT 3.5
author Jacob Carlborg <doob@me.com>
date Mon, 01 Dec 2008 17:07:00 +0100
parents db5a898b2119
children
comparison
equal deleted inserted replaced
44:ca5e494f2bbf 45:d8635bb48c7c
1 /******************************************************************************* 1 /*******************************************************************************
2 * Copyright (c) 2000, 2007 IBM Corporation and others. 2 * Copyright (c) 2000, 2007 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials 3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0 4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
8 * Contributors: 8 * Contributors:
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 * 10 *
11 * Port to the D programming language: 11 * Port to the D programming language:
12 * Jacob Carlborg <jacob.carlborg@gmail.com> 12 * Jacob Carlborg <doob@me.com>
13 *******************************************************************************/ 13 *******************************************************************************/
14 module dwt.internal.C; 14 module dwt.internal.C;
15 15
16 static import stdlib = tango.stdc.stdlib; 16 static import stdlib = tango.stdc.stdlib;
17 static import stdcstring = tango.stdc.string; 17 static import stdcstring = tango.stdc.string;
30 Library.loadLibrary ("swt"); //$NON-NLS-1$ 30 Library.loadLibrary ("swt"); //$NON-NLS-1$
31 }*/ 31 }*/
32 32
33 public static const size_t PTR_SIZEOF = (void*).sizeof; 33 public static const size_t PTR_SIZEOF = (void*).sizeof;
34 34
35 /** @param ptr cast=(void *) */
35 alias stdlib.free free; 36 alias stdlib.free free;
37 /** @param env cast=(const char *) */
36 alias stdlib.getenv getenv; 38 alias stdlib.getenv getenv;
37 alias stdlib.malloc malloc; 39 alias stdlib.malloc malloc;
38 alias stdcstring.memset memset; 40 alias stdcstring.memset memset;
39 alias stdcstring.memmove memmove; 41 alias stdcstring.memmove memmove;
40 alias stdcstring.strlen strlen; 42 alias stdcstring.strlen strlen;
41 43
42 /+public static final native void free (int /*long*/ ptr); 44 /+public static final native void free (int /*long*/ ptr);
43 public static final native int /*long*/ getenv (byte[] wcsToMbcs);
44 public static final native int /*long*/ malloc (int /*long*/ size); 45 public static final native int /*long*/ malloc (int /*long*/ size);
46 /**
47 * @param dest cast=(void *)
48 * @param src cast=(const void *),flags=no_out critical
49 * @param size cast=(size_t)
50 */
45 public static final native void memmove (int /*long*/ dest, byte[] src, int /*long*/ size); 51 public static final native void memmove (int /*long*/ dest, byte[] src, int /*long*/ size);
52 /**
53 * @param dest cast=(void *)
54 * @param src cast=(const void *),flags=no_out critical
55 * @param size cast=(size_t)
56 */
46 public static final native void memmove (int /*long*/ dest, char[] src, int /*long*/ size); 57 public static final native void memmove (int /*long*/ dest, char[] src, int /*long*/ size);
58 /**
59 * @param dest cast=(void *)
60 * @param src cast=(const void *),flags=no_out critical
61 * @param size cast=(size_t)
62 */
47 public static final native void memmove (int /*long*/ dest, double[] src, int /*long*/ size); 63 public static final native void memmove (int /*long*/ dest, double[] src, int /*long*/ size);
64 /**
65 * @param dest cast=(void *)
66 * @param src cast=(const void *),flags=no_out critical
67 * @param size cast=(size_t)
68 */
48 public static final native void memmove (int /*long*/ dest, float[] src, int /*long*/ size); 69 public static final native void memmove (int /*long*/ dest, float[] src, int /*long*/ size);
70 /**
71 * @param dest cast=(void *)
72 * @param src cast=(const void *),flags=no_out critical
73 * @param size cast=(size_t)
74 */
49 public static final native void memmove (int /*long*/ dest, int[] src, int /*long*/ size); 75 public static final native void memmove (int /*long*/ dest, int[] src, int /*long*/ size);
76 /**
77 * @param dest cast=(void *)
78 * @param src cast=(const void *),flags=no_out critical
79 * @param size cast=(size_t)
80 */
50 public static final native void memmove (int /*long*/ dest, long[] src, int /*long*/ size); 81 public static final native void memmove (int /*long*/ dest, long[] src, int /*long*/ size);
82 /**
83 * @param dest cast=(void *)
84 * @param src cast=(const void *),flags=no_out critical
85 * @param size cast=(size_t)
86 */
51 public static final native void memmove (int /*long*/ dest, short[] src, int /*long*/ size); 87 public static final native void memmove (int /*long*/ dest, short[] src, int /*long*/ size);
88 /**
89 * @param dest cast=(void *),flags=no_in critical
90 * @param src cast=(const void *),flags=no_out critical
91 * @param size cast=(size_t)
92 */
52 public static final native void memmove (byte[] dest, char[] src, int /*long*/ size); 93 public static final native void memmove (byte[] dest, char[] src, int /*long*/ size);
94 /**
95 * @param dest cast=(void *),flags=no_in critical
96 * @param src cast=(const void *)
97 * @param size cast=(size_t)
98 */
53 public static final native void memmove (byte[] dest, int /*long*/ src, int /*long*/ size); 99 public static final native void memmove (byte[] dest, int /*long*/ src, int /*long*/ size);
100 /**
101 * @param dest cast=(void *)
102 * @param src cast=(const void *)
103 * @param size cast=(size_t)
104 */
54 public static final native void memmove (int /*long*/ dest, int /*long*/ src, int /*long*/ size); 105 public static final native void memmove (int /*long*/ dest, int /*long*/ src, int /*long*/ size);
106 /**
107 * @param dest cast=(void *),flags=no_in critical
108 * @param src cast=(const void *)
109 * @param size cast=(size_t)
110 */
55 public static final native void memmove (char[] dest, int /*long*/ src, int /*long*/ size); 111 public static final native void memmove (char[] dest, int /*long*/ src, int /*long*/ size);
112 /**
113 * @param dest cast=(void *),flags=no_in critical
114 * @param src cast=(const void *)
115 * @param size cast=(size_t)
116 */
56 public static final native void memmove (double[] dest, int /*long*/ src, int /*long*/ size); 117 public static final native void memmove (double[] dest, int /*long*/ src, int /*long*/ size);
118 /**
119 * @param dest cast=(void *),flags=no_in critical
120 * @param src cast=(const void *)
121 * @param size cast=(size_t)
122 */
57 public static final native void memmove (float[] dest, int /*long*/ src, int /*long*/ size); 123 public static final native void memmove (float[] dest, int /*long*/ src, int /*long*/ size);
124 /**
125 * @param dest cast=(void *),flags=no_in critical
126 * @param src cast=(const void *)
127 * @param size cast=(size_t)
128 */
58 public static final native void memmove (int[] dest, byte[] src, int /*long*/ size); 129 public static final native void memmove (int[] dest, byte[] src, int /*long*/ size);
130 /**
131 * @param dest cast=(void *),flags=no_in critical
132 * @param src cast=(const void *)
133 * @param size cast=(size_t)
134 */
59 public static final native void memmove (short[] dest, int /*long*/ src, int /*long*/ size); 135 public static final native void memmove (short[] dest, int /*long*/ src, int /*long*/ size);
136 /**
137 * @param dest cast=(void *),flags=no_in critical
138 * @param src cast=(const void *)
139 * @param size cast=(size_t)
140 */
60 public static final native void memmove (int[] dest, int /*long*/ src, int /*long*/ size); 141 public static final native void memmove (int[] dest, int /*long*/ src, int /*long*/ size);
142 /**
143 * @param dest cast=(void *),flags=no_in critical
144 * @param src cast=(const void *)
145 * @param size cast=(size_t)
146 */
61 public static final native void memmove (long[] dest, int /*long*/ src, int /*long*/ size); 147 public static final native void memmove (long[] dest, int /*long*/ src, int /*long*/ size);
148 /**
149 * @param buffer cast=(void *),flags=critical
150 * @param num cast=(size_t)
151 */
62 public static final native int /*long*/ memset (int /*long*/ buffer, int c, int /*long*/ num); 152 public static final native int /*long*/ memset (int /*long*/ buffer, int c, int /*long*/ num);
63 public static final native int PTR_sizeof (); 153 public static final native int PTR_sizeof ();
154 /** @param s cast=(char *) */
64 public static final native int strlen (int /*long*/ s);+/ 155 public static final native int strlen (int /*long*/ s);+/
65 } 156 }