aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChuck <chun.hong.yoon@desy.de>2014-06-12 16:08:55 +0200
committerThomas White <taw@physics.org>2014-06-13 11:01:26 +0200
commit40d6969c7a05fe13c3883443d1c9feba6fab30d1 (patch)
tree23ee8a7247612d7860030a909bc4e1e33ba0c1f3
parent73629ee82c643769ddff3caa437f9e842f353b23 (diff)
Add extern "C" for C++ compatibility
-rw-r--r--libcrystfel/src/beam-parameters.h7
-rw-r--r--libcrystfel/src/cell-utils.h8
-rw-r--r--libcrystfel/src/cell.h8
-rw-r--r--libcrystfel/src/crystal.h7
-rw-r--r--libcrystfel/src/dirax.h8
-rw-r--r--libcrystfel/src/filters.h6
-rw-r--r--libcrystfel/src/grainspotter.h7
-rw-r--r--libcrystfel/src/hdf5-file.h7
-rw-r--r--libcrystfel/src/histogram.h7
-rw-r--r--libcrystfel/src/image.h7
-rw-r--r--libcrystfel/src/index.h7
-rw-r--r--libcrystfel/src/integer_matrix.h7
-rw-r--r--libcrystfel/src/integration.h8
-rw-r--r--libcrystfel/src/mosflm.h7
-rw-r--r--libcrystfel/src/peaks.h8
-rw-r--r--libcrystfel/src/reax.h9
-rw-r--r--libcrystfel/src/reflist-utils.h7
-rw-r--r--libcrystfel/src/reflist.h8
-rw-r--r--libcrystfel/src/render.h8
-rw-r--r--libcrystfel/src/statistics.h6
-rw-r--r--libcrystfel/src/stream.h7
-rw-r--r--libcrystfel/src/symmetry.h8
-rw-r--r--libcrystfel/src/thread-pool.h7
-rw-r--r--libcrystfel/src/utils.h7
-rw-r--r--libcrystfel/src/xds.h7
25 files changed, 182 insertions, 1 deletions
diff --git a/libcrystfel/src/beam-parameters.h b/libcrystfel/src/beam-parameters.h
index de777deb..bc3708d9 100644
--- a/libcrystfel/src/beam-parameters.h
+++ b/libcrystfel/src/beam-parameters.h
@@ -53,10 +53,17 @@ struct beam_params
double profile_radius; /* Reciprocal space size of a reflection */
};
+#ifdef __cplusplus
+extern "C" {
+#endif
extern struct beam_params *get_beam_parameters(const char *filename);
extern void free_beam_parameters(struct beam_params *beam);
extern void fill_in_beam_parameters(struct beam_params *beam, struct hdfile *f);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* BEAM_PARAMETERS_H */
diff --git a/libcrystfel/src/cell-utils.h b/libcrystfel/src/cell-utils.h
index 101edc41..00071c59 100644
--- a/libcrystfel/src/cell-utils.h
+++ b/libcrystfel/src/cell-utils.h
@@ -37,6 +37,10 @@
#include "cell.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern double resolution(UnitCell *cell,
signed int h, signed int k, signed int l);
@@ -69,4 +73,8 @@ extern LatticeType lattice_from_str(const char *s);
extern int forbidden_reflection(UnitCell *cell,
signed int h, signed int k, signed int l);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* CELL_UTILS_H */
diff --git a/libcrystfel/src/cell.h b/libcrystfel/src/cell.h
index 57741b41..0a512a43 100644
--- a/libcrystfel/src/cell.h
+++ b/libcrystfel/src/cell.h
@@ -99,6 +99,10 @@ typedef struct _unitcell UnitCell;
**/
typedef struct _unitcelltransformation UnitCellTransformation;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern UnitCell *cell_new(void);
extern UnitCell *cell_new_from_cell(UnitCell *orig);
extern void cell_free(UnitCell *cell);
@@ -171,4 +175,8 @@ extern UnitCellTransformation *tfn_inverse(UnitCellTransformation *t);
extern double *tfn_vector(double a, double b, double c);
extern void tfn_free(UnitCellTransformation *t);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* CELL_H */
diff --git a/libcrystfel/src/crystal.h b/libcrystfel/src/crystal.h
index 8c32a87d..11b85e35 100644
--- a/libcrystfel/src/crystal.h
+++ b/libcrystfel/src/crystal.h
@@ -46,6 +46,9 @@
**/
typedef struct _crystal Crystal;
+#ifdef __cplusplus
+extern "C" {
+#endif
extern Crystal *crystal_new(void);
extern Crystal *crystal_copy(Crystal *cryst);
@@ -72,4 +75,8 @@ extern void crystal_set_osf(Crystal *cryst, double osf);
extern void crystal_set_image(Crystal *cryst, struct image *image);
extern void crystal_set_mosaicity(Crystal *cryst, double m);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* CRYSTAL_H */
diff --git a/libcrystfel/src/dirax.h b/libcrystfel/src/dirax.h
index 1ac2f456..c2d8abdb 100644
--- a/libcrystfel/src/dirax.h
+++ b/libcrystfel/src/dirax.h
@@ -35,6 +35,10 @@
#include "index.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern int run_dirax(struct image *image, IndexingPrivate *ipriv);
extern IndexingPrivate *dirax_prepare(IndexingMethod *indm,
@@ -43,4 +47,8 @@ extern IndexingPrivate *dirax_prepare(IndexingMethod *indm,
extern void dirax_cleanup(IndexingPrivate *pp);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* DIRAX_H */
diff --git a/libcrystfel/src/filters.h b/libcrystfel/src/filters.h
index c8aeb52c..1d4f7bf0 100644
--- a/libcrystfel/src/filters.h
+++ b/libcrystfel/src/filters.h
@@ -33,10 +33,16 @@
#include <config.h>
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
extern void filter_cm(struct image *image);
extern void filter_noise(struct image *image);
extern void filter_median(struct image *image, int size);
+#ifdef __cplusplus
+}
+#endif
#endif /* FILTERS_H */
diff --git a/libcrystfel/src/grainspotter.h b/libcrystfel/src/grainspotter.h
index 2e308a1c..b6a83725 100644
--- a/libcrystfel/src/grainspotter.h
+++ b/libcrystfel/src/grainspotter.h
@@ -35,6 +35,10 @@
#include "cell.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern IndexingPrivate *grainspotter_prepare(IndexingMethod *indm,
UnitCell *cell,
struct detector *det,
@@ -45,5 +49,8 @@ extern void grainspotter_cleanup(IndexingPrivate *pp);
extern int grainspotter_index(struct image *image, IndexingPrivate *p);
+#ifdef __cplusplus
+}
+#endif
#endif /* GRAINSPOTTER_H */
diff --git a/libcrystfel/src/hdf5-file.h b/libcrystfel/src/hdf5-file.h
index 010abacc..aca00692 100644
--- a/libcrystfel/src/hdf5-file.h
+++ b/libcrystfel/src/hdf5-file.h
@@ -41,6 +41,10 @@ struct copy_hdf5_field;
#include "image.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern int hdf5_write(const char *filename, const void *data,
int width, int height, int type);
@@ -69,5 +73,8 @@ extern void copy_hdf5_fields(struct hdfile *f,
extern void add_copy_hdf5_field(struct copy_hdf5_field *copyme,
const char *name);
+#ifdef __cplusplus
+}
+#endif
#endif /* HDF5_H */
diff --git a/libcrystfel/src/histogram.h b/libcrystfel/src/histogram.h
index 815c2f76..c3ff27f7 100644
--- a/libcrystfel/src/histogram.h
+++ b/libcrystfel/src/histogram.h
@@ -33,6 +33,9 @@
#include <config.h>
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
typedef struct _histogram Histogram;
@@ -49,4 +52,8 @@ extern void histogram_set_min(Histogram *hi, double min);
extern void histogram_set_max(Histogram *hi, double max);
extern void histogram_set_num_bins(Histogram *hi, int n);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* HISTOGRAM_H */
diff --git a/libcrystfel/src/image.h b/libcrystfel/src/image.h
index 213bcfec..d8ffa0ff 100644
--- a/libcrystfel/src/image.h
+++ b/libcrystfel/src/image.h
@@ -179,6 +179,9 @@ struct image {
};
+#ifdef __cplusplus
+extern "C" {
+#endif
/* Feature lists */
extern ImageFeatureList *image_feature_list_new(void);
@@ -201,4 +204,8 @@ extern struct imagefeature *image_get_feature(ImageFeatureList *flist, int idx);
extern void image_add_crystal(struct image *image, Crystal *cryst);
extern void free_all_crystals(struct image *image);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* IMAGE_H */
diff --git a/libcrystfel/src/index.h b/libcrystfel/src/index.h
index 4149f789..76ecfad4 100644
--- a/libcrystfel/src/index.h
+++ b/libcrystfel/src/index.h
@@ -110,6 +110,9 @@ typedef enum {
* core of the indexing method */
#define INDEXING_METHOD_MASK (0xff)
+#ifdef __cplusplus
+extern "C" {
+#endif
/**
* IndexingPrivate:
@@ -136,4 +139,8 @@ extern void index_pattern(struct image *image,
extern void cleanup_indexing(IndexingMethod *indms, IndexingPrivate **privs);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* INDEX_H */
diff --git a/libcrystfel/src/integer_matrix.h b/libcrystfel/src/integer_matrix.h
index 2573bfec..e1ba2c56 100644
--- a/libcrystfel/src/integer_matrix.h
+++ b/libcrystfel/src/integer_matrix.h
@@ -40,6 +40,9 @@
**/
typedef struct _integermatrix IntegerMatrix;
+#ifdef __cplusplus
+extern "C" {
+#endif
/* Alloc/dealloc */
extern IntegerMatrix *intmat_new(unsigned int rows, unsigned int cols);
@@ -78,4 +81,8 @@ extern int intmat_equals(const IntegerMatrix *a, const IntegerMatrix *b);
/* Diagnostics */
extern void intmat_print(const IntegerMatrix *m);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* INTEGER_MATRIX_H */
diff --git a/libcrystfel/src/integration.h b/libcrystfel/src/integration.h
index 2c5773c6..84c1b900 100644
--- a/libcrystfel/src/integration.h
+++ b/libcrystfel/src/integration.h
@@ -80,6 +80,10 @@ typedef enum {
* core of the integration method */
#define INTEGRATION_METHOD_MASK (0xff)
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern IntegrationMethod integration_method(const char *t, int *err);
extern void integrate_all(struct image *image, IntegrationMethod meth,
@@ -94,4 +98,8 @@ extern void integrate_all_2(struct image *image, IntegrationMethod meth,
signed int idh, signed int idk, signed int idl);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* INTEGRATION_H */
diff --git a/libcrystfel/src/mosflm.h b/libcrystfel/src/mosflm.h
index 1288b131..40282cec 100644
--- a/libcrystfel/src/mosflm.h
+++ b/libcrystfel/src/mosflm.h
@@ -37,6 +37,9 @@
#include "index.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
extern int run_mosflm(struct image *image, IndexingPrivate *ipriv);
@@ -46,4 +49,8 @@ extern IndexingPrivate *mosflm_prepare(IndexingMethod *indm, UnitCell *cell,
extern void mosflm_cleanup(IndexingPrivate *pp);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* MOSFLM_H */
diff --git a/libcrystfel/src/peaks.h b/libcrystfel/src/peaks.h
index 433f7d1f..902a5177 100644
--- a/libcrystfel/src/peaks.h
+++ b/libcrystfel/src/peaks.h
@@ -38,6 +38,10 @@
#include "reflist.h"
#include "crystal.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern int *make_BgMask(struct image *image, struct panel *p, double ir_inn);
extern void search_peaks(struct image *image, float threshold,
@@ -58,4 +62,8 @@ extern int integrate_peak(struct image *image, int cfs, int css,
double ir_inn, double ir_mid, double ir_out,
int *bgPkMask, int *saturated);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* PEAKS_H */
diff --git a/libcrystfel/src/reax.h b/libcrystfel/src/reax.h
index 4720709e..b5c6d058 100644
--- a/libcrystfel/src/reax.h
+++ b/libcrystfel/src/reax.h
@@ -38,6 +38,10 @@
#include "beam-parameters.h"
#include "detector.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifdef HAVE_FFTW
extern IndexingPrivate *reax_prepare(IndexingMethod *indm, UnitCell *cell,
@@ -65,7 +69,10 @@ static int reax_index(IndexingPrivate *pp, struct image *image)
{
}
-
#endif /* HAVE_FFTW */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* REAX_H */
diff --git a/libcrystfel/src/reflist-utils.h b/libcrystfel/src/reflist-utils.h
index 9b3958fc..86f61bbf 100644
--- a/libcrystfel/src/reflist-utils.h
+++ b/libcrystfel/src/reflist-utils.h
@@ -38,6 +38,9 @@
#include "cell.h"
#include "symmetry.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
#define REFLECTION_END_MARKER "End of reflections"
@@ -68,4 +71,8 @@ extern RefList *res_cutoff(RefList *list, UnitCell *cell,
extern RefList *copy_reflist(RefList *list);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* REFLIST_UTILS_H */
diff --git a/libcrystfel/src/reflist.h b/libcrystfel/src/reflist.h
index 692b1d44..6892d7f2 100644
--- a/libcrystfel/src/reflist.h
+++ b/libcrystfel/src/reflist.h
@@ -69,6 +69,10 @@ typedef struct _reflection Reflection;
**/
typedef struct _reflistiterator RefListIterator;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Creation/deletion */
extern RefList *reflist_new(void);
extern void reflist_free(RefList *list);
@@ -134,4 +138,8 @@ extern int tree_depth(RefList *list);
extern void lock_reflection(Reflection *refl);
extern void unlock_reflection(Reflection *refl);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* REFLIST_H */
diff --git a/libcrystfel/src/render.h b/libcrystfel/src/render.h
index c49483dc..a4da922d 100644
--- a/libcrystfel/src/render.h
+++ b/libcrystfel/src/render.h
@@ -41,9 +41,17 @@ enum {
SCALE_RATIO
};
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Colour scale lookup */
extern void render_scale(double val, double max, int scale,
double *rp, double *gp, double *bp);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* RENDER_H */
diff --git a/libcrystfel/src/statistics.h b/libcrystfel/src/statistics.h
index 52ebc383..17338dad 100644
--- a/libcrystfel/src/statistics.h
+++ b/libcrystfel/src/statistics.h
@@ -33,6 +33,9 @@
#ifndef STATISTICS_H
#define STATISTICS_H
+#ifdef __cplusplus
+extern "C" {
+#endif
#include "reflist.h"
@@ -58,5 +61,8 @@ extern double stat_pearson_i(RefList *list1, RefList *list2);
extern double stat_pearson_f_zero(RefList *list1, RefList *list2);
extern double stat_pearson_f_ignore(RefList *list1, RefList *list2);
+#ifdef __cplusplus
+}
+#endif
#endif /* STATISTICS_H */
diff --git a/libcrystfel/src/stream.h b/libcrystfel/src/stream.h
index 78c27b44..d7108439 100644
--- a/libcrystfel/src/stream.h
+++ b/libcrystfel/src/stream.h
@@ -73,6 +73,9 @@ typedef enum {
} StreamReadFlags;
+#ifdef __cplusplus
+extern "C" {
+#endif
extern Stream *open_stream_for_read(const char *filename);
extern Stream *open_stream_for_write(const char *filename);
@@ -90,4 +93,8 @@ extern void write_command(Stream *st, int argc, char *argv[]);
extern int rewind_stream(Stream *st);
extern int is_stream(const char *filename);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* STREAM_H */
diff --git a/libcrystfel/src/symmetry.h b/libcrystfel/src/symmetry.h
index a16f523e..145b5473 100644
--- a/libcrystfel/src/symmetry.h
+++ b/libcrystfel/src/symmetry.h
@@ -55,6 +55,10 @@ typedef struct _symoplist SymOpList;
**/
typedef struct _symopmask SymOpMask;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern void free_symoplist(SymOpList *ops);
extern SymOpList *get_pointgroup(const char *sym);
@@ -86,4 +90,8 @@ extern int is_centric(signed int h, signed int k, signed int l,
extern void add_symop(SymOpList *ops, IntegerMatrix *m);
extern SymOpList *parse_symmetry_operations(const char *s);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* SYMMETRY_H */
diff --git a/libcrystfel/src/thread-pool.h b/libcrystfel/src/thread-pool.h
index 7f07f78d..5a305d5d 100644
--- a/libcrystfel/src/thread-pool.h
+++ b/libcrystfel/src/thread-pool.h
@@ -36,6 +36,10 @@
#include <pthread.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern pthread_mutex_t stderr_lock;
extern signed int get_status_label(void);
@@ -83,5 +87,8 @@ extern int run_threads(int n_threads, TPWorkFunc work,
void *queue_args, int max,
int cpu_num, int cpu_groupsize, int cpu_offset);
+#ifdef __cplusplus
+}
+#endif
#endif /* THREAD_POOL_H */
diff --git a/libcrystfel/src/utils.h b/libcrystfel/src/utils.h
index 81270916..4478f179 100644
--- a/libcrystfel/src/utils.h
+++ b/libcrystfel/src/utils.h
@@ -88,6 +88,10 @@ struct quaternion {
double z;
};
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern struct quaternion normalise_quaternion(struct quaternion q);
extern double quaternion_modulus(struct quaternion q);
extern struct quaternion random_quaternion(gsl_rng *rng);
@@ -257,5 +261,8 @@ extern pthread_mutex_t stderr_lock;
extern char *check_prefix(char *prefix);
extern char *safe_basename(const char *in);
+#ifdef __cplusplus
+}
+#endif
#endif /* UTILS_H */
diff --git a/libcrystfel/src/xds.h b/libcrystfel/src/xds.h
index dd0c3298..b42d8dbf 100644
--- a/libcrystfel/src/xds.h
+++ b/libcrystfel/src/xds.h
@@ -38,6 +38,9 @@
#include "cell.h"
#include "index.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
extern int run_xds(struct image *image, IndexingPrivate *ipriv);
@@ -47,4 +50,8 @@ extern IndexingPrivate *xds_prepare(IndexingMethod *indm, UnitCell *cell,
extern void xds_cleanup(IndexingPrivate *pp);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* XDS_H */