Enlightenment CVS committal Author : mej Project : eterm Module : libast
Dir : eterm/libast/include/libast Modified Files: mbuff.h str.h ustr.h Log Message: Tue Apr 25 10:19:10 2006 Michael Jennings (mej) Added sprintf() routines for string classes. Began work on UTF-8/Unicode strings. ---------------------------------------------------------------------- =================================================================== RCS file: /cvs/e/eterm/libast/include/libast/mbuff.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- mbuff.h 15 Dec 2004 00:00:21 -0000 1.1 +++ mbuff.h 25 Apr 2006 15:18:41 -0000 1.2 @@ -68,6 +68,7 @@ #define SPIF_MBUFF_RINDEX(o, x) SPIF_CAST(memidx) (SPIF_OBJ_CALL_METHOD((o), rindex)(o, x)) #define SPIF_MBUFF_SPLICE(o, n1, n2, x) SPIF_CAST(bool) (SPIF_OBJ_CALL_METHOD((o), splice)(o, n1, n2, x)) #define SPIF_MBUFF_SPLICE_FROM_PTR(o, n1, n2, x) SPIF_CAST(bool) (SPIF_OBJ_CALL_METHOD((o), splice_from_ptr)(o, n1, n2, x)) +#define SPIF_MBUFF_SPRINTF(x) SPIF_CAST(bool) (SPIF_STR_CALL_METHOD((o), sprintf) x) #define SPIF_MBUFF_SUBBUFF(o, n1, n2) SPIF_CAST(mbuff) (SPIF_OBJ_CALL_METHOD((o), subbuff)(o, n1, n2)) #define SPIF_MBUFF_SUBBUFF_TO_PTR(o, n1, n2) SPIF_CAST(byteptr) (SPIF_OBJ_CALL_METHOD((o), subbuff_to_ptr)(o, n1, n2)) #define SPIF_MBUFF_TRIM(o) SPIF_CAST(bool) (SPIF_OBJ_CALL_METHOD((o), trim)(o)) @@ -111,6 +112,7 @@ spif_func_t rindex; spif_func_t splice; spif_func_t splice_from_ptr; + spif_func_t sprintf; spif_func_t subbuff; spif_func_t subbuff_to_ptr; spif_func_t trim; @@ -151,6 +153,7 @@ extern spif_memidx_t spif_mbuff_rindex(spif_mbuff_t, spif_uint8_t); extern spif_bool_t spif_mbuff_splice(spif_mbuff_t, spif_memidx_t, spif_memidx_t, spif_mbuff_t); extern spif_bool_t spif_mbuff_splice_from_ptr(spif_mbuff_t, spif_memidx_t, spif_memidx_t, spif_byteptr_t, spif_memidx_t); +extern spif_bool_t spif_mbuff_sprintf(spif_mbuff_t, spif_charptr_t, ...); extern spif_mbuff_t spif_mbuff_subbuff(spif_mbuff_t, spif_memidx_t, spif_memidx_t); extern spif_byteptr_t spif_mbuff_subbuff_to_ptr(spif_mbuff_t, spif_memidx_t, spif_memidx_t); extern spif_bool_t spif_mbuff_trim(spif_mbuff_t); =================================================================== RCS file: /cvs/e/eterm/libast/include/libast/str.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- str.h 15 Dec 2004 00:00:21 -0000 1.20 +++ str.h 25 Apr 2006 15:18:41 -0000 1.21 @@ -73,6 +73,7 @@ #define SPIF_STR_RINDEX(o, x) SPIF_CAST(stridx) (SPIF_STR_CALL_METHOD((o), rindex)(o, x)) #define SPIF_STR_SPLICE(o, n1, n2, x) SPIF_CAST(bool) (SPIF_STR_CALL_METHOD((o), splice)(o, n1, n2, x)) #define SPIF_STR_SPLICE_FROM_PTR(o, n1, n2, x) SPIF_CAST(bool) (SPIF_STR_CALL_METHOD((o), splice_from_ptr)(o, n1, n2, x)) +#define SPIF_STR_SPRINTF(x) SPIF_CAST(bool) (SPIF_STR_CALL_METHOD((o), sprintf) x) #define SPIF_STR_SUBSTR(o, n1, n2) SPIF_CAST(str) (SPIF_STR_CALL_METHOD((o), substr)(o, n1, n2)) #define SPIF_STR_SUBSTR_TO_PTR(o, n1, n2) SPIF_CAST(charptr) (SPIF_STR_CALL_METHOD((o), substr_to_ptr)(o, n1, n2)) #define SPIF_STR_TO_FLOAT(o) SPIF_CAST_C(double) (SPIF_STR_CALL_METHOD((o), to_float)(o)) @@ -128,6 +129,7 @@ spif_func_t rindex; spif_func_t splice; spif_func_t splice_from_ptr; + spif_func_t sprintf; spif_func_t substr; spif_func_t substr_to_ptr; spif_func_t to_float; @@ -180,6 +182,7 @@ extern spif_stridx_t spif_str_rindex(spif_str_t, spif_char_t); extern spif_bool_t spif_str_splice(spif_str_t, spif_stridx_t, spif_stridx_t, spif_str_t); extern spif_bool_t spif_str_splice_from_ptr(spif_str_t, spif_stridx_t, spif_stridx_t, spif_charptr_t); +extern spif_bool_t spif_str_sprintf(spif_str_t, spif_charptr_t, ...); extern spif_str_t spif_str_substr(spif_str_t, spif_stridx_t, spif_stridx_t); extern spif_charptr_t spif_str_substr_to_ptr(spif_str_t, spif_stridx_t, spif_stridx_t); extern double spif_str_to_float(spif_str_t); =================================================================== RCS file: /cvs/e/eterm/libast/include/libast/ustr.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ustr.h 20 Apr 2006 21:44:40 -0000 1.2 +++ ustr.h 25 Apr 2006 15:18:41 -0000 1.3 @@ -24,6 +24,20 @@ #ifndef _LIBAST_USTR_H_ #define _LIBAST_USTR_H_ +#define SPIF_UTF8_CHAR_LEN(s) ((((SPIF_CAST(uchar) (*(s))) & 0x80) == 0x00) \ + ? (1) \ + : ((((SPIF_CAST(uchar) (*(s))) & 0xc0) == 0x80) \ + ? (2) \ + : ((((SPIF_CAST(uchar) (*(s))) & 0xe0) == 0xc0) \ + ? (3) \ + : ((((SPIF_CAST(uchar) (*(s))) & 0xf0) == 0xe0) \ + ? (4) \ + : ((((SPIF_CAST(uchar) (*(s))) & 0xf8) == 0xf0) \ + ? (5) \ + : ((((SPIF_CAST(uchar) (*(s))) & 0xfc) == 0xf8) \ + ? (6) \ + : (0))))))) + #define SPIF_USTR(obj) ((spif_ustr_t) (obj)) #define SPIF_OBJ_IS_USTR(obj) (SPIF_OBJ_IS_TYPE(obj, ustr)) #define SPIF_USTR_ISNULL(s) SPIF_OBJ_ISNULL(SPIF_OBJ(s)) @@ -70,6 +84,7 @@ #define SPIF_USTR_RINDEX(o, x) SPIF_CAST(stridx) (SPIF_OBJ_CALL_METHOD((o), rindex)(o, x)) #define SPIF_USTR_SPLICE(o, n1, n2, x) SPIF_CAST(bool) (SPIF_OBJ_CALL_METHOD((o), splice)(o, n1, n2, x)) #define SPIF_USTR_SPLICE_FROM_PTR(o, n1, n2, x) SPIF_CAST(bool) (SPIF_OBJ_CALL_METHOD((o), splice_from_ptr)(o, n1, n2, x)) +#define SPIF_USTR_SPRINTF(x) SPIF_CAST(bool) (SPIF_STR_CALL_METHOD((o), sprintf) x) #define SPIF_USTR_SUBSTR(o, n1, n2) SPIF_CAST(ustr) (SPIF_OBJ_CALL_METHOD((o), substr)(o, n1, n2)) #define SPIF_USTR_SUBSTR_TO_PTR(o, n1, n2) SPIF_CAST(charptr) (SPIF_OBJ_CALL_METHOD((o), substr_to_ptr)(o, n1, n2)) #define SPIF_USTR_TO_FLOAT(o) SPIF_CAST_C(double) (SPIF_OBJ_CALL_METHOD((o), to_float)(o)) @@ -134,6 +149,7 @@ extern spif_ustridx_t spif_ustr_rindex(spif_ustr_t, spif_char_t); extern spif_bool_t spif_ustr_splice(spif_ustr_t, spif_ustridx_t, spif_ustridx_t, spif_ustr_t); extern spif_bool_t spif_ustr_splice_from_ptr(spif_ustr_t, spif_ustridx_t, spif_ustridx_t, spif_charptr_t); +extern spif_bool_t spif_ustr_sprintf(spif_ustr_t, spif_charptr_t, ...); extern spif_ustr_t spif_ustr_substr(spif_ustr_t, spif_ustridx_t, spif_ustridx_t); extern spif_charptr_t spif_ustr_substr_to_ptr(spif_ustr_t, spif_ustridx_t, spif_ustridx_t); extern double spif_ustr_to_float(spif_ustr_t); ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs