Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
  2. #include <stdio.h>
  3. #include <libc/file.h>
  4.  
  5. int
  6. getw(FILE *f)
  7. {
  8.   int i;
  9.   char *p;
  10.   int w;
  11.  
  12.   p = (char *)&w;
  13.   for (i=sizeof(int); --i>=0;)
  14.     *p++ = getc(f);
  15.   if (feof(f))
  16.     return EOF;
  17.   return w;
  18. }
  19.