/* function pointers */
void *(*_pico_ptr_malloc )( size_t ) = malloc;
void (*_pico_ptr_free )( void* ) = free;
-void (*_pico_ptr_load_file )( char*, unsigned char**, int* ) = NULL;
+void (*_pico_ptr_load_file )( const char*, unsigned char**, int* ) = NULL;
void (*_pico_ptr_free_file )( void* ) = NULL;
void (*_pico_ptr_print )( int, const char* ) = NULL;
/* _pico_load_file:
* wrapper around the loadfile function pointer
*/
-void _pico_load_file( char *name, unsigned char **buffer, int *bufSize )
+void _pico_load_file( const char *name, unsigned char **buffer, int *bufSize )
{
/* sanity checks */
if( name == NULL )
if( !str || !*str )
return;
while( *str && !isspace( *str ) )
- *str++;
+ str++;
*str = '\0';
}
/* _pico_stristr:
* case-insensitive strstr. -sea
*/
-char *_pico_stristr( char *str, const char *substr )
+const char *_pico_stristr( const char *str, const char *substr )
{
const size_t sublen = strlen(substr);
while (*str)
/* _pico_new_parser:
* allocates a new ascii parser object.
*/
-picoParser_t *_pico_new_parser( picoByte_t *buffer, int bufSize )
+picoParser_t *_pico_new_parser( const picoByte_t *buffer, int bufSize )
{
picoParser_t *p;
return NULL;
}
/* setup */
- p->buffer = buffer;
- p->cursor = buffer;
+ p->buffer = (const char *) buffer;
+ p->cursor = (const char *) buffer;
p->bufSize = bufSize;
p->max = p->buffer + bufSize;
p->curLine = 1; /* sea: new */
int _pico_parse_ex( picoParser_t *p, int allowLFs, int handleQuoted )
{
int hasLFs = 0;
- char *old;
+ const char *old;
/* sanity checks */
if( p == NULL || p->buffer == NULL ||
/* _pico_new_memstream:
* allocates a new memorystream object.
*/
-picoMemStream_t *_pico_new_memstream( picoByte_t *buffer, int bufSize )
+picoMemStream_t *_pico_new_memstream( const picoByte_t *buffer, int bufSize )
{
picoMemStream_t *s;