encdec Encode and decode a wide range of C objects http://www.ioplex.com/~miallen/encdec/ Tue Jul 22 04:46:12 EDT 2003 encdec-0.3.8 An Encdec.java class with static methods analygous to all encdec functions has been added. The format generated by this Java class is identical to those generated by the encdec C functions with the exception of time encodings which have a resolution limited to seconds since 1970 with the C library whereas the Java class can encode milliseconds since 1970. Two time encodings TIME_1970_MILLIS_64{BE,LE} have been added to accomodate the increase in resolution of Java times although decoding a time in C will result in a loss of precision (the milliseconds will be truncated). Also there are no string functions because Java can do the equivalent natively. Fri Mar 21 17:41:03 EST 2003 encdec-0.3.7 Minor adjustments have been made to some floating point functions. The documentation has been tweeked as well. Sat Nov 16 02:38:31 EST 2002 encdec-0.3.6 IEEE754 functions have been added, a popular Windows time encoding has been added, and portability has been greatly improved (pretty much anywhere including Win32). -- INSTALLATION For i18n string support Bruno Haible's libiconv source is required. Encdec compiles directly against it. The mbs functions are just another interface into Bruno's code. Download the package: http://www.gnu.org/directory/libiconv.html and build it. You do not need to install it however. In the encdec Makefile, edit the first line to specify the libiconv directory and change the prefix if necessary. Then do: # make # make install This is all that should be necessary on Red Hat 5,6,7 or Solaris at least. Otherwise, non-ANSI functionality is parameterized in src\defines.h. Doing: # make noiconv # make install will build in the absence of libiconv although on some platforms it may be necessary to edit src/encdec.h get uint16_t, uint32_t, and uint64_t defined. This package assumes the wchar_t parameter for wctomb and mbtowc are Unicode. Many encode string operations will not work on pre glibc 2.2 systems like Red Hat 5 and 6. There is an RPM for Linux that was prepared on Red Hat 6.2 which means it should be fairly portable across Red Hats, Mandrake, and others. Note the RPM is large because of all the character encoding tables from libiconv. See README.win32 for Windows installation and important notes. -- Fri Mar 22 19:28:07 EST 2002 endec-0.2.3 The FLD macro for decoding bit fields has been reduced to a trivial and rather interesting expression. Thu Mar 14 02:56:43 EST 2002 encdec-0.2.2 The dec_mbsncpy_new and dec_mbscpy_new function names have been changed to dec_mbsndup and dec_mbsdup to be more consistent with common C practice. Wed Mar 13 03:14:23 EST 2002 encdec-0.2.1 The license has changed to LGPL. The string interface has been completely rewritten. It no longer uses iconv(3) but must be compiled directly against Bruno Haible's libiconv source. Still no IEEE floating point encoding/decoding. A clever FLD macro for decoding bit-fields has been added. See the new man page for details but here is a quick example of how to decode a string: #include n = dec_mbsncpy(&src, end - src, dst, BUFSIZ, -1, "EUC-JP"); if (n == (size_t)-1) { return -1; } or perhaps just: if ((s = dec_mbsdup(&src, "EUC-JP") == NULL) return -1; These would decode an EUC-JP encoded string at src and generate a locale dependent multi-byte string in dst or in the later case return a new string s. Mon Sep 24 19:02:56 EDT 2001 encdec-0.1.1 The endianess of all integer encoding functions were reveresed. The functions have been renamed properly. I have added an interface for serialization of 4 different encodings of time_t although at the moment it simply assumes that time_t is a 32 bit integer. This should be true on most systems but will undoubtedly break at some point. There is also a small snipplet of documentation of these functions; see encdec.html. Sun Sep 9 23:35:19 EDT 2001 encdec-0.1.0