]> git.pld-linux.org Git - packages/ekg2.git/blob - ekg2-missing-xwcslen.patch
- jabber plugin also handles tlen (updated subpackage descriptions)
[packages/ekg2.git] / ekg2-missing-xwcslen.patch
1 --- ekg2-0.1.1/plugins/ncurses/old.c~   2007-02-25 18:10:22.000000000 +0100
2 +++ ekg2-0.1.1/plugins/ncurses/old.c    2008-11-19 13:21:40.000000000 +0100
3 @@ -53,6 +53,7 @@
4  
5  #include <ekg/queries.h>
6  
7 +#include "ecurses.h"
8  #include "old.h"
9  #include "completion.h"
10  #include "bindings.h"
11 --- ekg2-0.1.1/plugins/ncurses/ecurses.c~       2006-09-23 13:32:45.000000000 +0200
12 +++ ekg2-0.1.1/plugins/ncurses/ecurses.c        2008-11-19 13:29:28.528990771 +0100
13 @@ -45,37 +45,37 @@
14  #define fix(x) ((char *) x ? (char *) x : (char *) "")
15  #define ufix(x)        ((wchar_t *) x ? (wchar_t *) x : (wchar_t *) L"")
16  
17 -inline int xwcslen(CHAR_T *str) {
18 + int xwcslen(CHAR_T *str) {
19         if (config_use_unicode) return wcslen((wchar_t *) ufix(str));
20         else                    return strlen((char *) fix(str));
21  }
22  
23 -inline CHAR_T *xwcscpy(CHAR_T *dst, CHAR_T *src) {
24 + CHAR_T *xwcscpy(CHAR_T *dst, CHAR_T *src) {
25         if (config_use_unicode) return (CHAR_T *) wcscpy((wchar_t *) ufix(dst), (wchar_t *) ufix(src));
26         else                    return (CHAR *) strcpy((char *) fix(dst), (char *) fix(src));
27  }
28  
29 -inline CHAR_T *xwcsdup(CHAR_T *str) {
30 + CHAR_T *xwcsdup(CHAR_T *str) {
31         if (!str) return NULL;
32         return xmemdup(str, (xwcslen(str)+1) * sizeof(CHAR_T));
33  }
34  
35 -inline CHAR_T *xwcscat(CHAR_T *dst, const CHAR_T *src) {
36 + CHAR_T *xwcscat(CHAR_T *dst, const CHAR_T *src) {
37         if (config_use_unicode) return (CHAR_T *) wcscat((wchar_t *) ufix(dst), (wchar_t *) ufix(src));
38         else                    return (CHAR *) strcat((char *) dst, (char *) src);
39  }
40  
41 -inline int xwcscmp(const CHAR_T *s1, const CHAR_T *s2) {
42 + int xwcscmp(const CHAR_T *s1, const CHAR_T *s2) {
43         if (config_use_unicode) return wcscmp((wchar_t *) ufix(s1), (wchar_t *) ufix(s2));
44         else                    return strcmp((char *) fix(s1), (char *) fix(s2));
45  }
46  
47 -inline CHAR_T *xwcschr(const CHAR_T *s, CHAR_T c) {
48 + CHAR_T *xwcschr(const CHAR_T *s, CHAR_T c) {
49         if (config_use_unicode) return (CHAR_T *) wcschr((wchar_t *) ufix(s), (wchar_t) ufix(c));
50         else                    return (CHAR *) strchr((char *) fix(s), (char) c);
51  }
52  
53 -inline char *wcs_to_normal(const CHAR_T *str) {
54 + char *wcs_to_normal(const CHAR_T *str) {
55         if (!str) return NULL;
56         if (config_use_unicode) {
57                 int len         = wcstombs(NULL, (wchar_t *) str,0);
58 @@ -88,7 +88,7 @@
59         } else  return (char *) str;
60  }
61  
62 -inline CHAR_T *normal_to_wcs(const char *str) {
63 + CHAR_T *normal_to_wcs(const char *str) {
64         if (!str) return NULL;
65         if (config_use_unicode) {
66                 int len = mbstowcs(NULL, str, 0)+1;
67 @@ -98,7 +98,7 @@
68         } else  return (CHAR_T *) str;
69  }
70  
71 -inline CHAR_T **wcs_array_make(const CHAR_T *string, const CHAR_T *sep, int max, int trim, int quotes) {
72 + CHAR_T **wcs_array_make(const CHAR_T *string, const CHAR_T *sep, int max, int trim, int quotes) {
73         if (config_use_unicode) {
74                 char *str = wcs_to_normal(string);
75                 char *sp  = wcs_to_normal(sep);
76 @@ -120,7 +120,7 @@
77         } else  return (CHAR **) array_make((char *) string, (char *) sep, max, trim, quotes);
78  }
79  
80 -inline size_t xwcslcpy(CHAR_T *dst, const CHAR_T *src, size_t size) {
81 + size_t xwcslcpy(CHAR_T *dst, const CHAR_T *src, size_t size) {
82         if (config_use_unicode) {
83                 /* copied from strlcpy.c (c Piotr Domagalski) */
84                 register size_t i, n = size;
85 @@ -138,7 +138,7 @@
86         } else return strlcpy((char *) dst, (char *) src, size);
87  }
88  
89 -inline CHAR_T *wcs_array_join(CHAR_T **array, const CHAR_T *sep) {
90 + CHAR_T *wcs_array_join(CHAR_T **array, const CHAR_T *sep) {
91         if (config_use_unicode) {
92                 char **arr;
93                 char *sp = wcs_to_normal(sep);
94 --- ekg2-0.1.1/plugins/ncurses/ecurses.h~       2006-12-18 09:21:41.000000000 +0100
95 +++ ekg2-0.1.1/plugins/ncurses/ecurses.h        2008-11-19 13:29:39.028100223 +0100
96 @@ -52,33 +52,33 @@
97  
98  #define __S(str, i) (CHAR_T) (config_use_unicode ? ((wchar_t *) str)[i] : ((unsigned char *) str)[i]) 
99  
100 -static inline CHAR_T *__SPTR(CHAR_T *str, int offset) { /* #define __SPTR(str, i) (CHAR_T *) (config_use_unicode ? &((wchar_t *) str[i]) : &((unsigned char *) str)[i]) */
101 +static  CHAR_T *__SPTR(CHAR_T *str, int offset) { /* #define __SPTR(str, i) (CHAR_T *) (config_use_unicode ? &((wchar_t *) str[i]) : &((unsigned char *) str)[i]) */
102         if (config_use_unicode) return (CHAR_T *) (str + offset);
103         else                    return (CHAR_T *) (((char *) str) + offset);
104  }
105  
106 -static inline void __SREP(CHAR_T *str, int offset, CHAR_T newchar) {
107 +static  void __SREP(CHAR_T *str, int offset, CHAR_T newchar) {
108         if (config_use_unicode) (*__SPTR(str, offset)) = newchar;
109         else                    (* ((char *) __SPTR(str, offset))) = newchar;
110  }
111  
112 -static inline CHAR_T *__SN(CHAR_T **str, int offset) { /* #define __SN(str) (CHAR_T) (config_use_unicode ? ((wchar_t *) str)++ : ((unsigned char *) str)++) */
113 +static  CHAR_T *__SN(CHAR_T **str, int offset) { /* #define __SN(str) (CHAR_T) (config_use_unicode ? ((wchar_t *) str)++ : ((unsigned char *) str)++) */
114         if (config_use_unicode) return (CHAR_T *) ((*str) += offset);
115         else                    return (CHAR_T *) ((*((char **) str)) += offset);
116  }
117  #define free_utf(ptr)  do { if (ptr && config_use_unicode) free(ptr); } while(0)
118  
119 -inline int xwcslen(CHAR_T *str);
120 -inline CHAR_T *xwcscpy(CHAR_T *dst, CHAR_T *src);
121 -inline CHAR_T *xwcsdup(CHAR_T *str);
122 -inline CHAR_T *xwcscat(CHAR_T *dst, const CHAR_T *src);
123 -inline int xwcscmp(const CHAR_T *s1, const CHAR_T *s2);
124 -inline CHAR_T *xwcschr(const CHAR_T *s, CHAR_T c);
125 -inline char *wcs_to_normal(const CHAR_T *str);
126 -inline CHAR_T *normal_to_wcs(const char *str);
127 -inline CHAR_T **wcs_array_make(const CHAR_T *string, const CHAR_T *sep, int max, int trim, int quotes);
128 -inline CHAR_T *wcs_array_join(CHAR_T **array, const CHAR_T *sep);
129 -inline size_t xwcslcpy(CHAR_T *dst, const CHAR_T *src, size_t size);
130 + int xwcslen(CHAR_T *str);
131 + CHAR_T *xwcscpy(CHAR_T *dst, CHAR_T *src);
132 + CHAR_T *xwcsdup(CHAR_T *str);
133 + CHAR_T *xwcscat(CHAR_T *dst, const CHAR_T *src);
134 + int xwcscmp(const CHAR_T *s1, const CHAR_T *s2);
135 + CHAR_T *xwcschr(const CHAR_T *s, CHAR_T c);
136 + char *wcs_to_normal(const CHAR_T *str);
137 + CHAR_T *normal_to_wcs(const char *str);
138 + CHAR_T **wcs_array_make(const CHAR_T *string, const CHAR_T *sep, int max, int trim, int quotes);
139 + CHAR_T *wcs_array_join(CHAR_T **array, const CHAR_T *sep);
140 + size_t xwcslcpy(CHAR_T *dst, const CHAR_T *src, size_t size);
141  
142  #else  /* USE_UNICODE */
143  #define CHAR_T unsigned char
This page took 0.039988 seconds and 3 git commands to generate.