Changeset f2b8cdc in mainline for uspace/lib/libc/include


Ignore:
Timestamp:
2009-04-04T22:04:28Z (17 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b27eb71
Parents:
4527fb5
Message:

Copy printf with Unicode support to userspace.

Location:
uspace/lib/libc/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/include/io/printf_core.h

    r4527fb5 rf2b8cdc  
    4040
    4141/** Structure for specifying output methods for different printf clones. */
    42 struct printf_spec {
    43         /* Output function, returns count of printed characters or EOF */
    44         int (*write)(void *, size_t, void *);
    45         /* Support data - output stream specification, its state, locks,... */
     42typedef struct printf_spec {
     43        /* String output function, returns number of printed characters or EOF */
     44        int (*str_write)(const char *, size_t, void *);
     45       
     46        /* Wide string output function, returns number of printed characters or EOF */
     47        int (*wstr_write)(const wchar_t *, size_t, void *);
     48       
     49        /* User data - output stream specification, state, locks, etc. */
    4650        void *data;
     51} printf_spec_t;
    4752
    48 };
    49 
    50 int printf_core(const char *fmt, struct printf_spec *ps ,va_list ap);
     53int printf_core(const char *fmt, printf_spec_t *ps, va_list ap);
    5154
    5255#endif
  • uspace/lib/libc/include/string.h

    r4527fb5 rf2b8cdc  
    4242#define U_SPECIAL      '?'
    4343
     44/**< No size limit constant */
     45#define STR_NO_LIMIT  ((size_t) -1)
     46
     47/**< Maximum size of a string containing cnt characters */
     48#define STR_BOUNDS(cnt)  (cnt << 2)
     49
    4450extern wchar_t str_decode(const char *str, size_t *offset, size_t sz);
    4551extern int chr_encode(const wchar_t ch, char *str, size_t *offset, size_t sz);
    4652
    47 extern bool chr_check(const wchar_t ch);
     53extern size_t str_size(const char *str);
     54extern size_t wstr_size(const wchar_t *str);
     55
     56extern size_t str_lsize(const char *str, count_t max_len);
     57extern size_t wstr_lsize(const wchar_t *str, count_t max_len);
     58
     59extern count_t str_length(const char *str);
     60extern count_t wstr_length(const wchar_t *wstr);
     61
     62extern count_t str_nlength(const char *str, size_t size);
     63extern count_t wstr_nlength(const wchar_t *str, size_t size);
     64
     65extern bool ascii_check(wchar_t ch);
     66extern bool chr_check(wchar_t ch);
     67
     68extern int str_cmp(const char *s1, const char *s2);
     69extern int str_lcmp(const char *s1, const char *s2, count_t max_len);
     70
     71extern void str_ncpy(char *dst, const char *src, size_t size);
     72extern void wstr_nstr(char *dst, const wchar_t *src, size_t size);
     73
     74extern const char *str_chr(const char *str, wchar_t ch);
     75
     76extern bool wstr_linsert(wchar_t *str, wchar_t ch, count_t pos, count_t max_pos);
     77extern bool wstr_remove(wchar_t *str, count_t pos);
     78
     79/*
     80 * TODO: Get rid of this.
     81 */
    4882
    4983extern int strcmp(const char *, const char *);
  • uspace/lib/libc/include/sys/types.h

    r4527fb5 rf2b8cdc  
    3838#include <libarch/types.h>
    3939
    40 typedef unsigned long size_t;
    41 typedef signed long ssize_t;
    4240typedef long off_t;
    4341typedef int mode_t;
Note: See TracChangeset for help on using the changeset viewer.