aboutsummaryrefslogtreecommitdiff
path: root/include/libsurvive
diff options
context:
space:
mode:
authorDr. Orion Lawlor <lawlor@alaska.edu>2017-04-17 21:38:46 -0800
committerDr. Orion Lawlor <lawlor@alaska.edu>2017-04-17 21:38:46 -0800
commit06f580d722136051c55653f6767f185b396f3371 (patch)
tree693507ec399449049d33ad367002910b16db05d2 /include/libsurvive
parent9b1309c6dd9b38502b04d6bedb64f57acc7341e8 (diff)
downloadlibsurvive-06f580d722136051c55653f6767f185b396f3371.tar.gz
libsurvive-06f580d722136051c55653f6767f185b396f3371.tar.bz2
Support calling the library from C++, by adding extern "C" decorations, and including correct prototypes.
Diffstat (limited to 'include/libsurvive')
-rw-r--r--include/libsurvive/poser.h9
-rw-r--r--include/libsurvive/survive.h13
-rw-r--r--include/libsurvive/survive_types.h8
3 files changed, 29 insertions, 1 deletions
diff --git a/include/libsurvive/poser.h b/include/libsurvive/poser.h
index 497b009..582590e 100644
--- a/include/libsurvive/poser.h
+++ b/include/libsurvive/poser.h
@@ -3,6 +3,11 @@
#include "survive_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef enum PoserType_t
{
POSERDATA_NONE = 0,
@@ -55,4 +60,8 @@ typedef struct
typedef int (*PoserCB)( SurviveObject * so, PoserData * pd );
+#ifdef __cplusplus
+};
+#endif
+
#endif
diff --git a/include/libsurvive/survive.h b/include/libsurvive/survive.h
index 278bbca..3c35bd2 100644
--- a/include/libsurvive/survive.h
+++ b/include/libsurvive/survive.h
@@ -5,6 +5,10 @@
#include "survive_types.h"
#include "poser.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
//DANGER: This structure may be redefined. Note that it is logically split into 64-bit chunks
//for optimization on 32- and 64-bit systems.
@@ -116,7 +120,7 @@ void survive_install_imu_fn( SurviveContext * ctx, imu_process_func fbp );
void survive_install_angle_fn( SurviveContext * ctx, angle_process_func fbp );
void survive_close( SurviveContext * ctx );
-int survive_poll();
+int survive_poll( SurviveContext * ctx );
SurviveObject * survive_get_so_by_name( SurviveContext * ctx, const char * name );
@@ -128,6 +132,9 @@ int survive_send_magic( SurviveContext * ctx, int magic_code, void * data, int d
//Install the calibrator.
void survive_cal_install( SurviveContext * ctx ); //XXX This will be removed if not already done so.
+// Read back a human-readable string description of the calibration status
+int survive_cal_get_status( struct SurviveContext * ctx, char * description, int description_length );
+
//Call these from your callback if overridden.
//Accept higher-level data.
void survive_default_light_process( SurviveObject * so, int sensor_id, int acode, int timeinsweep, uint32_t timecode, uint32_t length , uint32_t lh);
@@ -174,5 +181,9 @@ void handle_lightcap( SurviveObject * so, LightcapElement * le );
#define SV_ERROR( ... ) { char stbuff[1024]; sprintf( stbuff, __VA_ARGS__ ); ctx->faultfunction( ctx, stbuff ); }
#define SV_KILL() exit(0) //XXX This should likely be re-defined.
+#ifdef __cplusplus
+};
+#endif
+
#endif
diff --git a/include/libsurvive/survive_types.h b/include/libsurvive/survive_types.h
index bfd0b1d..224719e 100644
--- a/include/libsurvive/survive_types.h
+++ b/include/libsurvive/survive_types.h
@@ -1,6 +1,11 @@
#ifndef _SURVIVE_TYPES_H
#define _SURVIVE_TYPES_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#ifndef FLT
#ifdef USE_DOUBLE
#define FLT double
@@ -39,6 +44,9 @@ typedef int (*DeviceDriver)( SurviveContext * ctx );
typedef int (*DeviceDriverCb)( struct SurviveContext * ctx, void * driver );
typedef int (*DeviceDriverMagicCb)( struct SurviveContext * ctx, void * driver, int magic_code, void * data, int datalen );
+#ifdef __cplusplus
+};
+#endif
#endif