1 /*
2  * Copyright (c) Tony Bybell 2013-2015.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  */
9 
10 #ifndef FSDB_WRAPPER_API_H
11 #define FSDB_WRAPPER_API_H
12 
13 #if defined(FSDB_IS_PRESENT) && defined(FSDB_NSYS_IS_PRESENT)
14 #define WAVE_FSDB_READER_IS_PRESENT
15 #endif
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <string.h>
24 #include <ctype.h>
25 #ifdef HAVE_INTTYPES_H
26 #include <inttypes.h>
27 #endif
28 
29 struct fsdbReaderGetStatistics_t
30 {
31 int varCount;
32 int scopeCount;
33 };
34 
35 struct fsdbReaderBlackoutChain_t
36 {
37 uint64_t tim;
38 unsigned active : 1;
39 };
40 
41 
42 void *fsdbReaderOpenFile(char *nam);
43 void fsdbReaderReadScopeVarTree(void *ctx,void (*cb)(void *));
44 int fsdbReaderGetMaxVarIdcode(void *ctx);
45 struct fsdbReaderGetStatistics_t *fsdbReaderGetStatistics(void *ctx);
46 void fsdbReaderAddToSignalList(void *ctx, int i);
47 void fsdbReaderResetSignalList(void *ctx);
48 void fsdbReaderLoadSignals(void *ctx);
49 void *fsdbReaderCreateVCTraverseHandle(void *ctx, int i);
50 int fsdbReaderHasIncoreVC(void *ctx, void *hdl);
51 void fsdbReaderFree(void *ctx, void *hdl);
52 uint64_t fsdbReaderGetMinXTag(void *ctx, void *hdl);
53 uint64_t fsdbReaderGetMaxXTag(void *ctx, void *hdl);
54 int fsdbReaderGotoXTag(void *ctx, void *hdl, uint64_t tim);
55 uint64_t fsdbReaderGetXTag(void *ctx, void *hdl, int *rc);
56 int fsdbReaderGetVC(void *ctx, void *hdl, void **val_ptr);
57 int fsdbReaderGotoNextVC(void *ctx, void *hdl);
58 void fsdbReaderUnloadSignals(void *ctx);
59 void fsdbReaderClose(void *ctx);
60 int fsdbReaderGetBytesPerBit(void *hdl);
61 int fsdbReaderGetBitSize(void *hdl);
62 int fsdbReaderGetVarType(void *hdl);
63 char *fsdbReaderTranslateVC(void *hdl, void *val_ptr);
64 int fsdbReaderExtractScaleUnit(void *ctx, int *mult, char *scale);
65 int fsdbReaderGetMinFsdbTag64(void *ctx, uint64_t *tim);
66 int fsdbReaderGetMaxFsdbTag64(void *ctx, uint64_t *tim);
67 
68 unsigned int fsdbReaderGetDumpOffRange(void *ctx, struct fsdbReaderBlackoutChain_t **r);
69 int fsdbReaderGetTransInfo(void *ctx, int idx, void **trans_info);
70 
71 void fsdbReaderReadScopeVarTree2(void *ctx,void (*cb)(void *));
72 
73 #ifdef __cplusplus
74 }
75 #endif
76 
77 #endif
78