home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / IO / EAPUT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-02  |  849 b   |  34 lines

  1. /* eaput.c (emx+gcc) -- Copyright (c) 1993 by Eberhard Mattes */
  2.  
  3. #define INCL_DOSFILEMGR
  4. #include <os2.h>
  5. #include <stdlib.h>
  6. #include <string.h>
  7. #include <io.h>
  8. #include <errno.h>
  9. #include <sys/ea.h>
  10. #include "ea.h"
  11.  
  12. int _ea_put (struct _ea *src, const char *path, int handle,
  13.              const char *name)
  14. {
  15.   PFEA2LIST pfealist;
  16.   PFEA2 pfea;
  17.   int len, size;
  18.  
  19.   if (_osmode != OS2_MODE)
  20.     return (0);
  21.   len = strlen (name);
  22.   size = sizeof (FEA2LIST) + len + src->size;
  23.   pfealist = alloca (size);
  24.   pfealist->cbList = size;
  25.   pfea = &pfealist->list[0];
  26.   pfea->oNextEntryOffset = 0;
  27.   pfea->fEA = src->flags;
  28.   pfea->cbName = len;
  29.   pfea->cbValue = src->size;
  30.   memcpy (pfea->szName, name, len + 1);
  31.   memcpy (pfea->szName + len + 1, src->value, src->size);
  32.   return (_ea_write (path, handle, pfealist));
  33. }
  34.