message_file.h 555 B

12345678910111213141516171819202122232425262728
  1. #ifndef _MESSAGE_PARSE_HPP_
  2. #define _MESSAGE_PARSE_HPP_
  3. #include <stdint.h>
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. struct message_file
  7. {
  8. private:
  9. bool m_owner;
  10. FILE* m_file;
  11. char m_last_line[1024];
  12. message_file(const message_file&);
  13. public:
  14. message_file(const char*fname);
  15. message_file(FILE*fp);
  16. ~message_file();
  17. int get_line(uint64_t*time,char*buf,int buflen,char*msg);
  18. int get_line(uint64_t*time,char*buf,int buflen);
  19. int put_line(FILE*fp,uint64_t time,char*buf,int buflen);
  20. int get_card_message(uint32_t card_id,char*b);
  21. };
  22. #endif