fixup style
[c11tester.git] / snapshotimp.h
index 2e4929d0477e4605cd5363fb86266cd054d1f3fe..fbff35f42470e8d2604f0236690af2773c6c29dc 100644 (file)
@@ -2,15 +2,13 @@
  *     @brief Snapshotting implementation header file..
  */
 
-#ifndef _SNAPSHOTIMP_H
-#define _SNAPSHOTIMP_H
+#ifndef __SNAPSHOTIMP_H__
+#define __SNAPSHOTIMP_H__
+
+#include <stddef.h>
+
 #include "snapshot.h"
-#include <iostream>
-#include <inttypes.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <sys/types.h>
-#include <csignal>
+
 #define SHARED_MEMORY_DEFAULT  (100 * ((size_t)1 << 20)) // 100mb for the shared memory
 #define STACK_SIZE_DEFAULT      (((size_t)1 << 20) * 20)  // 20 mb out of the above 100 mb for my stack
 
@@ -27,22 +25,22 @@ struct SnapShotPage {
 
 //List the base address of the corresponding page in the backing store so we know where to copy it to
 struct BackingPageRecord {
-       void * basePtrOfPage;
+       void *basePtrOfPage;
 };
 
 //Stuct for each memory region
 struct MemoryRegion {
-       void * basePtr; //base of memory region
+       void *basePtr; //base of memory region
        int sizeInPages; //size of memory region in pages
 };
 
 //Primary struct for snapshotting system....
 struct SnapShot {
-       struct MemoryRegion * regionsToSnapShot; //This pointer references an array of memory regions to snapshot
-       struct SnapShotPage * backingStore; //This pointer references an array of snapshotpage's that form the backing store
-       void * backingStoreBasePtr; //This pointer references an array of snapshotpage's that form the backing store
-       struct BackingPageRecord * backingRecords; //This pointer references an array of backingpagerecord's (same number of elements as backingstore
-       struct SnapShotRecord * snapShots; //This pointer references the snapshot array
+       struct MemoryRegion *regionsToSnapShot; //This pointer references an array of memory regions to snapshot
+       struct SnapShotPage *backingStore; //This pointer references an array of snapshotpage's that form the backing store
+       void *backingStoreBasePtr; //This pointer references an array of snapshotpage's that form the backing store
+       struct BackingPageRecord *backingRecords; //This pointer references an array of backingpagerecord's (same number of elements as backingstore
+       struct SnapShotRecord *snapShots; //This pointer references the snapshot array
 
        unsigned int lastSnapShot; //Stores the next snapshot record we should use
        unsigned int lastBackingPage; //Stores the next backingpage we should use
@@ -54,6 +52,9 @@ struct SnapShot {
 };
 
 #else
+
+#include <ucontext.h>
+
 struct SnapShot {
        void *mSharedMemoryBase;
        void *mStackBase;
@@ -65,5 +66,6 @@ struct SnapShot {
 #endif
 
 //Global reference to snapshot data structure
-extern struct SnapShot * snapshotrecord;
-#endif
+extern struct SnapShot *snapshotrecord;
+
+#endif /* __SNAPSHOTIMP_H__ */