< prev index next >

modules/javafx.graphics/src/main/native-iio/libjpeg7/jinclude.h

Print this page


   1 /*
   2  * jinclude.h
   3  *
   4  * Copyright (C) 1991-1994, Thomas G. Lane.

   5  * This file is part of the Independent JPEG Group's software.
   6  * For conditions of distribution and use, see the accompanying README file.
   7  *
   8  * This file exists to provide a single place to fix any problems with
   9  * including the wrong system include files.  (Common problems are taken
  10  * care of by the standard jconfig symbols, but on really weird systems
  11  * you may have to edit this file.)
  12  *
  13  * NOTE: this file is NOT intended to be included by applications using the
  14  * JPEG library.  Most applications need only include jpeglib.h.
  15  */
  16 
  17 
  18 /* Include auto-config file to find out which system include files we need. */
  19 
  20 #include "jconfig.h"            /* auto configuration options */
  21 #define JCONFIG_INCLUDED        /* so that jpeglib.h doesn't do it again */
  22 
  23 /*
  24  * We need the NULL macro and size_t typedef.


  66 #include <string.h>
  67 #define MEMZERO(target,size)    memset((void *)(target), 0, (size_t)(size))
  68 #define MEMCOPY(dest,src,size)  memcpy((void *)(dest), (const void *)(src), (size_t)(size))
  69 
  70 #endif
  71 
  72 /*
  73  * In ANSI C, and indeed any rational implementation, size_t is also the
  74  * type returned by sizeof().  However, it seems there are some irrational
  75  * implementations out there, in which sizeof() returns an int even though
  76  * size_t is defined as long or unsigned long.  To ensure consistent results
  77  * we always use this SIZEOF() macro in place of using sizeof() directly.
  78  */
  79 
  80 #define SIZEOF(object)  ((size_t) sizeof(object))
  81 
  82 /*
  83  * The modules that use fread() and fwrite() always invoke them through
  84  * these macros.  On some systems you may need to twiddle the argument casts.
  85  * CAUTION: argument order is different from underlying functions!



  86  */
  87 
  88 #define JFREAD(file,buf,sizeofbuf)  \
  89   ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
  90 #define JFWRITE(file,buf,sizeofbuf)  \
  91   ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))


   1 /*
   2  * jinclude.h
   3  *
   4  * Copyright (C) 1991-1994, Thomas G. Lane.
   5  * Modified 2017 by Guido Vollbeding.
   6  * This file is part of the Independent JPEG Group's software.
   7  * For conditions of distribution and use, see the accompanying README file.
   8  *
   9  * This file exists to provide a single place to fix any problems with
  10  * including the wrong system include files.  (Common problems are taken
  11  * care of by the standard jconfig symbols, but on really weird systems
  12  * you may have to edit this file.)
  13  *
  14  * NOTE: this file is NOT intended to be included by applications using the
  15  * JPEG library.  Most applications need only include jpeglib.h.
  16  */
  17 
  18 
  19 /* Include auto-config file to find out which system include files we need. */
  20 
  21 #include "jconfig.h"            /* auto configuration options */
  22 #define JCONFIG_INCLUDED        /* so that jpeglib.h doesn't do it again */
  23 
  24 /*
  25  * We need the NULL macro and size_t typedef.


  67 #include <string.h>
  68 #define MEMZERO(target,size)    memset((void *)(target), 0, (size_t)(size))
  69 #define MEMCOPY(dest,src,size)  memcpy((void *)(dest), (const void *)(src), (size_t)(size))
  70 
  71 #endif
  72 
  73 /*
  74  * In ANSI C, and indeed any rational implementation, size_t is also the
  75  * type returned by sizeof().  However, it seems there are some irrational
  76  * implementations out there, in which sizeof() returns an int even though
  77  * size_t is defined as long or unsigned long.  To ensure consistent results
  78  * we always use this SIZEOF() macro in place of using sizeof() directly.
  79  */
  80 
  81 #define SIZEOF(object)  ((size_t) sizeof(object))
  82 
  83 /*
  84  * The modules that use fread() and fwrite() always invoke them through
  85  * these macros.  On some systems you may need to twiddle the argument casts.
  86  * CAUTION: argument order is different from underlying functions!
  87  *
  88  * Furthermore, macros are provided for fflush() and ferror() in order
  89  * to facilitate adaption by applications using an own FILE class.
  90  */
  91 
  92 #define JFREAD(file,buf,sizeofbuf)  \
  93   ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
  94 #define JFWRITE(file,buf,sizeofbuf)  \
  95   ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
  96 #define JFFLUSH(file)   fflush(file)
  97 #define JFERROR(file)   ferror(file)
< prev index next >