Changeset 1307 for libcaca/trunk
- Timestamp:
- Nov 8, 2006, 6:18:23 PM (16 years ago)
- Location:
- libcaca/trunk/cucul
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/cucul/cucul.h
r1306 r1307 217 217 * 218 218 * @{ */ 219 long int cucul_import_memory(cucul_canvas_t *, unsigned charconst *,219 long int cucul_import_memory(cucul_canvas_t *, void const *, 220 220 unsigned long int, char const *); 221 221 long int cucul_import_file(cucul_canvas_t *, char const *, char const *); -
libcaca/trunk/cucul/import.c
r1305 r1307 83 83 * \return The number of bytes read, or -1 if an error occurred. 84 84 */ 85 long int cucul_import_memory(cucul_canvas_t *cv, unsigned charconst *buf,85 long int cucul_import_memory(cucul_canvas_t *cv, void const *buf, 86 86 unsigned long int len, char const *format) 87 87 { … … 98 98 if(!strcasecmp("", format)) 99 99 { 100 unsigned char const *str = buf; 100 101 unsigned int i; 101 102 102 103 /* If 4 first bytes are 0xcaca + 'CV' */ 103 if(len >= 4 && buf[0] == 0xca &&104 buf[1] == 0xca && buf[2] == 'C' && buf[3] == 'V')104 if(len >= 4 && str[0] == 0xca && 105 str[1] == 0xca && str[2] == 'C' && str[3] == 'V') 105 106 return import_caca(cv, buf, len); 106 107 107 108 /* If we find ESC[ argv, we guess it's an ANSI file */ 108 109 for(i = 0; i + 1 < len; i++) 109 if(( buf[i] == 0x1b) && (buf[i + 1] == '['))110 if((str[i] == 0x1b) && (str[i + 1] == '[')) 110 111 return import_ansi(cv, buf, len, 0); 111 112
Note: See TracChangeset
for help on using the changeset viewer.