Changeset 754


Ignore:
Timestamp:
Sep 30, 2003, 12:11:05 AM (22 years ago)
Author:
bird
Message:

#679: FS preservation.

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 to 1.3
    r753 r754  
    11/* iconv wrapper based on OS/2 Unicode API. */
    22
     3#define INCL_FSMACROS
     4#include <os2emx.h>
    35#include <uconv.h>
    46
     
    2729  iconv_t conv;
    2830  uconv_attribute_t attr;
     31  FS_VAR();
    2932
    3033  conv = (iconv_t) malloc (sizeof (struct _iconv_t));
     
    3538    }
    3639
     40  FS_SAVE_LOAD();
    3741  ucp = (UniChar *) alloca ((strlen (cp_from) + 2 + 1) * sizeof (UniChar));
    3842  __convert_codepage (cp_from, ucp);
     
    4145      free (conv);
    4246      errno = EINVAL;
     47      FS_RESTORE();
    4348      return (iconv_t)(-1);
    4449    }
     
    5156      free (conv);
    5257      errno = EINVAL;
     58      FS_RESTORE();
    5359      return (iconv_t)(-1);
    5460    }
     
    6470  UniSetUconvObject (conv->from, &attr);
    6571
     72  FS_RESTORE();
    6673  return conv;
    6774}
     
    7784  UniChar *orig_ucs = ucs;
    7885  size_t retval = 0;
     86  FS_VAR();
    7987
     88  FS_SAVE_LOAD();
    8089  rc = UniUconvToUcs (conv->from, (void **)in, in_left, &ucs, &sl, &retval);
    8190  if (rc)
     
    108117    }
    109118#endif
     119  FS_RESTORE();
    110120  return 0;
    111121
     
    127137      break;
    128138  }
     139  FS_RESTORE();
    129140  return (size_t)(-1);
    130141}
     
    135146  if (conv != (iconv_t)(-1))
    136147    {
     148      FS_VAR();
     149      FS_SAVE_LOAD();
    137150      UniFreeUconvObject (conv->to);
    138151      UniFreeUconvObject (conv->from);
     152      FS_RESTORE();
    139153      free (conv);
    140154    }
  • trunk/src/emx/src/lib/io/eadread.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r753 r754  
    44#define INCL_DOSFILEMGR
    55#define INCL_DOSERRORS
     6#define INCL_FSMACROS
    67#include <os2.h>
    78#include <stdlib.h>
     
    6566  struct gea_data gd;
    6667  EAOP2 eaop;
     68  FS_VAR();
    6769
    6870  _ead_clear (ead);
     
    99101      eaop.fpFEA2List = ead->buffer;
    100102      eaop.oError = 0;
     103      FS_SAVE_LOAD();
    101104      if (path == NULL)
    102105        rc = DosQueryFileInfo (handle, FIL_QUERYEASFROMLIST, &eaop,
     
    105108        rc = DosQueryPathInfo (path, FIL_QUERYEASFROMLIST, &eaop,
    106109                               sizeof (eaop));
     110      FS_RESTORE();
    107111      if (rc != 0)
    108112        {
     
    138142  PDENA2 pdena;
    139143  int expand_dena_buf;
     144  FS_VAR();
    140145
    141146  if (path != NULL)
     
    165170        }
    166171      count = -1;
     172      FS_SAVE_LOAD();
    167173      rc = DosEnumAttribute (reftype, fileref, index,
    168174                             dena_buf, dena_buf_size, &count,
    169175                             ENUMEA_LEVEL_NO_VALUE);
     176      FS_RESTORE();
    170177      if (rc == ERROR_BUFFER_OVERFLOW)
    171178        expand_dena_buf = 1;
  • trunk/src/emx/src/lib/io/eaget.c

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r753 r754  
    33#include "libc-alias.h"
    44#define INCL_DOSFILEMGR
     5#define INCL_FSMACROS
    56#include <os2.h>
    67#include <stdlib.h>
     
    2324  PFEA2 pfea;
    2425  int len, size;
     26  FS_VAR();
    2527
    2628  dst->flags = 0;
     
    5254  eaop.fpFEA2List = pfealist;
    5355  eaop.oError = 0;
     56  FS_SAVE_LOAD();
    5457  if (path == NULL)
    5558    rc = DosQueryFileInfo (handle, FIL_QUERYEASFROMLIST, &eaop,
     
    5861    rc = DosQueryPathInfo (path, FIL_QUERYEASFROMLIST, &eaop,
    5962                           sizeof (eaop));
     63  FS_RESTORE();
    6064  if (rc != 0)
    6165    {
  • trunk/src/emx/src/lib/io/eawrite.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r753 r754  
    33#include "libc-alias.h"
    44#define INCL_DOSFILEMGR
     5#define INCL_FSMACROS
    56#include <os2.h>
    67#include <stdlib.h>
     
    1112  ULONG rc;
    1213  EAOP2 eaop;
     14  FS_VAR();
    1315
    1416  eaop.fpGEA2List = NULL;
    1517  eaop.fpFEA2List = src;
    1618  eaop.oError = 0;
     19  FS_SAVE_LOAD();
    1720  if (path != NULL)
    1821    rc = DosSetPathInfo (path, 2, &eaop, sizeof (eaop), 0);
    1922  else
    2023    rc = DosSetFileInfo (handle, 2, &eaop, sizeof (eaop));
     24  FS_RESTORE();
    2125  if (rc != 0)
    2226    {
  • trunk/src/emx/src/lib/locale/__do_uni.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r753 r754  
    1010*/
    1111
     12#define INCL_FSMACROS
     13#include <os2emx.h>
    1214#include <uconv.h>
    1315#include <alloca.h>
     
    2527  UniChar *ucsbuf;
    2628  size_t in_left, out_left, nonid;
     29  FS_VAR();
     30  FS_SAVE_LOAD();
    2731
    2832  /* Allocate strings up to 2000 characters on the stack */
     
    5357  if (free_ucs)
    5458    free (ucs);
     59  FS_RESTORE();
    5560}
  • trunk/src/emx/src/lib/locale/__from_ucs.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r753 r754  
    99*/
    1010
     11#define INCL_FSMACROS
     12#include <os2emx.h>
    1113#include <uconv.h>
    1214
     
    1719  void *outbuf = sbcs;
    1820  size_t nonid, in_left = 1, out_left = len;
     21  int rc;
     22  FS_VAR();
    1923
    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)
    2228    return 0;
    2329
  • trunk/src/emx/src/lib/locale/__to_ucs.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r753 r754  
    99*/
    1010
     11#define INCL_FSMACROS
     12#include <os2emx.h>
    1113#include <uconv.h>
    1214
     
    1719  UniChar *outbuf = ucs;
    1820  size_t nonid, in_left = len, out_left = 1;
     21  int ret;
     22  FS_VAR();
    1923
    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,
    2126    &nonid);
     27  FS_RESTORE();
    2228
    2329  if ((ret && (ret != ULS_BUFFERFULL)) || nonid || out_left)
  • trunk/src/emx/src/lib/locale/setlocale.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r753 r754  
    2222
    2323#define INCL_DOS
    24 #include <os2.h>
     24#define INCL_FSMACROS
     25#include <os2emx.h>
    2526#include <unidef.h>
    2627#include <uconv.h>
     
    5859  void *outbuf = tmp;
    5960  int try_count = 0;
    60 
     61  FS_VAR();
     62
     63  FS_SAVE_LOAD();
    6164try_again:
    6265
    6366  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    }
    6673
    6774  switch (UniUconvFromUcs (uconv_obj, &inbuf, &in_left, &outbuf, &out_left, &nonid))
     
    8188      /* Unexpected error. */
    8289      free (tmp);
     90      FS_RESTORE();
    8391      return -1;
    8492  }
     
    8896  memcpy (*out, tmp, usl);
    8997  free (tmp);
     98  FS_RESTORE();
    9099
    91100  return 0;
  • trunk/src/emx/src/lib/mbyte/mbstowcs.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r753 r754  
    99    character sequence starts in the initial shift state. At most n codes
    1010    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.
    1212
    13     The shift state of mbtowc() and mblen() is not affected. 
     13    The shift state of mbtowc() and mblen() is not affected.
    1414
    1515    mbstowcs() returns the number of codes stored to pwcs (excluding the
     
    2323*/
    2424
     25#define INCL_FSMACROS
     26#include <os2emx.h>
    2527#define __INTERNAL_DEFS
    2628#include "libc-alias.h"
     
    3133{
    3234  size_t nonid, sl = strlen (s) + 1, nw = n;
     35  int rc;
     36  FS_VAR();
    3337
    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)
    3642    return -1;
    3743
  • trunk/src/emx/src/lib/mbyte/mbtowc.c

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r753 r754  
    1010    of more than n bytes is deemed invalid.
    1111
    12     The shift state of mblen() is not affected. 
     12    The shift state of mblen() is not affected.
    1313
    1414    If s is NULL, mbtowc() returns a non-zero value (if state-dependent
     
    2525*/
    2626
     27#define INCL_FSMACROS
     28#include <os2emx.h>
    2729#define __INTERNAL_DEFS
    2830#include "libc-alias.h"
     
    3436  size_t nonid, ni = n, no = 1;
    3537  int rc;
     38  FS_VAR();
    3639
    3740  if (!s)
    3841    return 0;               /* No state dependency */
    3942
     43  FS_SAVE_LOAD();
    4044  rc = UniUconvToUcs (__locale_ctype.uconv, (void *)&s, &ni, &pwc, &no, &nonid);
     45  FS_RESTORE();
    4146
    4247  if ((rc == 0) || (rc == UCONV_E2BIG))
  • trunk/src/emx/src/lib/mbyte/wcstombs.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r753 r754  
    1010    s will be terminated with a null character if n is big enough.
    1111
    12     The shift state of wctomb() is not affected. 
     12    The shift state of wctomb() is not affected.
    1313
    1414    wcstombs() returns the number of bytes stored to s (excluding the
     
    2222*/
    2323
     24#define INCL_FSMACROS
     25#include <os2emx.h>
    2426#define __INTERNAL_DEFS
    2527#include "libc-alias.h"
     
    3032{
    3133  size_t nonid, sl = UniStrlen (pwcs) + 1, nw = n;
     34  int rc;
     35  FS_VAR();
    3236
    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)
    3541    return -1;
    3642
  • trunk/src/emx/src/lib/mbyte/wctomb.c

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r753 r754  
    1717*/
    1818
     19#define INCL_FSMACROS
     20#include <os2emx.h>
    1921#define __INTERNAL_DEFS
    2022#include "libc-alias.h"
     
    2628  UniChar *ucs = &wchar;
    2729  size_t nonid, ni = 1, no = MB_CUR_MAX;
     30  int rc;
     31  FS_VAR();
    2832
    2933  if (!s)
    3034    return 0;               /* No state dependency */
    3135
    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)
    3340    return -1;
    3441
  • trunk/src/emx/src/lib/misc/getvol.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r753 r754  
    88#define INCL_DOSFILEMGR
    99#define INCL_DOSERRORS
     10#define INCL_FSMACROS
    1011#include <os2emx.h>
    1112
     
    1314{
    1415  struct _thread *tp = _thread();
     16  FS_VAR();
    1517
    1618  if (drive == 0)
     
    2527
    2628  memset (&fsinfo, 0, sizeof (fsinfo));
     29  FS_SAVE_LOAD();
    2730  rc = DosQueryFSInfo (drive - 'A' + 1, FSIL_VOLSER, &fsinfo,
    2831                       sizeof (fsinfo));
     32  FS_RESTORE();
    2933  if (rc != 0)
    3034    return NULL;
  • trunk/src/emx/src/lib/process/beginthr.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r753 r754  
    1010#define INCL_DOSERRORS
    1111#define INCL_DOSEXCEPTIONS
     12#define INCL_FSMACROS
    1213#include <os2emx.h>
    1314
     
    3940  struct _thread *tp;
    4041  ULONG rc;
     42  FS_VAR();
    4143
     44  FS_SAVE_LOAD();
    4245  rc = DosAllocMem ((PPVOID)&tp, sizeof (struct _thread),
    4346                    PAG_COMMIT|PAG_READ|PAG_WRITE);
     47  FS_RESTORE();
    4448  if (rc != 0)
    4549    return NULL;
     
    6670  TID tid;
    6771  struct _thread *tp;
     72  FS_VAR();
    6873
    6974  tp = __alloc_thread ();
     
    7580  tp->_th_start = start;
    7681  tp->_th_arg = arg_list;
     82  FS_SAVE_LOAD();
    7783  rc = DosCreateThread (&tid, (PFNTHREAD)start_thread, (ULONG)tp,
    7884                        CREATE_SUSPENDED | STACK_COMMITTED, stack_size);
     
    8692        errno = EINVAL;
    8793      DosFreeMem (tp);
     94      FS_RESTORE();
    8895      return -1;
    8996    }
     
    93100      errno = EAGAIN;
    94101      DosFreeMem (tp);
     102      FS_RESTORE();
    95103      return -1;
    96104    }
     
    99107      DosKillThread (tid);
    100108      DosFreeMem (tp);
     109      FS_RESTORE();
    101110      return -1;
    102111    }
     
    107116      errno = ESRCH;
    108117      DosFreeMem (tp);
     118      FS_RESTORE();
    109119      return -1;
    110120    }
     121  FS_RESTORE();
    111122  return tid;
    112123}
     
    117128  struct _thread *tp;
    118129  int tid;
     130  FS_VAR();
    119131
    120132  tid = _gettid ();
    121133  tp = _thread ();
     134  FS_SAVE_LOAD();
    122135  if (tp != &thread_1)
    123136    DosFreeMem (tp);
  • trunk/src/emx/src/lib/process/fmutex.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r753 r754  
    55#define INCL_DOSPROCESS
    66#define INCL_DOSERRORS
     7#define INCL_FSMACROS
    78#include <os2.h>
    89#include <stdlib.h>
     
    1617unsigned _fmutex_create (_fmutex *sem, unsigned flags)
    1718{
     19  unsigned rc;
     20  FS_VAR();
    1821  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;
    2228}
    2329
     
    2531unsigned _fmutex_open (_fmutex *sem)
    2632{
    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;
    2839}
    2940
     
    3142unsigned _fmutex_close (_fmutex *sem)
    3243{
    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;
    3450}
    3551
     
    5571  for (;;)
    5672    {
     73      FS_VAR();
     74      FS_SAVE_LOAD();
    5775      rc = DosResetEventSem (sem->hev, &count);
     76      FS_RESTORE();
    5877      if (rc != 0 && rc != ERROR_ALREADY_RESET)
    5978        return rc;
     
    6281      do
    6382        {
     83          FS_SAVE_LOAD();
    6484          rc = DosWaitEventSem (sem->hev, SEM_INDEFINITE_WAIT);
     85          FS_RESTORE();
    6586        } while (rc == ERROR_INTERRUPT && (flags & _FMR_IGNINT));
    6687      if (rc != 0)
     
    7394{
    7495  ULONG rc;
     96  FS_VAR();
    7597
     98  FS_SAVE_LOAD();
    7699  rc = DosPostEventSem (sem->hev);
    77100  if (rc != 0 && rc != ERROR_ALREADY_POSTED)
    78     return rc;
     101    {
     102      FS_RESTORE();
     103      return rc;
     104    }
    79105
    80106  /* Give up our time slice to give other threads a chance.  Without
     
    122148
    123149  DosSleep (0);
     150  FS_RESTORE();
    124151  return 0;
    125152}
  • trunk/src/emx/src/lib/process/smutex.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r753 r754  
    33#include "libc-alias.h"
    44#define INCL_DOSPROCESS
     5#define INCL_FSMACROS
    56#include <os2.h>
    67#include <sys/builtin.h>
     
    1011void __smutex_request_internal (volatile _smutex *sem)
    1112{
     13  FS_VAR();
     14  FS_SAVE_LOAD();
    1215  do
    1316    {
    1417      DosSleep (1);
    1518    } while (__cxchg (sem, 1) != 0);
     19  FS_RESTORE();
    1620}
  • trunk/src/emx/src/lib/str/memicmp.c

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r753 r754  
    88*/
    99
     10#define INCL_FSMACROS
     11#include <os2emx.h>
    1012#define __INTERNAL_DEFS
    1113#include "libc-alias.h"
     
    2628
    2729  if (__locale_ctype.mbcs)
     30  {
     31    FS_VAR();
     32    FS_SAVE_LOAD();
    2833    /* MBCS case. One additional memory lookup per character. */
    2934    for (;;)
     
    5560        d = __locale_ctype.locase [c1] - __locale_ctype.locase [c2];
    5661      if (d)
    57         return d;
     62        {
     63          FS_RESTORE();
     64          return d;
     65        }
    5866      if (!--len)
    59         return 0;
     67        {
     68          FS_RESTORE();
     69          return 0;
     70        }
    6071      c1 = *++s1;
    6172      c2 = *++s2;
    6273    } /* endfor */
     74    FS_RESTORE();
     75  }
    6376  else
    6477    /* SBCS case (faster). */
  • trunk/src/emx/src/lib/str/strcoll.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r753 r754  
    1010*/
    1111
     12#define INCL_FSMACROS
     13#include <os2emx.h>
    1214#define __INTERNAL_DEFS
    1315#include "libc-alias.h"
     
    2325
    2426  if (__locale_collate.mbcs)
     27  {
     28    FS_VAR();
     29    FS_SAVE_LOAD();
    2530    /* MBCS case. We compare the strings as usual, but as soon as we
    2631       encounter a MBCS character we translate the rests of the strings
     
    4954            /* Oops, something bad happened (invalid character code). Suppose
    5055               the string that caused the fault is "less" than the other */
     56            FS_RESTORE();
    5157            return i * 2 - 1;
    5258          }
     
    5460
    5561        /* 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;
    5765      }
    5866
    5967      d = __locale_collate.weight [c1] - __locale_collate.weight [c2];
    6068      if (d || !c1 || !c2)
     69      {
     70        FS_RESTORE();
    6171        return d;
     72      }
    6273      c1 = *++s1;
    6374      c2 = *++s2;
    6475    } /* endfor */
     76    FS_RESTORE();
     77  }
    6578  else
    6679    /* SBCS case (faster). */
  • trunk/src/emx/src/lib/str/stricmp.c

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r753 r754  
    88*/
    99
     10#define INCL_FSMACROS
     11#include <os2emx.h>
    1012#define __INTERNAL_DEFS
    1113#include "libc-alias.h"
     
    2830
    2931  if (__locale_ctype.mbcs)
     32  {
     33    FS_VAR();
     34    FS_SAVE_LOAD();
    3035    /* MBCS case. One additional memory lookup per character. */
    3136    for (;;)
     
    5762
    5863      if (d || !c1 || !c2)
     64      {
     65        FS_RESTORE();
    5966        return d;
     67      }
    6068      c1 = *++s1;
    6169      c2 = *++s2;
    6270    } /* endfor */
     71    FS_RESTORE();
     72  }
    6373  else
    6474    /* SBCS case (faster). */
  • trunk/src/emx/src/lib/str/strlwr.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r753 r754  
    88*/
    99
     10#define INCL_FSMACROS
     11#include <os2emx.h>
    1012#define __INTERNAL_DEFS
    1113#include "libc-alias.h"
     
    3537           until the end to Unicode, do the work in Unicode and then
    3638           convert back to MBCS. */
     39        FS_VAR();
     40        FS_SAVE_LOAD();
    3741        __do_Unicode (__locale_ctype.uconv, s, s, __uni_strlwr);
     42        FS_RESTORE();
    3843        break;
    3944      }
  • trunk/src/emx/src/lib/str/strnicmp.c

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r753 r754  
    99*/
    1010
     11#define INCL_FSMACROS
     12#include <os2emx.h>
    1113#define __INTERNAL_DEFS
    1214#include "libc-alias.h"
     
    2527
    2628  if (__locale_ctype.mbcs)
     29  {
     30    FS_VAR();
     31    FS_SAVE_LOAD();
    2732    /* MBCS case. One additional memory lookup per character. */
    2833    for (;;)
     
    5459        d = __locale_ctype.locase [c1] - __locale_ctype.locase [c2];
    5560      if (d || !c1 || !c2)
     61      {
     62        FS_RESTORE();
    5663        return d;
     64      }
    5765      if (!--len)
     66      {
     67        FS_RESTORE();
    5868        return 0;
     69      }
    5970      c1 = *++s1;
    6071      c2 = *++s2;
    6172    } /* endfor */
     73    FS_RESTORE();
     74  }
    6275  else
    6376    /* SBCS case (faster). */
     
    7386    } /* endfor */
    7487
    75   /* This point never achieved */
     88  /* This point never reached */
    7689}
  • trunk/src/emx/src/lib/str/strupr.c

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r753 r754  
    88*/
    99
     10#define INCL_FSMACROS
     11#include <os2emx.h>
    1012#define __INTERNAL_DEFS
    1113#include "libc-alias.h"
     
    3537           until the end to Unicode, do the work in Unicode and then
    3638           convert back to MBCS. */
     39        FS_VAR();
     40        FS_SAVE_LOAD();
    3741        __do_Unicode (__locale_ctype.uconv, s, s, __uni_strupr);
     42        FS_RESTORE();
    3843        break;
    3944      }
  • trunk/src/emx/src/lib/str/strxfrm.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r753 r754  
    1010*/
    1111
     12#define INCL_FSMACROS
     13#include <os2emx.h>
    1214#define __INTERNAL_DEFS
    1315#include "libc-alias.h"
     
    7476       required output string length. */
    7577    struct __strxfrm_arg x;
     78    FS_VAR();
     79    FS_SAVE_LOAD();
    7680    x.out = s1;
    7781    x.size = size / sizeof (UniChar);
    7882    __do_Unicode (__locale_collate.uconv, (char *)s2, &x, __uni_strxfrm);
     83    FS_RESTORE();
    7984    return x.size;
    8085  }
  • trunk/src/emx/src/libiconv/iconv.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r753 r754  
    11/* iconv wrapper based on OS/2 Unicode API. */
    22
     3#define INCL_FSMACROS
     4#include <os2emx.h>
    35#include <uconv.h>
    46
     
    2729  iconv_t conv;
    2830  uconv_attribute_t attr;
     31  FS_VAR();
    2932
    3033  conv = (iconv_t) malloc (sizeof (struct _iconv_t));
     
    3538    }
    3639
     40  FS_SAVE_LOAD();
    3741  ucp = (UniChar *) alloca ((strlen (cp_from) + 2 + 1) * sizeof (UniChar));
    3842  __convert_codepage (cp_from, ucp);
     
    4145      free (conv);
    4246      errno = EINVAL;
     47      FS_RESTORE();
    4348      return (iconv_t)(-1);
    4449    }
     
    5156      free (conv);
    5257      errno = EINVAL;
     58      FS_RESTORE();
    5359      return (iconv_t)(-1);
    5460    }
     
    6470  UniSetUconvObject (conv->from, &attr);
    6571
     72  FS_RESTORE();
    6673  return conv;
    6774}
     
    7784  UniChar *orig_ucs = ucs;
    7885  size_t retval = 0;
     86  FS_VAR();
    7987
     88  FS_SAVE_LOAD();
    8089  rc = UniUconvToUcs (conv->from, (void **)in, in_left, &ucs, &sl, &retval);
    8190  if (rc)
     
    108117    }
    109118#endif
     119  FS_RESTORE();
    110120  return 0;
    111121
     
    127137      break;
    128138  }
     139  FS_RESTORE();
    129140  return (size_t)(-1);
    130141}
     
    135146  if (conv != (iconv_t)(-1))
    136147    {
     148      FS_VAR();
     149      FS_SAVE_LOAD();
    137150      UniFreeUconvObject (conv->to);
    138151      UniFreeUconvObject (conv->from);
     152      FS_RESTORE();
    139153      free (conv);
    140154    }
Note: See TracChangeset for help on using the changeset viewer.