Line data Source code
1 : #ifndef HEADER_fd_src_discof_restore_utils_fd_ssmanifest_parser_h 2 : #define HEADER_fd_src_discof_restore_utils_fd_ssmanifest_parser_h 3 : 4 : #include "fd_ssmsg.h" 5 : #include "fd_ssparse.h" 6 : 7 : struct fd_ssmanifest_parser_private; 8 : typedef struct fd_ssmanifest_parser_private fd_ssmanifest_parser_t; 9 : 10 : FD_PROTOTYPES_BEGIN 11 : 12 : FD_FN_CONST ulong 13 : fd_ssmanifest_parser_align( void ); 14 : 15 : FD_FN_CONST ulong 16 : fd_ssmanifest_parser_footprint( void ); 17 : 18 : void * 19 : fd_ssmanifest_parser_new( void * shmem ); 20 : 21 : fd_ssmanifest_parser_t * 22 : fd_ssmanifest_parser_join( void * shmem ); 23 : 24 : void 25 : fd_ssmanifest_parser_init( fd_ssmanifest_parser_t * parser, 26 : fd_snapshot_manifest_t * manifest ); 27 : 28 0 : #define FD_SSMANIFEST_PARSER_ADVANCE_ERROR (-1) 29 0 : #define FD_SSMANIFEST_PARSER_ADVANCE_AGAIN ( 0) 30 0 : #define FD_SSMANIFEST_PARSER_ADVANCE_DONE ( 1) 31 : int 32 : fd_ssmanifest_parser_consume( fd_ssmanifest_parser_t * parser, 33 : uchar const * buf, 34 : ulong bufsz ); 35 : 36 : /* Indicate to the parser that there are no more bytes coming. 37 : Returns DONE if the parser was at a point in the state machine 38 : where it is legal to finish, or ERROR otherwise. 39 : Must be called after the last consume(). */ 40 : int 41 : fd_ssmanifest_parser_fini( fd_ssmanifest_parser_t * parser ); 42 : 43 : FD_PROTOTYPES_END 44 : 45 : #endif /* HEADER_fd_src_discof_restore_utils_fd_ssmanifest_parser_h */