klee
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
KTest.h
Go to the documentation of this file.
1 //===-- KTest.h --------------------------------------------------*- C++ -*-===//
2 //
3 // The KLEE Symbolic Virtual Machine
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef __COMMON_KTEST_H__
11 #define __COMMON_KTEST_H__
12 
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18  typedef struct KTestObject KTestObject;
19  struct KTestObject {
20  char *name;
21  unsigned numBytes;
22  unsigned char *bytes;
23  };
24 
25  typedef struct KTest KTest;
26  struct KTest {
27  /* file format version */
28  unsigned version;
29 
30  unsigned numArgs;
31  char **args;
32 
33  unsigned symArgvs;
34  unsigned symArgvLen;
35 
36  unsigned numObjects;
38  };
39 
40 
41  /* returns the current .ktest file format version */
42  unsigned kTest_getCurrentVersion();
43 
44  /* return true iff file at path matches KTest header */
45  int kTest_isKTestFile(const char *path);
46 
47  /* returns NULL on (unspecified) error */
48  KTest* kTest_fromFile(const char *path);
49 
50  /* returns 1 on success, 0 on (unspecified) error */
51  int kTest_toFile(KTest *, const char *path);
52 
53  /* returns total number of object bytes */
54  unsigned kTest_numBytes(KTest *);
55 
56  void kTest_free(KTest *);
57 
58 #ifdef __cplusplus
59 }
60 #endif
61 
62 #endif
KTest * kTest_fromFile(const char *path)
Definition: KTest.cpp:94
Definition: KTest.h:26
unsigned symArgvs
Definition: KTest.h:33
unsigned numBytes
Definition: KTest.h:21
unsigned numArgs
Definition: KTest.h:30
unsigned numObjects
Definition: KTest.h:36
int kTest_toFile(KTest *, const char *path)
Definition: KTest.cpp:178
char ** args
Definition: KTest.h:31
unsigned char * bytes
Definition: KTest.h:22
unsigned version
Definition: KTest.h:28
KTestObject * objects
Definition: KTest.h:37
unsigned symArgvLen
Definition: KTest.h:34
char * name
Definition: KTest.h:20
void kTest_free(KTest *)
Definition: KTest.cpp:229
unsigned kTest_getCurrentVersion()
Definition: KTest.cpp:67
unsigned kTest_numBytes(KTest *)
Definition: KTest.cpp:222
int kTest_isKTestFile(const char *path)
Definition: KTest.cpp:82