pupa-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

libc-like functions


From: Yoshinori K. Okuji
Subject: libc-like functions
Date: Tue, 06 Aug 2002 03:10:52 +0900
User-agent: Wanderlust/2.8.1 (Something) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (Unebigoryƍmae) APEL/10.3 Emacs/21.2 (i386-debian-linux-gnu) MULE/5.0 (SAKAKI)

You may assume that these functions will be available to start
implementing i18n support:

void *pupa_malloc (pupa_size_t size);
void *pupa_realloc (void *ptr, pupa_size_t newsize);
void pupa_free (void *ptr);
int pupa_isspace (int c);
int pupa_isprint (int c);
pupa_size_t pupa_strlen (const char *s);
char *pupa_strcpy (char *to, const char *from);
char *pupa_strdup (const char *s);
int pupa_strcmp (const char *s1, const char *s2);
int pupa_strncmp (const char *s1, const char *s2);
char *pupa_strchr (const char *string, int c);
char *pupa_strstr (const char *haystack, const char *needle);
void *pupa_memmove (void *to, const void *from, pupa_size_t size);
void *pupa_memset (void *block, int c, pupa_size_t size);
int pupa_memcmp (const void *a1, const void *a2, pupa_size_t size);

int pupa_open (const char *filename);
pupa_ssize_t pupa_read (int fd, void *buf, pupa_size_t count);
pupa_off_t pupa_lseek (int fd, pupa_off_t offset, int whence);
int pupa_close (int fd);

I think the mapping between these functions and libc's would be
trivial. If you need more libc-like functions, feel free to add them
into the list.

Probably you will need functions for manipulating the screen as
well. Although I haven't decided what name is appropriate or what
interface is good yet, use something like these at the moment:

void pupa_put_pixel (unsigned x, unsigned y, pupa_color_t color);
pupa_color_t pupa_get_color (unsigned red, unsigned green, unsigned blue);
unsigned pupa_get_screen_width (void);
unsigned pupa_get_screen_height (void);

I guess you can simulate these functions on X Windows System with
little difficulty.

Cheers,
Okuji



reply via email to

[Prev in Thread] Current Thread [Next in Thread]