citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit c3d108b2ca3c6383d5afa0781824dc1bc4155037
parent c4fd9b83ad068ea81ef3f89c7c48ef4bb2251d1b
Author: kyle <kyle@0x30.net>
Date:   Sat, 12 Nov 2016 13:47:01 -0700

src: move struct citrun_header into rt.h

Diffstat:
Msrc/rt.c | 11+----------
Msrc/rt.h | 11+++++++++++
Mt/inst_preamble.sh | 11+++++++++++
Mt/utils.subr | 2+-
4 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/src/rt.c b/src/rt.c @@ -26,7 +26,7 @@ #include <string.h> /* strnlen */ #include <unistd.h> /* get{cwd,pid,ppid,pgrp} */ -#include "rt.h" +#include "rt.h" /* struct citrun_{header,node} */ #include "version.h" #define SHM_PATH "/tmp/citrun.shared" @@ -67,15 +67,6 @@ shm_extend(int bytes) return shm; } -struct citrun_header { - char magic[6]; - uint8_t major; - uint8_t minor; - uint32_t pids[3]; - char progname[PATH_MAX]; - char cwd[PATH_MAX]; -}; - /* * Add a header region to a newly created shared memory file. Header size is * rounded up to next page size multiple. Exits on error. diff --git a/src/rt.h b/src/rt.h @@ -1,9 +1,20 @@ #include <limits.h> /* PATH_MAX */ #include <stdint.h> /* uint{64,32,8}_t */ + +struct citrun_header { + char magic[6]; + uint8_t major; + uint8_t minor; + uint32_t pids[3]; + char progname[PATH_MAX]; + char cwd[PATH_MAX]; +}; + struct citrun_node { uint32_t size; const char comp_file_path[PATH_MAX]; const char abs_file_path[PATH_MAX]; uint64_t *data; }; + void citrun_node_add(uint8_t, uint8_t, struct citrun_node *); diff --git a/t/inst_preamble.sh b/t/inst_preamble.sh @@ -14,12 +14,23 @@ extern "" { #endif #include <limits.h> /* PATH_MAX */ #include <stdint.h> /* uint{64,32,8}_t */ + +struct citrun_header { + char magic[6]; + uint8_t major; + uint8_t minor; + uint32_t pids[3]; + char progname[PATH_MAX]; + char cwd[PATH_MAX]; +}; + struct citrun_node { uint32_t size; const char comp_file_path[PATH_MAX]; const char abs_file_path[PATH_MAX]; uint64_t *data; }; + void citrun_node_add(uint8_t, uint8_t, struct citrun_node *); static struct citrun_node _citrun = { 1, diff --git a/t/utils.subr b/t/utils.subr @@ -6,7 +6,7 @@ export CITRUN_TOOLS="`pwd`/src" function strip_preamble { file="${1}" - tail -n +25 $file.citrun > $file.citrun_nohdr + tail -n +36 $file.citrun > $file.citrun_nohdr } function strip_log