Changeset 754
- Timestamp:
- Sep 30, 2003, 12:11:05 AM (22 years ago)
- Location:
- trunk/src/emx/src
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/src/lib/iconv/iconv.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r753 r754 1 1 /* iconv wrapper based on OS/2 Unicode API. */ 2 2 3 #define INCL_FSMACROS 4 #include <os2emx.h> 3 5 #include <uconv.h> 4 6 … … 27 29 iconv_t conv; 28 30 uconv_attribute_t attr; 31 FS_VAR(); 29 32 30 33 conv = (iconv_t) malloc (sizeof (struct _iconv_t)); … … 35 38 } 36 39 40 FS_SAVE_LOAD(); 37 41 ucp = (UniChar *) alloca ((strlen (cp_from) + 2 + 1) * sizeof (UniChar)); 38 42 __convert_codepage (cp_from, ucp); … … 41 45 free (conv); 42 46 errno = EINVAL; 47 FS_RESTORE(); 43 48 return (iconv_t)(-1); 44 49 } … … 51 56 free (conv); 52 57 errno = EINVAL; 58 FS_RESTORE(); 53 59 return (iconv_t)(-1); 54 60 } … … 64 70 UniSetUconvObject (conv->from, &attr); 65 71 72 FS_RESTORE(); 66 73 return conv; 67 74 } … … 77 84 UniChar *orig_ucs = ucs; 78 85 size_t retval = 0; 86 FS_VAR(); 79 87 88 FS_SAVE_LOAD(); 80 89 rc = UniUconvToUcs (conv->from, (void **)in, in_left, &ucs, &sl, &retval); 81 90 if (rc) … … 108 117 } 109 118 #endif 119 FS_RESTORE(); 110 120 return 0; 111 121 … … 127 137 break; 128 138 } 139 FS_RESTORE(); 129 140 return (size_t)(-1); 130 141 } … … 135 146 if (conv != (iconv_t)(-1)) 136 147 { 148 FS_VAR(); 149 FS_SAVE_LOAD(); 137 150 UniFreeUconvObject (conv->to); 138 151 UniFreeUconvObject (conv->from); 152 FS_RESTORE(); 139 153 free (conv); 140 154 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/eadread.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r753 r754 4 4 #define INCL_DOSFILEMGR 5 5 #define INCL_DOSERRORS 6 #define INCL_FSMACROS 6 7 #include <os2.h> 7 8 #include <stdlib.h> … … 65 66 struct gea_data gd; 66 67 EAOP2 eaop; 68 FS_VAR(); 67 69 68 70 _ead_clear (ead); … … 99 101 eaop.fpFEA2List = ead->buffer; 100 102 eaop.oError = 0; 103 FS_SAVE_LOAD(); 101 104 if (path == NULL) 102 105 rc = DosQueryFileInfo (handle, FIL_QUERYEASFROMLIST, &eaop, … … 105 108 rc = DosQueryPathInfo (path, FIL_QUERYEASFROMLIST, &eaop, 106 109 sizeof (eaop)); 110 FS_RESTORE(); 107 111 if (rc != 0) 108 112 { … … 138 142 PDENA2 pdena; 139 143 int expand_dena_buf; 144 FS_VAR(); 140 145 141 146 if (path != NULL) … … 165 170 } 166 171 count = -1; 172 FS_SAVE_LOAD(); 167 173 rc = DosEnumAttribute (reftype, fileref, index, 168 174 dena_buf, dena_buf_size, &count, 169 175 ENUMEA_LEVEL_NO_VALUE); 176 FS_RESTORE(); 170 177 if (rc == ERROR_BUFFER_OVERFLOW) 171 178 expand_dena_buf = 1; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/eaget.c
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r753 r754 3 3 #include "libc-alias.h" 4 4 #define INCL_DOSFILEMGR 5 #define INCL_FSMACROS 5 6 #include <os2.h> 6 7 #include <stdlib.h> … … 23 24 PFEA2 pfea; 24 25 int len, size; 26 FS_VAR(); 25 27 26 28 dst->flags = 0; … … 52 54 eaop.fpFEA2List = pfealist; 53 55 eaop.oError = 0; 56 FS_SAVE_LOAD(); 54 57 if (path == NULL) 55 58 rc = DosQueryFileInfo (handle, FIL_QUERYEASFROMLIST, &eaop, … … 58 61 rc = DosQueryPathInfo (path, FIL_QUERYEASFROMLIST, &eaop, 59 62 sizeof (eaop)); 63 FS_RESTORE(); 60 64 if (rc != 0) 61 65 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/eawrite.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r753 r754 3 3 #include "libc-alias.h" 4 4 #define INCL_DOSFILEMGR 5 #define INCL_FSMACROS 5 6 #include <os2.h> 6 7 #include <stdlib.h> … … 11 12 ULONG rc; 12 13 EAOP2 eaop; 14 FS_VAR(); 13 15 14 16 eaop.fpGEA2List = NULL; 15 17 eaop.fpFEA2List = src; 16 18 eaop.oError = 0; 19 FS_SAVE_LOAD(); 17 20 if (path != NULL) 18 21 rc = DosSetPathInfo (path, 2, &eaop, sizeof (eaop), 0); 19 22 else 20 23 rc = DosSetFileInfo (handle, 2, &eaop, sizeof (eaop)); 24 FS_RESTORE(); 21 25 if (rc != 0) 22 26 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/locale/__do_uni.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r753 r754 10 10 */ 11 11 12 #define INCL_FSMACROS 13 #include <os2emx.h> 12 14 #include <uconv.h> 13 15 #include <alloca.h> … … 25 27 UniChar *ucsbuf; 26 28 size_t in_left, out_left, nonid; 29 FS_VAR(); 30 FS_SAVE_LOAD(); 27 31 28 32 /* Allocate strings up to 2000 characters on the stack */ … … 53 57 if (free_ucs) 54 58 free (ucs); 59 FS_RESTORE(); 55 60 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/locale/__from_ucs.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r753 r754 9 9 */ 10 10 11 #define INCL_FSMACROS 12 #include <os2emx.h> 11 13 #include <uconv.h> 12 14 … … 17 19 void *outbuf = sbcs; 18 20 size_t nonid, in_left = 1, out_left = len; 21 int rc; 22 FS_VAR(); 19 23 20 if (UniUconvFromUcs (uconv_obj, &inbuf, &in_left, &outbuf, &out_left, &nonid) 21 || nonid || in_left) 24 FS_SAVE_LOAD(); 25 rc = UniUconvFromUcs (uconv_obj, &inbuf, &in_left, &outbuf, &out_left, &nonid); 26 FS_RESTORE(); 27 if (rc || nonid || in_left) 22 28 return 0; 23 29 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/locale/__to_ucs.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r753 r754 9 9 */ 10 10 11 #define INCL_FSMACROS 12 #include <os2emx.h> 11 13 #include <uconv.h> 12 14 … … 17 19 UniChar *outbuf = ucs; 18 20 size_t nonid, in_left = len, out_left = 1; 21 int ret; 22 FS_VAR(); 19 23 20 int ret = UniUconvToUcs (uconv_obj, &inbuf, &in_left, &outbuf, &out_left, 24 FS_SAVE_LOAD(); 25 ret = UniUconvToUcs (uconv_obj, &inbuf, &in_left, &outbuf, &out_left, 21 26 &nonid); 27 FS_RESTORE(); 22 28 23 29 if ((ret && (ret != ULS_BUFFERFULL)) || nonid || out_left) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/locale/setlocale.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r753 r754 22 22 23 23 #define INCL_DOS 24 #include <os2.h> 24 #define INCL_FSMACROS 25 #include <os2emx.h> 25 26 #include <unidef.h> 26 27 #include <uconv.h> … … 58 59 void *outbuf = tmp; 59 60 int try_count = 0; 60 61 FS_VAR(); 62 63 FS_SAVE_LOAD(); 61 64 try_again: 62 65 63 66 if (try_count > 10) 64 /* Well... nobody will say we gave it no chance ... */ 65 return -1; 67 { 68 /* Well... nobody will say we gave it no chance ... */ 69 free(tmp); 70 FS_RESTORE(); 71 return -1; 72 } 66 73 67 74 switch (UniUconvFromUcs (uconv_obj, &inbuf, &in_left, &outbuf, &out_left, &nonid)) … … 81 88 /* Unexpected error. */ 82 89 free (tmp); 90 FS_RESTORE(); 83 91 return -1; 84 92 } … … 88 96 memcpy (*out, tmp, usl); 89 97 free (tmp); 98 FS_RESTORE(); 90 99 91 100 return 0; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/mbyte/mbstowcs.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r753 r754 9 9 character sequence starts in the initial shift state. At most n codes 10 10 are stored to pwcs. pwcs will be terminated with a code of value zero 11 if n is big enough. 11 if n is big enough. 12 12 13 The shift state of mbtowc() and mblen() is not affected. 13 The shift state of mbtowc() and mblen() is not affected. 14 14 15 15 mbstowcs() returns the number of codes stored to pwcs (excluding the … … 23 23 */ 24 24 25 #define INCL_FSMACROS 26 #include <os2emx.h> 25 27 #define __INTERNAL_DEFS 26 28 #include "libc-alias.h" … … 31 33 { 32 34 size_t nonid, sl = strlen (s) + 1, nw = n; 35 int rc; 36 FS_VAR(); 33 37 34 if (UniUconvToUcs (__locale_ctype.uconv, (void *)&s, &sl, &pwcs, 35 &nw, &nonid)) 38 FS_SAVE_LOAD(); 39 rc = UniUconvToUcs (__locale_ctype.uconv, (void *)&s, &sl, &pwcs, &nw, &nonid); 40 FS_RESTORE(); 41 if (rc) 36 42 return -1; 37 43 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/mbyte/mbtowc.c
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r753 r754 10 10 of more than n bytes is deemed invalid. 11 11 12 The shift state of mblen() is not affected. 12 The shift state of mblen() is not affected. 13 13 14 14 If s is NULL, mbtowc() returns a non-zero value (if state-dependent … … 25 25 */ 26 26 27 #define INCL_FSMACROS 28 #include <os2emx.h> 27 29 #define __INTERNAL_DEFS 28 30 #include "libc-alias.h" … … 34 36 size_t nonid, ni = n, no = 1; 35 37 int rc; 38 FS_VAR(); 36 39 37 40 if (!s) 38 41 return 0; /* No state dependency */ 39 42 43 FS_SAVE_LOAD(); 40 44 rc = UniUconvToUcs (__locale_ctype.uconv, (void *)&s, &ni, &pwc, &no, &nonid); 45 FS_RESTORE(); 41 46 42 47 if ((rc == 0) || (rc == UCONV_E2BIG)) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/mbyte/wcstombs.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r753 r754 10 10 s will be terminated with a null character if n is big enough. 11 11 12 The shift state of wctomb() is not affected. 12 The shift state of wctomb() is not affected. 13 13 14 14 wcstombs() returns the number of bytes stored to s (excluding the … … 22 22 */ 23 23 24 #define INCL_FSMACROS 25 #include <os2emx.h> 24 26 #define __INTERNAL_DEFS 25 27 #include "libc-alias.h" … … 30 32 { 31 33 size_t nonid, sl = UniStrlen (pwcs) + 1, nw = n; 34 int rc; 35 FS_VAR(); 32 36 33 if (UniUconvFromUcs (__locale_ctype.uconv, (UniChar **)&pwcs, &sl, 34 (void *)&s, &nw, &nonid)) 37 FS_SAVE_LOAD(); 38 rc = UniUconvFromUcs (__locale_ctype.uconv, (UniChar **)&pwcs, &sl, (void *)&s, &nw, &nonid); 39 FS_RESTORE(); 40 if (rc) 35 41 return -1; 36 42 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/mbyte/wctomb.c
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r753 r754 17 17 */ 18 18 19 #define INCL_FSMACROS 20 #include <os2emx.h> 19 21 #define __INTERNAL_DEFS 20 22 #include "libc-alias.h" … … 26 28 UniChar *ucs = &wchar; 27 29 size_t nonid, ni = 1, no = MB_CUR_MAX; 30 int rc; 31 FS_VAR(); 28 32 29 33 if (!s) 30 34 return 0; /* No state dependency */ 31 35 32 if (UniUconvFromUcs (__locale_ctype.uconv, &ucs, &ni, (void **)&s, &no, &nonid)) 36 FS_SAVE_LOAD(); 37 rc = UniUconvFromUcs (__locale_ctype.uconv, &ucs, &ni, (void **)&s, &no, &nonid); 38 FS_RESTORE(); 39 if (rc) 33 40 return -1; 34 41 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getvol.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r753 r754 8 8 #define INCL_DOSFILEMGR 9 9 #define INCL_DOSERRORS 10 #define INCL_FSMACROS 10 11 #include <os2emx.h> 11 12 … … 13 14 { 14 15 struct _thread *tp = _thread(); 16 FS_VAR(); 15 17 16 18 if (drive == 0) … … 25 27 26 28 memset (&fsinfo, 0, sizeof (fsinfo)); 29 FS_SAVE_LOAD(); 27 30 rc = DosQueryFSInfo (drive - 'A' + 1, FSIL_VOLSER, &fsinfo, 28 31 sizeof (fsinfo)); 32 FS_RESTORE(); 29 33 if (rc != 0) 30 34 return NULL; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/beginthr.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r753 r754 10 10 #define INCL_DOSERRORS 11 11 #define INCL_DOSEXCEPTIONS 12 #define INCL_FSMACROS 12 13 #include <os2emx.h> 13 14 … … 39 40 struct _thread *tp; 40 41 ULONG rc; 42 FS_VAR(); 41 43 44 FS_SAVE_LOAD(); 42 45 rc = DosAllocMem ((PPVOID)&tp, sizeof (struct _thread), 43 46 PAG_COMMIT|PAG_READ|PAG_WRITE); 47 FS_RESTORE(); 44 48 if (rc != 0) 45 49 return NULL; … … 66 70 TID tid; 67 71 struct _thread *tp; 72 FS_VAR(); 68 73 69 74 tp = __alloc_thread (); … … 75 80 tp->_th_start = start; 76 81 tp->_th_arg = arg_list; 82 FS_SAVE_LOAD(); 77 83 rc = DosCreateThread (&tid, (PFNTHREAD)start_thread, (ULONG)tp, 78 84 CREATE_SUSPENDED | STACK_COMMITTED, stack_size); … … 86 92 errno = EINVAL; 87 93 DosFreeMem (tp); 94 FS_RESTORE(); 88 95 return -1; 89 96 } … … 93 100 errno = EAGAIN; 94 101 DosFreeMem (tp); 102 FS_RESTORE(); 95 103 return -1; 96 104 } … … 99 107 DosKillThread (tid); 100 108 DosFreeMem (tp); 109 FS_RESTORE(); 101 110 return -1; 102 111 } … … 107 116 errno = ESRCH; 108 117 DosFreeMem (tp); 118 FS_RESTORE(); 109 119 return -1; 110 120 } 121 FS_RESTORE(); 111 122 return tid; 112 123 } … … 117 128 struct _thread *tp; 118 129 int tid; 130 FS_VAR(); 119 131 120 132 tid = _gettid (); 121 133 tp = _thread (); 134 FS_SAVE_LOAD(); 122 135 if (tp != &thread_1) 123 136 DosFreeMem (tp); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/fmutex.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r753 r754 5 5 #define INCL_DOSPROCESS 6 6 #define INCL_DOSERRORS 7 #define INCL_FSMACROS 7 8 #include <os2.h> 8 9 #include <stdlib.h> … … 16 17 unsigned _fmutex_create (_fmutex *sem, unsigned flags) 17 18 { 19 unsigned rc; 20 FS_VAR(); 18 21 sem->fs = _FMS_AVAILABLE; 19 return DosCreateEventSem (NULL, (PHEV)&sem->hev, 20 (flags & _FMC_SHARED) ? DC_SEM_SHARED : 0, 21 FALSE); 22 FS_SAVE_LOAD(); 23 rc = DosCreateEventSem (NULL, (PHEV)&sem->hev, 24 (flags & _FMC_SHARED) ? DC_SEM_SHARED : 0, 25 FALSE); 26 FS_RESTORE(); 27 return rc; 22 28 } 23 29 … … 25 31 unsigned _fmutex_open (_fmutex *sem) 26 32 { 27 return DosOpenEventSem (NULL, (PHEV)&sem->hev); 33 unsigned rc; 34 FS_VAR(); 35 FS_SAVE_LOAD(); 36 rc = DosOpenEventSem (NULL, (PHEV)&sem->hev); 37 FS_RESTORE(); 38 return rc; 28 39 } 29 40 … … 31 42 unsigned _fmutex_close (_fmutex *sem) 32 43 { 33 return DosCloseEventSem (sem->hev); 44 unsigned rc; 45 FS_VAR(); 46 FS_SAVE_LOAD(); 47 rc = DosCloseEventSem (sem->hev); 48 FS_RESTORE(); 49 return rc; 34 50 } 35 51 … … 55 71 for (;;) 56 72 { 73 FS_VAR(); 74 FS_SAVE_LOAD(); 57 75 rc = DosResetEventSem (sem->hev, &count); 76 FS_RESTORE(); 58 77 if (rc != 0 && rc != ERROR_ALREADY_RESET) 59 78 return rc; … … 62 81 do 63 82 { 83 FS_SAVE_LOAD(); 64 84 rc = DosWaitEventSem (sem->hev, SEM_INDEFINITE_WAIT); 85 FS_RESTORE(); 65 86 } while (rc == ERROR_INTERRUPT && (flags & _FMR_IGNINT)); 66 87 if (rc != 0) … … 73 94 { 74 95 ULONG rc; 96 FS_VAR(); 75 97 98 FS_SAVE_LOAD(); 76 99 rc = DosPostEventSem (sem->hev); 77 100 if (rc != 0 && rc != ERROR_ALREADY_POSTED) 78 return rc; 101 { 102 FS_RESTORE(); 103 return rc; 104 } 79 105 80 106 /* Give up our time slice to give other threads a chance. Without … … 122 148 123 149 DosSleep (0); 150 FS_RESTORE(); 124 151 return 0; 125 152 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/smutex.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r753 r754 3 3 #include "libc-alias.h" 4 4 #define INCL_DOSPROCESS 5 #define INCL_FSMACROS 5 6 #include <os2.h> 6 7 #include <sys/builtin.h> … … 10 11 void __smutex_request_internal (volatile _smutex *sem) 11 12 { 13 FS_VAR(); 14 FS_SAVE_LOAD(); 12 15 do 13 16 { 14 17 DosSleep (1); 15 18 } while (__cxchg (sem, 1) != 0); 19 FS_RESTORE(); 16 20 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/memicmp.c
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r753 r754 8 8 */ 9 9 10 #define INCL_FSMACROS 11 #include <os2emx.h> 10 12 #define __INTERNAL_DEFS 11 13 #include "libc-alias.h" … … 26 28 27 29 if (__locale_ctype.mbcs) 30 { 31 FS_VAR(); 32 FS_SAVE_LOAD(); 28 33 /* MBCS case. One additional memory lookup per character. */ 29 34 for (;;) … … 55 60 d = __locale_ctype.locase [c1] - __locale_ctype.locase [c2]; 56 61 if (d) 57 return d; 62 { 63 FS_RESTORE(); 64 return d; 65 } 58 66 if (!--len) 59 return 0; 67 { 68 FS_RESTORE(); 69 return 0; 70 } 60 71 c1 = *++s1; 61 72 c2 = *++s2; 62 73 } /* endfor */ 74 FS_RESTORE(); 75 } 63 76 else 64 77 /* SBCS case (faster). */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/strcoll.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r753 r754 10 10 */ 11 11 12 #define INCL_FSMACROS 13 #include <os2emx.h> 12 14 #define __INTERNAL_DEFS 13 15 #include "libc-alias.h" … … 23 25 24 26 if (__locale_collate.mbcs) 27 { 28 FS_VAR(); 29 FS_SAVE_LOAD(); 25 30 /* MBCS case. We compare the strings as usual, but as soon as we 26 31 encounter a MBCS character we translate the rests of the strings … … 49 54 /* Oops, something bad happened (invalid character code). Suppose 50 55 the string that caused the fault is "less" than the other */ 56 FS_RESTORE(); 51 57 return i * 2 - 1; 52 58 } … … 54 60 55 61 /* Okay, now we have two Unicode strings. Compare them. */ 56 return UniStrcoll (__locale_collate.locale, ucs [0], ucs [1]); 62 d = UniStrcoll (__locale_collate.locale, ucs [0], ucs [1]); 63 FS_RESTORE(); 64 return d; 57 65 } 58 66 59 67 d = __locale_collate.weight [c1] - __locale_collate.weight [c2]; 60 68 if (d || !c1 || !c2) 69 { 70 FS_RESTORE(); 61 71 return d; 72 } 62 73 c1 = *++s1; 63 74 c2 = *++s2; 64 75 } /* endfor */ 76 FS_RESTORE(); 77 } 65 78 else 66 79 /* SBCS case (faster). */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/stricmp.c
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r753 r754 8 8 */ 9 9 10 #define INCL_FSMACROS 11 #include <os2emx.h> 10 12 #define __INTERNAL_DEFS 11 13 #include "libc-alias.h" … … 28 30 29 31 if (__locale_ctype.mbcs) 32 { 33 FS_VAR(); 34 FS_SAVE_LOAD(); 30 35 /* MBCS case. One additional memory lookup per character. */ 31 36 for (;;) … … 57 62 58 63 if (d || !c1 || !c2) 64 { 65 FS_RESTORE(); 59 66 return d; 67 } 60 68 c1 = *++s1; 61 69 c2 = *++s2; 62 70 } /* endfor */ 71 FS_RESTORE(); 72 } 63 73 else 64 74 /* SBCS case (faster). */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/strlwr.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r753 r754 8 8 */ 9 9 10 #define INCL_FSMACROS 11 #include <os2emx.h> 10 12 #define __INTERNAL_DEFS 11 13 #include "libc-alias.h" … … 35 37 until the end to Unicode, do the work in Unicode and then 36 38 convert back to MBCS. */ 39 FS_VAR(); 40 FS_SAVE_LOAD(); 37 41 __do_Unicode (__locale_ctype.uconv, s, s, __uni_strlwr); 42 FS_RESTORE(); 38 43 break; 39 44 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/strnicmp.c
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r753 r754 9 9 */ 10 10 11 #define INCL_FSMACROS 12 #include <os2emx.h> 11 13 #define __INTERNAL_DEFS 12 14 #include "libc-alias.h" … … 25 27 26 28 if (__locale_ctype.mbcs) 29 { 30 FS_VAR(); 31 FS_SAVE_LOAD(); 27 32 /* MBCS case. One additional memory lookup per character. */ 28 33 for (;;) … … 54 59 d = __locale_ctype.locase [c1] - __locale_ctype.locase [c2]; 55 60 if (d || !c1 || !c2) 61 { 62 FS_RESTORE(); 56 63 return d; 64 } 57 65 if (!--len) 66 { 67 FS_RESTORE(); 58 68 return 0; 69 } 59 70 c1 = *++s1; 60 71 c2 = *++s2; 61 72 } /* endfor */ 73 FS_RESTORE(); 74 } 62 75 else 63 76 /* SBCS case (faster). */ … … 73 86 } /* endfor */ 74 87 75 /* This point never achieved */88 /* This point never reached */ 76 89 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/strupr.c
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r753 r754 8 8 */ 9 9 10 #define INCL_FSMACROS 11 #include <os2emx.h> 10 12 #define __INTERNAL_DEFS 11 13 #include "libc-alias.h" … … 35 37 until the end to Unicode, do the work in Unicode and then 36 38 convert back to MBCS. */ 39 FS_VAR(); 40 FS_SAVE_LOAD(); 37 41 __do_Unicode (__locale_ctype.uconv, s, s, __uni_strupr); 42 FS_RESTORE(); 38 43 break; 39 44 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/strxfrm.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r753 r754 10 10 */ 11 11 12 #define INCL_FSMACROS 13 #include <os2emx.h> 12 14 #define __INTERNAL_DEFS 13 15 #include "libc-alias.h" … … 74 76 required output string length. */ 75 77 struct __strxfrm_arg x; 78 FS_VAR(); 79 FS_SAVE_LOAD(); 76 80 x.out = s1; 77 81 x.size = size / sizeof (UniChar); 78 82 __do_Unicode (__locale_collate.uconv, (char *)s2, &x, __uni_strxfrm); 83 FS_RESTORE(); 79 84 return x.size; 80 85 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/libiconv/iconv.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r753 r754 1 1 /* iconv wrapper based on OS/2 Unicode API. */ 2 2 3 #define INCL_FSMACROS 4 #include <os2emx.h> 3 5 #include <uconv.h> 4 6 … … 27 29 iconv_t conv; 28 30 uconv_attribute_t attr; 31 FS_VAR(); 29 32 30 33 conv = (iconv_t) malloc (sizeof (struct _iconv_t)); … … 35 38 } 36 39 40 FS_SAVE_LOAD(); 37 41 ucp = (UniChar *) alloca ((strlen (cp_from) + 2 + 1) * sizeof (UniChar)); 38 42 __convert_codepage (cp_from, ucp); … … 41 45 free (conv); 42 46 errno = EINVAL; 47 FS_RESTORE(); 43 48 return (iconv_t)(-1); 44 49 } … … 51 56 free (conv); 52 57 errno = EINVAL; 58 FS_RESTORE(); 53 59 return (iconv_t)(-1); 54 60 } … … 64 70 UniSetUconvObject (conv->from, &attr); 65 71 72 FS_RESTORE(); 66 73 return conv; 67 74 } … … 77 84 UniChar *orig_ucs = ucs; 78 85 size_t retval = 0; 86 FS_VAR(); 79 87 88 FS_SAVE_LOAD(); 80 89 rc = UniUconvToUcs (conv->from, (void **)in, in_left, &ucs, &sl, &retval); 81 90 if (rc) … … 108 117 } 109 118 #endif 119 FS_RESTORE(); 110 120 return 0; 111 121 … … 127 137 break; 128 138 } 139 FS_RESTORE(); 129 140 return (size_t)(-1); 130 141 } … … 135 146 if (conv != (iconv_t)(-1)) 136 147 { 148 FS_VAR(); 149 FS_SAVE_LOAD(); 137 150 UniFreeUconvObject (conv->to); 138 151 UniFreeUconvObject (conv->from); 152 FS_RESTORE(); 139 153 free (conv); 140 154 } -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.