1*c92079f4SPavel Dovgalyuk #ifndef REPLAY_INTERNAL_H 2*c92079f4SPavel Dovgalyuk #define REPLAY_INTERNAL_H 3*c92079f4SPavel Dovgalyuk 4*c92079f4SPavel Dovgalyuk /* 5*c92079f4SPavel Dovgalyuk * replay-internal.h 6*c92079f4SPavel Dovgalyuk * 7*c92079f4SPavel Dovgalyuk * Copyright (c) 2010-2015 Institute for System Programming 8*c92079f4SPavel Dovgalyuk * of the Russian Academy of Sciences. 9*c92079f4SPavel Dovgalyuk * 10*c92079f4SPavel Dovgalyuk * This work is licensed under the terms of the GNU GPL, version 2 or later. 11*c92079f4SPavel Dovgalyuk * See the COPYING file in the top-level directory. 12*c92079f4SPavel Dovgalyuk * 13*c92079f4SPavel Dovgalyuk */ 14*c92079f4SPavel Dovgalyuk 15*c92079f4SPavel Dovgalyuk #include <stdio.h> 16*c92079f4SPavel Dovgalyuk 17*c92079f4SPavel Dovgalyuk extern unsigned int replay_data_kind; 18*c92079f4SPavel Dovgalyuk 19*c92079f4SPavel Dovgalyuk /* File for replay writing */ 20*c92079f4SPavel Dovgalyuk extern FILE *replay_file; 21*c92079f4SPavel Dovgalyuk 22*c92079f4SPavel Dovgalyuk void replay_put_byte(uint8_t byte); 23*c92079f4SPavel Dovgalyuk void replay_put_event(uint8_t event); 24*c92079f4SPavel Dovgalyuk void replay_put_word(uint16_t word); 25*c92079f4SPavel Dovgalyuk void replay_put_dword(uint32_t dword); 26*c92079f4SPavel Dovgalyuk void replay_put_qword(int64_t qword); 27*c92079f4SPavel Dovgalyuk void replay_put_array(const uint8_t *buf, size_t size); 28*c92079f4SPavel Dovgalyuk 29*c92079f4SPavel Dovgalyuk uint8_t replay_get_byte(void); 30*c92079f4SPavel Dovgalyuk uint16_t replay_get_word(void); 31*c92079f4SPavel Dovgalyuk uint32_t replay_get_dword(void); 32*c92079f4SPavel Dovgalyuk int64_t replay_get_qword(void); 33*c92079f4SPavel Dovgalyuk void replay_get_array(uint8_t *buf, size_t *size); 34*c92079f4SPavel Dovgalyuk void replay_get_array_alloc(uint8_t **buf, size_t *size); 35*c92079f4SPavel Dovgalyuk 36*c92079f4SPavel Dovgalyuk /*! Checks error status of the file. */ 37*c92079f4SPavel Dovgalyuk void replay_check_error(void); 38*c92079f4SPavel Dovgalyuk 39*c92079f4SPavel Dovgalyuk /*! Finishes processing of the replayed event and fetches 40*c92079f4SPavel Dovgalyuk the next event from the log. */ 41*c92079f4SPavel Dovgalyuk void replay_finish_event(void); 42*c92079f4SPavel Dovgalyuk /*! Reads data type from the file and stores it in the 43*c92079f4SPavel Dovgalyuk replay_data_kind variable. */ 44*c92079f4SPavel Dovgalyuk void replay_fetch_data_kind(void); 45*c92079f4SPavel Dovgalyuk 46*c92079f4SPavel Dovgalyuk #endif 47