3

I want to implement deflate decompression on data in C. I have a pointer to the data and compressed data length.

On going through the zlib documentation, I see all function declarations have 'OF' in between the function name and arguments list.

eg.

ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
...

Can someone explain what this is? And also suggest links on working of zlib library in c

melpomene
  • 84,125
  • 8
  • 85
  • 148

1 Answers1

4

One minute of reading the source reveals this, from zconf.h:

#ifndef OF /* function prototypes */
#  ifdef STDC
#    define OF(args)  args
#  else
#    define OF(args)  ()
#  endif
#endif

Basically if the symbol STDC is defined, function argument lists are included in the declaration, else they are dropped and replaced with empty parentheses for old C compilers.

So the linked duplicate is exactly right, but I chose to post this anyway since this is "evidence" of the theory presented there.

unwind
  • 391,730
  • 64
  • 469
  • 606