Changeset 3129
- Timestamp:
- Oct 28, 2008, 2:45:39 PM (15 years ago)
- Location:
- libcaca/trunk/caca-php
- Files:
-
- 1 added
- 2 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/caca-php/php_caca.c
r3128 r3129 112 112 PHP_FE(caca_get_font_width, NULL) 113 113 PHP_FE(caca_get_font_height, NULL) 114 PHP_FE(caca_get_font_bloc , NULL)114 PHP_FE(caca_get_font_blocks, NULL) 115 115 PHP_FE(caca_render_canvas, NULL) 116 116 PHP_FE(caca_canvas_set_figfont, NULL) … … 1205 1205 1206 1206 PHP_FUNCTION(caca_load_font) { 1207 char *str; 1208 long str_len; 1209 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { 1210 RETURN_FALSE; 1211 } 1212 caca_font_t *font = caca_load_font(str, str_len); 1213 ZEND_REGISTER_RESOURCE(return_value, font, le_caca_font); 1207 1214 } 1208 1215 … … 1235 1242 } 1236 1243 1237 PHP_FUNCTION(caca_get_font_bloc) { 1244 PHP_FUNCTION(caca_get_font_blocks) { 1245 zval *_zval; 1246 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &_zval) == FAILURE) { 1247 RETURN_FALSE; 1248 } 1249 caca_font_t *font; 1250 ZEND_FETCH_RESOURCE(font, caca_font_t*, &_zval, -1, PHP_CACA_FONT_RES_NAME, le_caca_font); 1251 1252 uint32_t const *list = caca_get_font_blocks(font); 1253 1254 int i; 1255 array_init(return_value); 1256 for(i = 0; list[i]; i += 1) 1257 add_next_index_long(return_value, list[i]); 1238 1258 } 1239 1259 … … 1254 1274 1255 1275 PHP_FUNCTION(caca_put_figchar) { 1276 zval *_zval; 1277 long c; 1278 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &_zval, &c) == FAILURE) { 1279 RETURN_FALSE; 1280 } 1281 caca_canvas_t *canvas; 1282 ZEND_FETCH_RESOURCE(canvas, caca_canvas_t*, &_zval, -1, PHP_CACA_CANVAS_RES_NAME, le_caca_canvas); 1283 1284 //TODO: get a string instead of a long 1285 caca_put_figchar(canvas, c); 1256 1286 } 1257 1287 -
libcaca/trunk/caca-php/php_caca.h
r3127 r3129 129 129 PHP_FUNCTION(caca_get_font_width); 130 130 PHP_FUNCTION(caca_get_font_height); 131 PHP_FUNCTION(caca_get_font_bloc );131 PHP_FUNCTION(caca_get_font_blocks); 132 132 PHP_FUNCTION(caca_render_canvas); 133 133 PHP_FUNCTION(caca_canvas_set_figfont);
Note: See TracChangeset
for help on using the changeset viewer.