source: libcaca/trunk/caca-php/php_caca.c @ 3092

Last change on this file since 3092 was 3092, checked in by nico, 12 years ago
  • Add flac support and some other nice features...
File size: 19.6 KB
Line 
1/*
2 *  php-caca      Php binding for Libcaca
3 *  Copyright (c) 2008 Vion Nicolas <nico@picapo.net>
4 *
5 *
6 *  This library is free software. It comes without any warranty, to
7 *  the extent permitted by applicable law. You can redistribute it
8 *  and/or modify it under the terms of the Do What The Fuck You Want
9 *  To Public License, Version 2, as published by Sam Hocevar. See
10 *  http://sam.zoy.org/wtfpl/COPYING for more details.
11 */
12
13#ifdef HAVE_CONFIG_H
14#include "config.h"
15#endif
16
17#include "php.h"
18#include "php_caca.h"
19
20static function_entry caca_functions[] = {
21        PHP_FE(caca_create_canvas, NULL)
22        PHP_FE(caca_manage_canvas, NULL)
23        PHP_FE(caca_unmanage_canvas, NULL)
24        PHP_FE(caca_set_canvas_size, NULL)
25        PHP_FE(caca_get_canvas_width, NULL)
26        PHP_FE(caca_get_canvas_height, NULL)
27        PHP_FE(caca_get_canvas_chars, NULL)
28        PHP_FE(caca_get_canvas_attrs, NULL)
29        PHP_FE(caca_rand, NULL)
30        PHP_FE(caca_get_version, NULL)
31        PHP_FE(caca_gotoxy, NULL)
32        PHP_FE(caca_get_cursor_x, NULL)
33        PHP_FE(caca_get_cursor_y, NULL)
34        PHP_FE(caca_put_char, NULL)
35        PHP_FE(caca_get_char, NULL)
36        PHP_FE(caca_put_str, NULL)
37        PHP_FE(caca_printf, NULL)
38        PHP_FE(caca_clear_canvas, NULL)
39        PHP_FE(caca_set_canvas_handle, NULL)
40        PHP_FE(caca_get_canvas_handle_x, NULL)
41        PHP_FE(caca_get_canvas_handle_y, NULL)
42        PHP_FE(caca_blit, NULL)
43        PHP_FE(caca_set_canvas_boundaries, NULL)
44        PHP_FE(caca_invert, NULL)
45        PHP_FE(caca_flip, NULL)
46        PHP_FE(caca_flop, NULL)
47        PHP_FE(caca_rotate_left, NULL)
48        PHP_FE(caca_rotate_right, NULL)
49        PHP_FE(caca_stretch_left, NULL)
50        PHP_FE(caca_stretch_right, NULL)
51        PHP_FE(caca_get_attr, NULL)
52        PHP_FE(caca_set_attr, NULL)
53        PHP_FE(caca_put_attr, NULL)
54        PHP_FE(caca_set_color_ansi, NULL)
55        PHP_FE(caca_set_color_argb, NULL)
56        PHP_FE(caca_attr_to_ansi, NULL)
57        PHP_FE(caca_attr_to_ansi_fg, NULL)
58        PHP_FE(caca_attr_to_ansi_bg, NULL)
59        PHP_FE(caca_draw_line, NULL)
60        PHP_FE(caca_draw_polyline, NULL)
61        PHP_FE(caca_draw_thin_line, NULL)
62        PHP_FE(caca_draw_thin_polyline, NULL)
63        PHP_FE(caca_draw_circle, NULL)
64        PHP_FE(caca_draw_ellipse, NULL)
65        PHP_FE(caca_draw_thin_ellipse, NULL)
66        PHP_FE(caca_fill_ellipse, NULL)
67        PHP_FE(caca_draw_box, NULL)
68        PHP_FE(caca_draw_thin_box, NULL)
69        PHP_FE(caca_fill_box, NULL)
70        PHP_FE(caca_draw_triangle, NULL)
71        PHP_FE(caca_draw_thin_triangle, NULL)
72        PHP_FE(caca_fill_triangle, NULL)
73        PHP_FE(caca_get_frame_count, NULL)
74        PHP_FE(caca_set_frame, NULL)
75        PHP_FE(caca_set_frame_name, NULL)
76        PHP_FE(caca_create_frame, NULL)
77        PHP_FE(caca_free_frame, NULL)
78        PHP_FE(caca_set_dither_palette, NULL)
79        PHP_FE(caca_set_dither_brightness, NULL)
80        PHP_FE(caca_get_dither_brightness, NULL)
81        PHP_FE(caca_set_dither_gamma, NULL)
82        PHP_FE(caca_get_dither_gamma, NULL)
83        PHP_FE(caca_set_dither_contrast, NULL)
84        PHP_FE(caca_get_dither_contrast, NULL)
85        PHP_FE(caca_set_dither_antialias, NULL)
86        PHP_FE(caca_get_dither_antialias_list, NULL)
87        PHP_FE(caca_get_dither_antialias, NULL)
88        PHP_FE(caca_set_dither_color, NULL)
89        PHP_FE(caca_get_dither_color_list, NULL)
90        PHP_FE(caca_get_dither_color, NULL)
91        PHP_FE(caca_set_dither_charset, NULL)
92        PHP_FE(caca_get_dither_charset_list, NULL)
93        PHP_FE(caca_get_dither_charset, NULL)
94        PHP_FE(caca_set_dither_algorithm, NULL)
95        PHP_FE(caca_get_dither_algorithm_list, NULL)
96        PHP_FE(caca_get_dither_algorithm, NULL)
97        PHP_FE(caca_dither_bitmap, NULL)
98        PHP_FE(caca_get_font_list, NULL)
99        PHP_FE(caca_get_font_width, NULL)
100        PHP_FE(caca_get_font_height, NULL)
101        PHP_FE(caca_render_canvas, NULL)
102        PHP_FE(caca_canvas_set_figfont, NULL)
103        PHP_FE(caca_put_figchar, NULL)
104        PHP_FE(caca_flush_figlet, NULL)
105        PHP_FE(caca_file_close, NULL)
106        PHP_FE(caca_file_tell, NULL)
107        PHP_FE(caca_file_read, NULL)
108        PHP_FE(caca_file_write, NULL)
109        PHP_FE(caca_file_gets, NULL)
110        PHP_FE(caca_file_eof, NULL)
111        PHP_FE(caca_import_memory, NULL)
112        PHP_FE(caca_import_file, NULL)
113        PHP_FE(caca_get_import_list, NULL)
114        PHP_FE(caca_get_export_list, NULL)
115        PHP_FE(caca_create_display, NULL)
116        PHP_FE(caca_create_display_with_driver, NULL)
117        PHP_FE(caca_get_display_driver_list, NULL)
118        PHP_FE(caca_get_display_driver, NULL)
119        PHP_FE(caca_set_display_driver, NULL)
120        PHP_FE(caca_get_canvas, NULL)
121        PHP_FE(caca_refresh_display, NULL)
122        PHP_FE(caca_set_display_time, NULL)
123        PHP_FE(caca_get_display_time, NULL)
124        PHP_FE(caca_get_display_width, NULL)
125        PHP_FE(caca_get_display_height, NULL)
126        PHP_FE(caca_set_display_title, NULL)
127        PHP_FE(caca_set_mouse, NULL)
128        PHP_FE(caca_set_cursor, NULL)
129        PHP_FE(caca_get_event, NULL)
130        PHP_FE(caca_get_mouse_x, NULL)
131        PHP_FE(caca_get_mouse_y, NULL)
132        PHP_FE(caca_get_event_type, NULL)
133        PHP_FE(caca_get_event_key_ch, NULL)
134        PHP_FE(caca_get_event_mouse_button, NULL)
135        PHP_FE(caca_get_event_mouse_x, NULL)
136        PHP_FE(caca_get_event_mouse_y, NULL)
137        PHP_FE(caca_get_event_resize_width, NULL)
138        PHP_FE(caca_get_event_resize_height, NULL)
139
140        {NULL, NULL, NULL}
141};
142
143zend_module_entry caca_module_entry = {
144#if ZEND_MODULE_API_NO >= 20010901
145        STANDARD_MODULE_HEADER,
146#endif
147        PHP_CACA_EXTNAME,
148        caca_functions,
149        PHP_MINIT(caca),
150        NULL,
151        NULL,
152        NULL,
153        PHP_MINFO(caca),
154#if ZEND_MODULE_API_NO >= 20010901
155        PHP_CACA_VERSION,
156#endif
157        STANDARD_MODULE_PROPERTIES
158};
159
160#ifdef COMPILE_DL_CACA
161ZEND_GET_MODULE(caca)
162#endif
163
164PHP_MINFO_FUNCTION(caca) {
165        php_info_print_table_start();
166        php_info_print_table_row(2, "Caca library version", caca_get_version());
167        php_info_print_table_end();
168}
169
170//--------CACA'S RESSOURCES DESTRUCTORS-----------//
171
172static void php_caca_canvas_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) {
173        caca_free_canvas(rsrc->ptr);
174}
175
176static void php_caca_dither_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) {
177        caca_free_dither(rsrc->ptr);
178}
179
180static void php_caca_font_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) {
181        caca_free_font(rsrc->ptr);
182}
183
184static void php_caca_file_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) {
185}
186
187static void php_caca_display_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) {
188        caca_free_display(rsrc->ptr);
189}
190
191static void php_caca_event_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) {
192}
193
194//--------INITIALIZATION---------//
195
196PHP_MINIT_FUNCTION(caca) {
197
198        le_caca_canvas = zend_register_list_destructors_ex(php_caca_canvas_dtor, NULL, PHP_CACA_CANVAS_RES_NAME, module_number);
199        le_caca_dither = zend_register_list_destructors_ex(php_caca_dither_dtor, NULL, PHP_CACA_DITHER_RES_NAME, module_number);
200        le_caca_font = zend_register_list_destructors_ex(php_caca_font_dtor, NULL, PHP_CACA_FONT_RES_NAME, module_number);
201        le_caca_file = zend_register_list_destructors_ex(php_caca_file_dtor, NULL, PHP_CACA_FILE_RES_NAME, module_number);
202        le_caca_display = zend_register_list_destructors_ex(php_caca_display_dtor, NULL, PHP_CACA_DISPLAY_RES_NAME, module_number);
203        le_caca_event = zend_register_list_destructors_ex(php_caca_event_dtor, NULL, PHP_CACA_EVENT_RES_NAME, module_number);
204       
205        REGISTER_LONG_CONSTANT("CACA_BLACK", CACA_BLACK, CONST_CS | CONST_PERSISTENT);
206        REGISTER_LONG_CONSTANT("CACA_BLUE", CACA_BLUE, CONST_CS | CONST_PERSISTENT);
207        REGISTER_LONG_CONSTANT("CACA_GREEN", CACA_GREEN, CONST_CS | CONST_PERSISTENT);
208        REGISTER_LONG_CONSTANT("CACA_CYAN", CACA_CYAN, CONST_CS | CONST_PERSISTENT);
209        REGISTER_LONG_CONSTANT("CACA_RED", CACA_RED, CONST_CS | CONST_PERSISTENT);
210        REGISTER_LONG_CONSTANT("CACA_MAGENTA", CACA_MAGENTA, CONST_CS | CONST_PERSISTENT);
211        REGISTER_LONG_CONSTANT("CACA_BROWN", CACA_BROWN, CONST_CS | CONST_PERSISTENT);
212        REGISTER_LONG_CONSTANT("CACA_LIGHTGRAY", CACA_LIGHTGRAY, CONST_CS | CONST_PERSISTENT);
213        REGISTER_LONG_CONSTANT("CACA_DARKGRAY", CACA_DARKGRAY, CONST_CS | CONST_PERSISTENT);
214        REGISTER_LONG_CONSTANT("CACA_LIGHTBLUE", CACA_LIGHTBLUE, CONST_CS | CONST_PERSISTENT);
215        REGISTER_LONG_CONSTANT("CACA_LIGHTGREEN", CACA_LIGHTGREEN, CONST_CS | CONST_PERSISTENT);
216        REGISTER_LONG_CONSTANT("CACA_LIGHTCYAN", CACA_LIGHTCYAN, CONST_CS | CONST_PERSISTENT);
217        REGISTER_LONG_CONSTANT("CACA_LIGHTRED", CACA_LIGHTRED, CONST_CS | CONST_PERSISTENT);
218        REGISTER_LONG_CONSTANT("CACA_LIGHTMAGENTA", CACA_LIGHTMAGENTA, CONST_CS | CONST_PERSISTENT);
219        REGISTER_LONG_CONSTANT("CACA_YELLOW", CACA_YELLOW, CONST_CS | CONST_PERSISTENT);
220        REGISTER_LONG_CONSTANT("CACA_WHITE", CACA_WHITE, CONST_CS | CONST_PERSISTENT);
221        REGISTER_LONG_CONSTANT("CACA_DEFAULT", CACA_DEFAULT, CONST_CS | CONST_PERSISTENT);
222        REGISTER_LONG_CONSTANT("CACA_TRANSPARENT", CACA_TRANSPARENT, CONST_CS | CONST_PERSISTENT);
223        REGISTER_LONG_CONSTANT("CACA_BOLD", CACA_BOLD, CONST_CS | CONST_PERSISTENT);
224        REGISTER_LONG_CONSTANT("CACA_ITALICS", CACA_ITALICS, CONST_CS | CONST_PERSISTENT);
225        REGISTER_LONG_CONSTANT("CACA_UNDERLINE", CACA_UNDERLINE, CONST_CS | CONST_PERSISTENT);
226        REGISTER_LONG_CONSTANT("CACA_BLINK", CACA_BLINK, CONST_CS | CONST_PERSISTENT);
227
228        REGISTER_LONG_CONSTANT("CACA_EVENT_NONE", CACA_EVENT_NONE, CONST_CS | CONST_PERSISTENT);
229        REGISTER_LONG_CONSTANT("CACA_EVENT_KEY_PRESS", CACA_EVENT_KEY_PRESS, CONST_CS | CONST_PERSISTENT);
230        REGISTER_LONG_CONSTANT("CACA_EVENT_KEY_RELEASE", CACA_EVENT_KEY_RELEASE, CONST_CS | CONST_PERSISTENT);
231        REGISTER_LONG_CONSTANT("CACA_EVENT_MOUSE_PRESS", CACA_EVENT_MOUSE_PRESS, CONST_CS | CONST_PERSISTENT);
232        REGISTER_LONG_CONSTANT("CACA_EVENT_MOUSE_RELEASE", CACA_EVENT_MOUSE_RELEASE, CONST_CS | CONST_PERSISTENT);
233        REGISTER_LONG_CONSTANT("CACA_EVENT_MOUSE_MOTION", CACA_EVENT_MOUSE_MOTION, CONST_CS | CONST_PERSISTENT);
234        REGISTER_LONG_CONSTANT("CACA_EVENT_RESIZE", CACA_EVENT_RESIZE, CONST_CS | CONST_PERSISTENT);
235        REGISTER_LONG_CONSTANT("CACA_EVENT_QUIT", CACA_EVENT_QUIT, CONST_CS | CONST_PERSISTENT);
236        REGISTER_LONG_CONSTANT("CACA_EVENT_ANY", CACA_EVENT_ANY, CONST_CS | CONST_PERSISTENT);
237
238        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_A", CACA_KEY_CTRL_A, CONST_CS | CONST_PERSISTENT);
239        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_B", CACA_KEY_CTRL_B, CONST_CS | CONST_PERSISTENT);
240        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_C", CACA_KEY_CTRL_C, CONST_CS | CONST_PERSISTENT);
241        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_D", CACA_KEY_CTRL_D, CONST_CS | CONST_PERSISTENT);
242        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_E", CACA_KEY_CTRL_E, CONST_CS | CONST_PERSISTENT);
243        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_F", CACA_KEY_CTRL_F, CONST_CS | CONST_PERSISTENT);
244        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_G", CACA_KEY_CTRL_G, CONST_CS | CONST_PERSISTENT);
245        REGISTER_LONG_CONSTANT("CACA_KEY_BACKSPACE", CACA_KEY_BACKSPACE, CONST_CS | CONST_PERSISTENT);
246        REGISTER_LONG_CONSTANT("CACA_KEY_TAB", CACA_KEY_TAB, CONST_CS | CONST_PERSISTENT);
247        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_J", CACA_KEY_CTRL_J, CONST_CS | CONST_PERSISTENT);
248        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_K", CACA_KEY_CTRL_K, CONST_CS | CONST_PERSISTENT);
249        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_L", CACA_KEY_CTRL_L, CONST_CS | CONST_PERSISTENT);
250        REGISTER_LONG_CONSTANT("CACA_KEY_RETURN", CACA_KEY_RETURN, CONST_CS | CONST_PERSISTENT);
251        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_N", CACA_KEY_CTRL_N, CONST_CS | CONST_PERSISTENT);
252        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_O", CACA_KEY_CTRL_O, CONST_CS | CONST_PERSISTENT);
253        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_P", CACA_KEY_CTRL_P, CONST_CS | CONST_PERSISTENT);
254        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_Q", CACA_KEY_CTRL_Q, CONST_CS | CONST_PERSISTENT);
255        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_R", CACA_KEY_CTRL_R, CONST_CS | CONST_PERSISTENT);
256        REGISTER_LONG_CONSTANT("CACA_KEY_PAUSE", CACA_KEY_PAUSE, CONST_CS | CONST_PERSISTENT);
257        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_T", CACA_KEY_CTRL_T, CONST_CS | CONST_PERSISTENT);
258        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_U", CACA_KEY_CTRL_U, CONST_CS | CONST_PERSISTENT);
259        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_V", CACA_KEY_CTRL_V, CONST_CS | CONST_PERSISTENT);
260        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_W", CACA_KEY_CTRL_W, CONST_CS | CONST_PERSISTENT);
261        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_X", CACA_KEY_CTRL_X, CONST_CS | CONST_PERSISTENT);
262        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_Y", CACA_KEY_CTRL_Y, CONST_CS | CONST_PERSISTENT);
263        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_Z", CACA_KEY_CTRL_Z, CONST_CS | CONST_PERSISTENT);
264        REGISTER_LONG_CONSTANT("CACA_KEY_ESCAPE", CACA_KEY_ESCAPE, CONST_CS | CONST_PERSISTENT);
265        REGISTER_LONG_CONSTANT("CACA_KEY_DELETE", CACA_KEY_DELETE, CONST_CS | CONST_PERSISTENT);
266        REGISTER_LONG_CONSTANT("CACA_KEY_UP", CACA_KEY_UP, CONST_CS | CONST_PERSISTENT);
267        REGISTER_LONG_CONSTANT("CACA_KEY_DOWN", CACA_KEY_DOWN, CONST_CS | CONST_PERSISTENT);
268        REGISTER_LONG_CONSTANT("CACA_KEY_LEFT", CACA_KEY_LEFT, CONST_CS | CONST_PERSISTENT);
269        REGISTER_LONG_CONSTANT("CACA_KEY_RIGHT", CACA_KEY_RIGHT, CONST_CS | CONST_PERSISTENT);
270        REGISTER_LONG_CONSTANT("CACA_KEY_INSERT", CACA_KEY_INSERT, CONST_CS | CONST_PERSISTENT);
271        REGISTER_LONG_CONSTANT("CACA_KEY_HOME", CACA_KEY_HOME, CONST_CS | CONST_PERSISTENT);
272        REGISTER_LONG_CONSTANT("CACA_KEY_END", CACA_KEY_END, CONST_CS | CONST_PERSISTENT);
273        REGISTER_LONG_CONSTANT("CACA_KEY_PAGEUP", CACA_KEY_PAGEUP, CONST_CS | CONST_PERSISTENT);
274        REGISTER_LONG_CONSTANT("CACA_KEY_PAGEDOWN", CACA_KEY_PAGEDOWN, CONST_CS | CONST_PERSISTENT);
275        REGISTER_LONG_CONSTANT("CACA_KEY_F1", CACA_KEY_F1, CONST_CS | CONST_PERSISTENT);
276        REGISTER_LONG_CONSTANT("CACA_KEY_F2", CACA_KEY_F2, CONST_CS | CONST_PERSISTENT);
277        REGISTER_LONG_CONSTANT("CACA_KEY_F3", CACA_KEY_F3, CONST_CS | CONST_PERSISTENT);
278        REGISTER_LONG_CONSTANT("CACA_KEY_F4", CACA_KEY_F4, CONST_CS | CONST_PERSISTENT);
279        REGISTER_LONG_CONSTANT("CACA_KEY_F5", CACA_KEY_F5, CONST_CS | CONST_PERSISTENT);
280        REGISTER_LONG_CONSTANT("CACA_KEY_F6", CACA_KEY_F6, CONST_CS | CONST_PERSISTENT);
281        REGISTER_LONG_CONSTANT("CACA_KEY_F7", CACA_KEY_F7, CONST_CS | CONST_PERSISTENT);
282        REGISTER_LONG_CONSTANT("CACA_KEY_F8", CACA_KEY_F8, CONST_CS | CONST_PERSISTENT);
283        REGISTER_LONG_CONSTANT("CACA_KEY_F9", CACA_KEY_F9, CONST_CS | CONST_PERSISTENT);
284        REGISTER_LONG_CONSTANT("CACA_KEY_F10", CACA_KEY_F10, CONST_CS | CONST_PERSISTENT);
285        REGISTER_LONG_CONSTANT("CACA_KEY_F11", CACA_KEY_F11, CONST_CS | CONST_PERSISTENT);
286        REGISTER_LONG_CONSTANT("CACA_KEY_F12", CACA_KEY_F12, CONST_CS | CONST_PERSISTENT);
287        REGISTER_LONG_CONSTANT("CACA_KEY_F13", CACA_KEY_F13, CONST_CS | CONST_PERSISTENT);
288        REGISTER_LONG_CONSTANT("CACA_KEY_F14", CACA_KEY_F14, CONST_CS | CONST_PERSISTENT);
289        REGISTER_LONG_CONSTANT("CACA_KEY_F15", CACA_KEY_F15, CONST_CS | CONST_PERSISTENT);
290
291        return SUCCESS;
292}
293
294//----------SOME USEFULL MACROS---------------//
295
296#define FETCH_CANVAS(canvas) \
297        zval *_zval; \
298        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &_zval) == FAILURE) { \
299                RETURN_FALSE; \
300        } \
301        ZEND_FETCH_RESOURCE(canvas, caca_canvas_t*, &_zval, -1, PHP_CACA_CANVAS_RES_NAME, le_caca_canvas);
302
303
304//-------CACA'S FUNCTIONS----------------//
305
306PHP_FUNCTION(caca_create_canvas) {
307}
308
309PHP_FUNCTION(caca_manage_canvas) {
310}
311
312PHP_FUNCTION(caca_unmanage_canvas) {
313}
314
315PHP_FUNCTION(caca_set_canvas_size) {
316}
317
318PHP_FUNCTION(caca_get_canvas_width) {
319}
320
321PHP_FUNCTION(caca_get_canvas_height) {
322}
323
324PHP_FUNCTION(caca_get_canvas_chars) {
325}
326
327PHP_FUNCTION(caca_get_canvas_attrs) {
328}
329
330PHP_FUNCTION(caca_rand) {
331}
332
333PHP_FUNCTION(caca_get_version) {
334        RETURN_STRING(estrdup(caca_get_version()), 0);
335}
336
337PHP_FUNCTION(caca_gotoxy) {
338}
339
340PHP_FUNCTION(caca_get_cursor_x) {
341        caca_canvas_t *canvas;
342        FETCH_CANVAS(canvas);
343        RETURN_LONG(caca_get_cursor_x(canvas));
344}
345
346PHP_FUNCTION(caca_get_cursor_y) {
347        caca_canvas_t *canvas;
348        FETCH_CANVAS(canvas);
349        RETURN_LONG(caca_get_cursor_y(canvas));
350}
351
352PHP_FUNCTION(caca_put_char) {
353}
354
355PHP_FUNCTION(caca_get_char) {
356}
357
358PHP_FUNCTION(caca_put_str) {
359}
360
361PHP_FUNCTION(caca_printf) {
362}
363
364PHP_FUNCTION(caca_clear_canvas) {
365}
366
367PHP_FUNCTION(caca_set_canvas_handle) {
368}
369
370PHP_FUNCTION(caca_get_canvas_handle_x) {
371        caca_canvas_t *canvas;
372        FETCH_CANVAS(canvas);
373        RETURN_LONG(caca_get_canvas_handle_x(canvas));
374}
375
376PHP_FUNCTION(caca_get_canvas_handle_y) {
377        caca_canvas_t *canvas;
378        FETCH_CANVAS(canvas);
379        RETURN_LONG(caca_get_canvas_handle_y(canvas));
380}
381
382PHP_FUNCTION(caca_blit) {
383}
384
385PHP_FUNCTION(caca_set_canvas_boundaries) {
386}
387
388PHP_FUNCTION(caca_invert) {
389        caca_canvas_t *canvas;
390        FETCH_CANVAS(canvas);
391        RETURN_BOOL(caca_invert(canvas) == 0);
392}
393
394PHP_FUNCTION(caca_flip) {
395        caca_canvas_t *canvas;
396        FETCH_CANVAS(canvas);
397        RETURN_BOOL(caca_flip(canvas) == 0);
398}
399
400PHP_FUNCTION(caca_flop) {
401        caca_canvas_t *canvas;
402        FETCH_CANVAS(canvas);
403        RETURN_BOOL(caca_flop(canvas) == 0);
404}
405
406PHP_FUNCTION(caca_rotate_180) {
407        caca_canvas_t *canvas;
408        FETCH_CANVAS(canvas);
409        RETURN_BOOL(caca_rotate_180(canvas) == 0);
410}
411
412PHP_FUNCTION(caca_rotate_left) {
413        caca_canvas_t *canvas;
414        FETCH_CANVAS(canvas);
415        RETURN_BOOL(caca_rotate_left(canvas) == 0);
416}
417
418PHP_FUNCTION(caca_rotate_right) {
419        caca_canvas_t *canvas;
420        FETCH_CANVAS(canvas);
421        RETURN_BOOL(caca_rotate_right(canvas) == 0);
422}
423
424PHP_FUNCTION(caca_stretch_left) {
425        caca_canvas_t *canvas;
426        FETCH_CANVAS(canvas);
427        RETURN_BOOL(caca_stretch_left(canvas) == 0);
428}
429
430PHP_FUNCTION(caca_stretch_right) {
431        caca_canvas_t *canvas;
432        FETCH_CANVAS(canvas);
433        RETURN_BOOL(caca_stretch_right(canvas) == 0);
434}
435
436PHP_FUNCTION(caca_get_attr) {
437}
438
439PHP_FUNCTION(caca_set_attr) {
440}
441
442PHP_FUNCTION(caca_put_attr) {
443}
444
445PHP_FUNCTION(caca_set_color_ansi) {
446}
447
448PHP_FUNCTION(caca_set_color_argb) {
449}
450
451PHP_FUNCTION(caca_attr_to_ansi) {
452}
453
454PHP_FUNCTION(caca_attr_to_ansi_fg) {
455}
456
457PHP_FUNCTION(caca_attr_to_ansi_bg) {
458}
459
460PHP_FUNCTION(caca_draw_line) {
461}
462
463PHP_FUNCTION(caca_draw_polyline) {
464}
465
466PHP_FUNCTION(caca_draw_thin_line) {
467}
468
469PHP_FUNCTION(caca_draw_thin_polyline) {
470}
471
472PHP_FUNCTION(caca_draw_circle) {
473}
474
475PHP_FUNCTION(caca_draw_ellipse) {
476}
477
478PHP_FUNCTION(caca_draw_thin_ellipse) {
479}
480
481PHP_FUNCTION(caca_fill_ellipse) {
482}
483
484PHP_FUNCTION(caca_draw_box) {
485}
486
487PHP_FUNCTION(caca_draw_thin_box) {
488}
489
490PHP_FUNCTION(caca_fill_box) {
491}
492
493PHP_FUNCTION(caca_draw_triangle) {
494}
495
496PHP_FUNCTION(caca_draw_thin_triangle) {
497}
498
499PHP_FUNCTION(caca_fill_triangle) {
500}
501
502PHP_FUNCTION(caca_get_frame_count) {
503}
504
505PHP_FUNCTION(caca_set_frame) {
506}
507
508PHP_FUNCTION(caca_set_frame_name) {
509}
510
511PHP_FUNCTION(caca_create_frame) {
512}
513
514PHP_FUNCTION(caca_free_frame) {
515}
516
517PHP_FUNCTION(caca_set_dither_palette) {
518}
519
520PHP_FUNCTION(caca_set_dither_brightness) {
521}
522
523PHP_FUNCTION(caca_get_dither_brightness) {
524}
525
526PHP_FUNCTION(caca_set_dither_gamma) {
527}
528
529PHP_FUNCTION(caca_get_dither_gamma) {
530}
531
532PHP_FUNCTION(caca_set_dither_contrast) {
533}
534
535PHP_FUNCTION(caca_get_dither_contrast) {
536}
537
538PHP_FUNCTION(caca_set_dither_antialias) {
539}
540
541PHP_FUNCTION(caca_get_dither_antialias_list) {
542}
543
544PHP_FUNCTION(caca_get_dither_antialias) {
545}
546
547PHP_FUNCTION(caca_set_dither_color) {
548}
549
550PHP_FUNCTION(caca_get_dither_color_list) {
551}
552
553PHP_FUNCTION(caca_get_dither_color) {
554}
555
556PHP_FUNCTION(caca_set_dither_charset) {
557}
558
559PHP_FUNCTION(caca_get_dither_charset_list) {
560}
561
562PHP_FUNCTION(caca_get_dither_charset) {
563}
564
565PHP_FUNCTION(caca_set_dither_algorithm) {
566}
567
568PHP_FUNCTION(caca_get_dither_algorithm_list) {
569}
570
571PHP_FUNCTION(caca_get_dither_algorithm) {
572}
573
574PHP_FUNCTION(caca_dither_bitmap) {
575}
576
577PHP_FUNCTION(caca_get_font_list) {
578}
579
580PHP_FUNCTION(caca_get_font_width) {
581}
582
583PHP_FUNCTION(caca_get_font_height) {
584}
585
586PHP_FUNCTION(caca_render_canvas) {
587}
588
589PHP_FUNCTION(caca_canvas_set_figfont) {
590}
591
592PHP_FUNCTION(caca_put_figchar) {
593}
594
595PHP_FUNCTION(caca_flush_figlet) {
596}
597
598PHP_FUNCTION(caca_file_close) {
599}
600
601PHP_FUNCTION(caca_file_tell) {
602}
603
604PHP_FUNCTION(caca_file_read) {
605}
606
607PHP_FUNCTION(caca_file_write) {
608}
609
610PHP_FUNCTION(caca_file_gets) {
611}
612
613PHP_FUNCTION(caca_file_eof) {
614}
615
616PHP_FUNCTION(caca_import_memory) {
617}
618
619PHP_FUNCTION(caca_import_file) {
620}
621
622PHP_FUNCTION(caca_get_import_list) {
623}
624
625PHP_FUNCTION(caca_get_export_list) {
626}
627
628PHP_FUNCTION(caca_create_display) {
629}
630
631PHP_FUNCTION(caca_create_display_with_driver) {
632}
633
634PHP_FUNCTION(caca_get_display_driver_list) {
635}
636
637PHP_FUNCTION(caca_get_display_driver) {
638}
639
640PHP_FUNCTION(caca_set_display_driver) {
641}
642
643PHP_FUNCTION(caca_get_canvas) {
644}
645
646PHP_FUNCTION(caca_refresh_display) {
647}
648
649PHP_FUNCTION(caca_set_display_time) {
650}
651
652PHP_FUNCTION(caca_get_display_time) {
653}
654
655PHP_FUNCTION(caca_get_display_width) {
656}
657
658PHP_FUNCTION(caca_get_display_height) {
659}
660
661PHP_FUNCTION(caca_set_display_title) {
662}
663
664PHP_FUNCTION(caca_set_mouse) {
665}
666
667PHP_FUNCTION(caca_set_cursor) {
668}
669
670PHP_FUNCTION(caca_get_event) {
671}
672
673PHP_FUNCTION(caca_get_mouse_x) {
674}
675
676PHP_FUNCTION(caca_get_mouse_y) {
677}
678
679PHP_FUNCTION(caca_get_event_type) {
680}
681
682PHP_FUNCTION(caca_get_event_key_ch) {
683}
684
685PHP_FUNCTION(caca_get_event_mouse_button) {
686}
687
688PHP_FUNCTION(caca_get_event_mouse_x) {
689}
690
691PHP_FUNCTION(caca_get_event_mouse_y) {
692}
693
694PHP_FUNCTION(caca_get_event_resize_width) {
695}
696
697PHP_FUNCTION(caca_get_event_resize_height) {
698}
699
Note: See TracBrowser for help on using the repository browser.