structrw.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. structrw - Platform-independent reading and writing of JAM structs
  3. Copyright (C) 1999 Johan Billing
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with this library; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  15. */
  16. #define JAMBASEHEADER_SIGNATURE 0
  17. #define JAMBASEHEADER_DATECREATED 4
  18. #define JAMBASEHEADER_MODCOUNTER 8
  19. #define JAMBASEHEADER_ACTIVEMSGS 12
  20. #define JAMBASEHEADER_PASSWORDCRC 16
  21. #define JAMBASEHEADER_BASEMSGNUM 20
  22. #define JAMBASEHEADER_RSRVD 24
  23. #define SIZE_JAMBASEHEADER 1024
  24. #define JAMMSGHEADER_SIGNATURE 0
  25. #define JAMMSGHEADER_REVISION 4
  26. #define JAMMSGHEADER_RESERVEDWORD 6
  27. #define JAMMSGHEADER_SUBFIELDLEN 8
  28. #define JAMMSGHEADER_TIMESREAD 12
  29. #define JAMMSGHEADER_MSGIDCRC 16
  30. #define JAMMSGHEADER_REPLYCRC 20
  31. #define JAMMSGHEADER_REPLYTO 24
  32. #define JAMMSGHEADER_REPLY1ST 28
  33. #define JAMMSGHEADER_REPLYNEXT 32
  34. #define JAMMSGHEADER_DATEWRITTEN 36
  35. #define JAMMSGHEADER_DATERECEIVED 40
  36. #define JAMMSGHEADER_DATEPROCESSED 44
  37. #define JAMMSGHEADER_MSGNUM 48
  38. #define JAMMSGHEADER_ATTRIBUTE 52
  39. #define JAMMSGHEADER_ATTRIBUTE2 56
  40. #define JAMMSGHEADER_TXTOFFSET 60
  41. #define JAMMSGHEADER_TXTLEN 64
  42. #define JAMMSGHEADER_PASSWORDCRC 68
  43. #define JAMMSGHEADER_COST 72
  44. #define SIZE_JAMMSGHEADER 76
  45. #define JAMINDEX_USERCRC 0
  46. #define JAMINDEX_HDROFFSET 4
  47. #define SIZE_JAMINDEX 8
  48. #define JAMLASTREAD_USERCRC 0
  49. #define JAMLASTREAD_USERID 4
  50. #define JAMLASTREAD_LASTREADMSG 8
  51. #define JAMLASTREAD_HIGHREADMSG 12
  52. #define SIZE_JAMLASTREAD 16
  53. #define JAMSAVESUBFIELD_LOID 0
  54. #define JAMSAVESUBFIELD_HIID 2
  55. #define JAMSAVESUBFIELD_DATLEN 4
  56. #define SIZE_JAMSAVESUBFIELD 8
  57. int freadjambaseheader(FILE *fp,s_JamBaseHeader *s_JamBaseHeader);
  58. int fwritejambaseheader(FILE *fp,s_JamBaseHeader *s_JamBaseHeader);
  59. int freadjammsgheader(FILE *fp,s_JamMsgHeader *s_JamMsgHeader);
  60. int fwritejammsgheader(FILE *fp,s_JamMsgHeader *s_JamMsgHeader);
  61. int freadjamindex(FILE *fp,s_JamIndex *s_JamIndex);
  62. int fwritejamindex(FILE *fp,s_JamIndex *s_JamIndex);
  63. int freadjamlastread(FILE *fp,s_JamLastRead *s_JamLastRead);
  64. int fwritejamlastread(FILE *fp,s_JamLastRead *s_JamLastRead);
  65. int fwritejamsavesubfield(FILE *fp,s_JamSaveSubfield *s_JamSaveSubfield);
  66. void getjamsubfield(unsigned char *buf,s_JamSubfield *Subfield_S);