summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/md5.c34
-rw-r--r--src/lib/tng_io.c1047
2 files changed, 597 insertions, 484 deletions
diff --git a/src/lib/md5.c b/src/lib/md5.c
index 57c2138..8bd79b9 100644
--- a/src/lib/md5.c
+++ b/src/lib/md5.c
@@ -41,6 +41,18 @@
#define ARCH_IS_BIG_ENDIAN 0
#endif
+#ifndef USE_WINDOWS
+#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
+#define USE_WINDOWS
+#endif /* win32... */
+#endif /* not defined USE_WINDOWS */
+
+#ifdef USE_WINDOWS
+#define TNG_INLINE __inline
+#else
+#define TNG_INLINE inline
+#endif
+
/*
Copyright (C) 1999, 2000, 2002 Aladdin Enterprises. All rights reserved.
@@ -169,11 +181,7 @@
#define T63 0x2ad7d2bb
#define T64 /* 0xeb86d391 */ (T_MASK ^ 0x14792c6e)
-#ifdef USE_WINDOWS
-static inline void
-#else
-static __inline void
-#endif
+static TNG_INLINE void
md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/)
{
md5_word_t
@@ -355,8 +363,8 @@ md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/)
pms->abcd[3] += d;
}
-void
-md5_init(md5_state_t *pms)
+void DECLSPECDLLEXPORT
+tng_md5_init(md5_state_t *pms)
{
pms->count[0] = pms->count[1] = 0;
pms->abcd[0] = 0x67452301;
@@ -365,8 +373,8 @@ md5_init(md5_state_t *pms)
pms->abcd[3] = 0x10325476;
}
-void
-md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
+void DECLSPECDLLEXPORT
+tng_md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
{
const md5_byte_t *p = data;
int left = nbytes;
@@ -403,8 +411,8 @@ md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
memcpy(pms->buf, p, left);
}
-void
-md5_finish(md5_state_t *pms, md5_byte_t digest[16])
+void DECLSPECDLLEXPORT
+tng_md5_finish(md5_state_t *pms, md5_byte_t digest[16])
{
static const md5_byte_t pad[64] = {
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -419,9 +427,9 @@ md5_finish(md5_state_t *pms, md5_byte_t digest[16])
for (i = 0; i < 8; ++i)
data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3));
/* Pad to 56 bytes mod 64. */
- md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1);
+ tng_md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1);
/* Append the length. */
- md5_append(pms, data, 8);
+ tng_md5_append(pms, data, 8);
for (i = 0; i < 16; ++i)
digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3));
}
diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c
index 37b0b75..410fb7c 100644
--- a/src/lib/tng_io.c
+++ b/src/lib/tng_io.c
@@ -350,6 +350,19 @@ struct tng_trajectory {
int *compress_algo_vel;
};
+#ifndef USE_WINDOWS
+#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
+#define USE_WINDOWS
+#endif /* win32... */
+#endif /* not defined USE_WINDOWS */
+
+#ifdef USE_WINDOWS
+#define TNG_INLINE __inline
+#define TNG_SNPRINTF _snprintf
+#else
+#define TNG_INLINE inline
+#define TNG_SNPRINTF snprintf
+#endif
tng_function_status tng_util_trajectory_open(const char *filename,
const char mode,
@@ -562,6 +575,29 @@ tng_function_status tng_util_force_write(tng_trajectory_t tng_data,
{
}
+static TNG_INLINE int tng_min(int a, int b)
+{
+ int r=a;
+
+ if (b<a)
+ {
+ r=b;
+ }
+
+ return r;
+}
+
+static TNG_INLINE int tng_max(int a, int b)
+{
+ int r=a;
+
+ if (b>a)
+ {
+ r=b;
+ }
+
+ return r;
+}
/** This function swaps the byte order of a 32 bit numerical variable
* to big endian.
@@ -757,10 +793,10 @@ static tng_function_status tng_block_hash_generate(tng_gen_block_t block)
{
md5_state_t md5_state;
- md5_init(&md5_state);
- md5_append(&md5_state, (md5_byte_t *)block->block_contents,
+ tng_md5_init(&md5_state);
+ tng_md5_append(&md5_state, (md5_byte_t *)block->block_contents,
block->block_contents_size);
- md5_finish(&md5_state, (md5_byte_t *)block->hash);
+ tng_md5_finish(&md5_state, (md5_byte_t *)block->hash);
return(TNG_SUCCESS);
}
@@ -785,10 +821,10 @@ static tng_function_status hash_match_verify(tng_gen_block_t block,
*results = TNG_TRUE;
return(TNG_FAILURE);
}
- md5_init(&md5_state);
- md5_append(&md5_state, (md5_byte_t *)block->block_contents,
+ tng_md5_init(&md5_state);
+ tng_md5_append(&md5_state, (md5_byte_t *)block->block_contents,
block->block_contents_size);
- md5_finish(&md5_state, (md5_byte_t *)hash);
+ tng_md5_finish(&md5_state, (md5_byte_t *)hash);
if(strncmp(block->hash, hash, 16) != 0)
{
@@ -1044,7 +1080,7 @@ static tng_function_status tng_block_header_read
}
/* Move the reading position to the beginning of the header. */
- fseek(tng_data->input_file, -sizeof(block->header_contents_size),
+ fseek(tng_data->input_file, -(long)sizeof(block->header_contents_size),
SEEK_CUR);
/* If there is already memory allocated for the contents free it (we do not
@@ -6567,9 +6603,9 @@ static tng_function_status tng_atom_destroy(tng_atom_t atom)
return(TNG_SUCCESS);
}
-tng_function_status tng_molecule_add(tng_trajectory_t tng_data,
- const char *name,
- tng_molecule_t *molecule)
+tng_function_status DECLSPECDLLEXPORT tng_molecule_add(tng_trajectory_t tng_data,
+ const char *name,
+ tng_molecule_t *molecule)
{
tng_molecule_t new_molecules;
int64_t *new_molecule_cnt_list;
@@ -6639,9 +6675,9 @@ tng_function_status tng_molecule_add(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_molecule_name_set(tng_trajectory_t tng_data,
- tng_molecule_t molecule,
- const char *new_name)
+tng_function_status DECLSPECDLLEXPORT tng_molecule_name_set(tng_trajectory_t tng_data,
+ tng_molecule_t molecule,
+ const char *new_name)
{
int len;
@@ -6670,9 +6706,9 @@ tng_function_status tng_molecule_name_set(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_molecule_cnt_get(tng_trajectory_t tng_data,
- tng_molecule_t molecule,
- int64_t *cnt)
+tng_function_status DECLSPECDLLEXPORT tng_molecule_cnt_get(tng_trajectory_t tng_data,
+ tng_molecule_t molecule,
+ int64_t *cnt)
{
int i, index = -1;
@@ -6693,9 +6729,9 @@ tng_function_status tng_molecule_cnt_get(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_molecule_cnt_set(tng_trajectory_t tng_data,
- tng_molecule_t molecule,
- const int64_t cnt)
+tng_function_status DECLSPECDLLEXPORT tng_molecule_cnt_set(tng_trajectory_t tng_data,
+ tng_molecule_t molecule,
+ const int64_t cnt)
{
int i, index = -1, old_cnt;
@@ -6720,11 +6756,11 @@ tng_function_status tng_molecule_cnt_set(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_molecule_chain_find(tng_trajectory_t tng_data,
- tng_molecule_t molecule,
- const char *name,
- int64_t nr,
- tng_chain_t *chain)
+tng_function_status DECLSPECDLLEXPORT tng_molecule_chain_find(tng_trajectory_t tng_data,
+ tng_molecule_t molecule,
+ const char *name,
+ int64_t nr,
+ tng_chain_t *chain)
{
int i, n_chains;
@@ -6748,10 +6784,10 @@ tng_function_status tng_molecule_chain_find(tng_trajectory_t tng_data,
}
/* FIXME: For v. 2 the chain nr should also be possible to specify. */
-tng_function_status tng_molecule_chain_add(tng_trajectory_t tng_data,
- tng_molecule_t molecule,
- const char *name,
- tng_chain_t *chain)
+tng_function_status DECLSPECDLLEXPORT tng_molecule_chain_add(tng_trajectory_t tng_data,
+ tng_molecule_t molecule,
+ const char *name,
+ tng_chain_t *chain)
{
tng_chain_t new_chains;
@@ -6785,9 +6821,9 @@ tng_function_status tng_molecule_chain_add(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_chain_name_set(tng_trajectory_t tng_data,
- tng_chain_t chain,
- const char *new_name)
+tng_function_status DECLSPECDLLEXPORT tng_chain_name_set(tng_trajectory_t tng_data,
+ tng_chain_t chain,
+ const char *new_name)
{
int len;
@@ -6816,11 +6852,11 @@ tng_function_status tng_chain_name_set(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_chain_residue_find(tng_trajectory_t tng_data,
- tng_chain_t chain,
- const char *name,
- int64_t nr,
- tng_residue_t *residue)
+tng_function_status DECLSPECDLLEXPORT tng_chain_residue_find(tng_trajectory_t tng_data,
+ tng_chain_t chain,
+ const char *name,
+ int64_t nr,
+ tng_residue_t *residue)
{
int i, n_residues;
@@ -6844,10 +6880,10 @@ tng_function_status tng_chain_residue_find(tng_trajectory_t tng_data,
}
/* FIXME: For v. 2 the residue nr should also be possible to specify. */
-tng_function_status tng_chain_residue_add(tng_trajectory_t tng_data,
- tng_chain_t chain,
- const char *name,
- tng_residue_t *residue)
+tng_function_status DECLSPECDLLEXPORT tng_chain_residue_add(tng_trajectory_t tng_data,
+ tng_chain_t chain,
+ const char *name,
+ tng_residue_t *residue)
{
int curr_index;
tng_residue_t new_residues, temp_residue, last_residue;
@@ -6922,9 +6958,9 @@ tng_function_status tng_chain_residue_add(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_residue_name_set(tng_trajectory_t tng_data,
- tng_residue_t residue,
- const char *new_name)
+tng_function_status DECLSPECDLLEXPORT tng_residue_name_set(tng_trajectory_t tng_data,
+ tng_residue_t residue,
+ const char *new_name)
{
int len;
@@ -6954,11 +6990,11 @@ tng_function_status tng_residue_name_set(tng_trajectory_t tng_data,
}
/* FIXME: For v. 2 the atom nr should also be possible to specify. */
-tng_function_status tng_residue_atom_add(tng_trajectory_t tng_data,
- tng_residue_t residue,
- const char *atom_name,
- const char *atom_type,
- tng_atom_t *atom)
+tng_function_status DECLSPECDLLEXPORT tng_residue_atom_add(tng_trajectory_t tng_data,
+ tng_residue_t residue,
+ const char *atom_name,
+ const char *atom_type,
+ tng_atom_t *atom)
{
tng_atom_t new_atoms;
tng_molecule_t molecule = residue->chain->molecule;
@@ -7000,8 +7036,8 @@ tng_function_status tng_residue_atom_add(tng_trajectory_t tng_data,
}
-tng_function_status tng_molecule_init(const tng_trajectory_t tng_data,
- tng_molecule_t molecule)
+tng_function_status DECLSPECDLLEXPORT tng_molecule_init(const tng_trajectory_t tng_data,
+ tng_molecule_t molecule)
{
molecule->quaternary_str = 1;
molecule->name = 0;
@@ -7017,8 +7053,8 @@ tng_function_status tng_molecule_init(const tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_molecule_destroy(const tng_trajectory_t tng_data,
- tng_molecule_t molecule)
+tng_function_status DECLSPECDLLEXPORT tng_molecule_destroy(const tng_trajectory_t tng_data,
+ tng_molecule_t molecule)
{
int i;
@@ -7079,7 +7115,7 @@ tng_function_status tng_molecule_destroy(const tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_molecule_name_of_particle_nr_get
+tng_function_status DECLSPECDLLEXPORT tng_molecule_name_of_particle_nr_get
(const tng_trajectory_t tng_data,
const int64_t nr,
char *name,
@@ -7125,7 +7161,7 @@ tng_function_status tng_molecule_name_of_particle_nr_get
return(TNG_SUCCESS);
}
-tng_function_status tng_chain_name_of_particle_nr_get
+tng_function_status DECLSPECDLLEXPORT tng_chain_name_of_particle_nr_get
(const tng_trajectory_t tng_data,
const int64_t nr,
char *name,
@@ -7177,7 +7213,7 @@ tng_function_status tng_chain_name_of_particle_nr_get
return(TNG_SUCCESS);
}
-tng_function_status tng_residue_name_of_particle_nr_get
+tng_function_status DECLSPECDLLEXPORT tng_residue_name_of_particle_nr_get
(const tng_trajectory_t tng_data,
const int64_t nr,
char *name,
@@ -7229,7 +7265,7 @@ tng_function_status tng_residue_name_of_particle_nr_get
return(TNG_SUCCESS);
}
-tng_function_status tng_atom_name_of_particle_nr_get
+tng_function_status DECLSPECDLLEXPORT tng_atom_name_of_particle_nr_get
(const tng_trajectory_t tng_data,
const int64_t nr,
char *name,
@@ -7325,7 +7361,7 @@ tng_function_status tng_atom_type_of_particle_nr_get
return(TNG_SUCCESS);
}
-tng_function_status tng_particle_mapping_add
+tng_function_status DECLSPECDLLEXPORT tng_particle_mapping_add
(tng_trajectory_t tng_data,
const int64_t num_first_particle,
const int64_t n_particles,
@@ -7409,7 +7445,7 @@ tng_function_status tng_particle_mapping_add
return(TNG_SUCCESS);
}
-tng_function_status tng_trajectory_init(tng_trajectory_t *tng_data_p)
+tng_function_status DECLSPECDLLEXPORT tng_trajectory_init(tng_trajectory_t *tng_data_p)
{
time_t seconds;
tng_trajectory_frame_set_t frame_set;
@@ -7500,56 +7536,59 @@ tng_function_status tng_trajectory_init(tng_trajectory_t *tng_data_p)
tng_data->molecule_cnt_list = 0;
tng_data->n_particles = 0;
- /* Check the endianness of the computer */
- static int32_t endianness_32 = 0x01234567;
- /* 0x01234567 */
- if ( *(const uint8_t*)&endianness_32 == 0x01 )
{
- tng_data->endianness_32 = TNG_BIG_ENDIAN_32;
- }
+ /* Check the endianness of the computer */
+ static int32_t endianness_32 = 0x01234567;
+ /* 0x01234567 */
+ if ( *(const uint8_t*)&endianness_32 == 0x01 )
+ {
+ tng_data->endianness_32 = TNG_BIG_ENDIAN_32;
+ }
- /* 0x67452301 */
- else if( *(const uint8_t*)&endianness_32 == 0x67 )
- {
- tng_data->endianness_32 = TNG_LITTLE_ENDIAN_32;
+ /* 0x67452301 */
+ else if( *(const uint8_t*)&endianness_32 == 0x67 )
+ {
+ tng_data->endianness_32 = TNG_LITTLE_ENDIAN_32;
- }
+ }
- /* 0x45670123 */
- else if ( *(const uint8_t*)&endianness_32 == 0x45 )
- {
- tng_data->endianness_32 = TNG_BYTE_PAIR_SWAP_32;
+ /* 0x45670123 */
+ else if ( *(const uint8_t*)&endianness_32 == 0x45 )
+ {
+ tng_data->endianness_32 = TNG_BYTE_PAIR_SWAP_32;
+ }
}
-
- static int64_t endianness_64 = 0x0123456789ABCDEF;
- /* 0x0123456789ABCDEF */
- if ( *(const uint8_t*)&endianness_64 == 0x01 )
{
- tng_data->endianness_64 = TNG_BIG_ENDIAN_64;
- }
+ static int64_t endianness_64 = 0x0123456789ABCDEF;
+ /* 0x0123456789ABCDEF */
+ if ( *(const uint8_t*)&endianness_64 == 0x01 )
+ {
+ tng_data->endianness_64 = TNG_BIG_ENDIAN_64;
+ }
- /* 0xEFCDAB8967452301 */
- else if ( *(const uint8_t*)&endianness_64 == 0xEF )
- {
- tng_data->endianness_64 = TNG_LITTLE_ENDIAN_64;
- }
+ /* 0xEFCDAB8967452301 */
+ else if ( *(const uint8_t*)&endianness_64 == 0xEF )
+ {
+ tng_data->endianness_64 = TNG_LITTLE_ENDIAN_64;
+ }
- /* 0x89ABCDEF01234567 */
- else if ( *(const uint8_t*)&endianness_64 == 0x89 )
- {
- tng_data->endianness_64 = TNG_QUAD_SWAP_64;
- }
+ /* 0x89ABCDEF01234567 */
+ else if ( *(const uint8_t*)&endianness_64 == 0x89 )
+ {
+ tng_data->endianness_64 = TNG_QUAD_SWAP_64;
+ }
- /* 0x45670123CDEF89AB */
- else if ( *(const uint8_t*)&endianness_64 == 0x45 )
- {
- tng_data->endianness_64 = TNG_BYTE_PAIR_SWAP_64;
- }
+ /* 0x45670123CDEF89AB */
+ else if ( *(const uint8_t*)&endianness_64 == 0x45 )
+ {
+ tng_data->endianness_64 = TNG_BYTE_PAIR_SWAP_64;
+ }
- /* 0x23016745AB89EFCD */
- else if ( *(const uint8_t*)&endianness_64 == 0x23 )
- {
- tng_data->endianness_64 = TNG_BYTE_SWAP_64;
+ /* 0x23016745AB89EFCD */
+ else if ( *(const uint8_t*)&endianness_64 == 0x23 )
+ {
+ tng_data->endianness_64 = TNG_BYTE_SWAP_64;
+ }
}
/* By default do not swap the byte order, i.e. keep the byte order of the
@@ -7568,7 +7607,7 @@ tng_function_status tng_trajectory_init(tng_trajectory_t *tng_data_p)
return(TNG_SUCCESS);
}
-tng_function_status tng_trajectory_destroy(tng_trajectory_t *tng_data_p)
+tng_function_status DECLSPECDLLEXPORT tng_trajectory_destroy(tng_trajectory_t *tng_data_p)
{
int i, j, k, l;
int64_t n_particles, n_values_per_frame;
@@ -7929,7 +7968,7 @@ tng_function_status tng_trajectory_destroy(tng_trajectory_t *tng_data_p)
return(TNG_SUCCESS);
}
-tng_function_status tng_trajectory_init_from_src(tng_trajectory_t src,
+tng_function_status DECLSPECDLLEXPORT tng_trajectory_init_from_src(tng_trajectory_t src,
tng_trajectory_t *dest_p)
{
tng_trajectory_frame_set_t frame_set;
@@ -8044,7 +8083,7 @@ tng_function_status tng_trajectory_init_from_src(tng_trajectory_t src,
return(TNG_SUCCESS);
}
-tng_function_status tng_input_file_get(const tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_input_file_get(const tng_trajectory_t tng_data,
char *file_name, const int max_len)
{
strncpy(file_name, tng_data->input_file_path, max_len - 1);
@@ -8057,8 +8096,8 @@ tng_function_status tng_input_file_get(const tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_input_file_set(tng_trajectory_t tng_data,
- const char *file_name)
+tng_function_status DECLSPECDLLEXPORT tng_input_file_set(tng_trajectory_t tng_data,
+ const char *file_name)
{
int len;
char *temp;
@@ -8103,8 +8142,8 @@ tng_function_status tng_output_file_get(const tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_output_file_set(tng_trajectory_t tng_data,
- const char *file_name)
+tng_function_status DECLSPECDLLEXPORT tng_output_file_set(tng_trajectory_t tng_data,
+ const char *file_name)
{
int len;
char *temp;
@@ -8136,7 +8175,7 @@ tng_function_status tng_output_file_set(tng_trajectory_t tng_data,
return(tng_output_file_init(tng_data));
}
-tng_function_status tng_output_file_endianness_get
+tng_function_status DECLSPECDLLEXPORT tng_output_file_endianness_get
(tng_trajectory_t tng_data, tng_file_endianness *endianness)
{
tng_endianness_32 end_32;
@@ -8210,7 +8249,7 @@ tng_function_status tng_output_file_endianness_get
return(TNG_SUCCESS);
}
-tng_function_status tng_output_file_endianness_set
+tng_function_status DECLSPECDLLEXPORT tng_output_file_endianness_set
(tng_trajectory_t tng_data,
const tng_file_endianness endianness)
{
@@ -8271,8 +8310,9 @@ tng_function_status tng_output_file_endianness_set
return(TNG_FAILURE);
}
-tng_function_status tng_first_program_name_get(const tng_trajectory_t tng_data,
- char *name, const int max_len)
+tng_function_status DECLSPECDLLEXPORT tng_first_program_name_get
+ (const tng_trajectory_t tng_data,
+ char *name, const int max_len)
{
strncpy(name, tng_data->first_program_name, max_len - 1);
name[max_len - 1] = 0;
@@ -8284,8 +8324,8 @@ tng_function_status tng_first_program_name_get(const tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_first_program_name_set(tng_trajectory_t tng_data,
- const char *new_name)
+tng_function_status DECLSPECDLLEXPORT tng_first_program_name_set(tng_trajectory_t tng_data,
+ const char *new_name)
{
int len;
@@ -8312,8 +8352,9 @@ tng_function_status tng_first_program_name_set(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_last_program_name_get(const tng_trajectory_t tng_data,
- char *name, const int max_len)
+tng_function_status DECLSPECDLLEXPORT tng_last_program_name_get
+ (const tng_trajectory_t tng_data,
+ char *name, const int max_len)
{
strncpy(name, tng_data->last_program_name, max_len - 1);
name[max_len - 1] = 0;
@@ -8325,8 +8366,9 @@ tng_function_status tng_last_program_name_get(const tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_last_program_name_set(tng_trajectory_t tng_data,
- const char *new_name)
+tng_function_status DECLSPECDLLEXPORT tng_last_program_name_set
+ (tng_trajectory_t tng_data,
+ const char *new_name)
{
int len;
@@ -8353,8 +8395,9 @@ tng_function_status tng_last_program_name_set(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_first_user_name_get(const tng_trajectory_t tng_data,
- char *name, const int max_len)
+tng_function_status DECLSPECDLLEXPORT tng_first_user_name_get
+ (const tng_trajectory_t tng_data,
+ char *name, const int max_len)
{
strncpy(name, tng_data->first_user_name, max_len - 1);
name[max_len - 1] = 0;
@@ -8366,8 +8409,9 @@ tng_function_status tng_first_user_name_get(const tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_first_user_name_set(tng_trajectory_t tng_data,
- const char *new_name)
+tng_function_status DECLSPECDLLEXPORT tng_first_user_name_set
+ (tng_trajectory_t tng_data,
+ const char *new_name)
{
int len;
@@ -8396,8 +8440,9 @@ tng_function_status tng_first_user_name_set(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_last_user_name_get(const tng_trajectory_t tng_data,
- char *name, const int max_len)
+tng_function_status DECLSPECDLLEXPORT tng_last_user_name_get
+ (const tng_trajectory_t tng_data,
+ char *name, const int max_len)
{
strncpy(name, tng_data->last_user_name, max_len - 1);
name[max_len - 1] = 0;
@@ -8409,8 +8454,9 @@ tng_function_status tng_last_user_name_get(const tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_last_user_name_set(tng_trajectory_t tng_data,
- const char *new_name)
+tng_function_status DECLSPECDLLEXPORT tng_last_user_name_set
+ (tng_trajectory_t tng_data,
+ const char *new_name)
{
int len;
@@ -8439,8 +8485,9 @@ tng_function_status tng_last_user_name_set(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_first_computer_name_get(const tng_trajectory_t tng_data,
- char *name, const int max_len)
+tng_function_status DECLSPECDLLEXPORT tng_first_computer_name_get
+ (const tng_trajectory_t tng_data,
+ char *name, const int max_len)
{
strncpy(name, tng_data->first_computer_name, max_len - 1);
name[max_len - 1] = 0;
@@ -8452,8 +8499,9 @@ tng_function_status tng_first_computer_name_get(const tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_first_computer_name_set(tng_trajectory_t tng_data,
- const char *new_name)
+tng_function_status DECLSPECDLLEXPORT tng_first_computer_name_set
+ (tng_trajectory_t tng_data,
+ const char *new_name)
{
int len;
@@ -8482,8 +8530,9 @@ tng_function_status tng_first_computer_name_set(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_last_computer_name_get(const tng_trajectory_t tng_data,
- char *name, const int max_len)
+tng_function_status DECLSPECDLLEXPORT tng_last_computer_name_get
+ (const tng_trajectory_t tng_data,
+ char *name, const int max_len)
{
strncpy(name, tng_data->last_computer_name, max_len - 1);
name[max_len - 1] = 0;
@@ -8495,8 +8544,9 @@ tng_function_status tng_last_computer_name_get(const tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_last_computer_name_set(tng_trajectory_t tng_data,
- const char *new_name)
+tng_function_status DECLSPECDLLEXPORT tng_last_computer_name_set
+ (tng_trajectory_t tng_data,
+ const char *new_name)
{
int len;
@@ -8526,8 +8576,9 @@ tng_function_status tng_last_computer_name_set(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_first_signature_get(const tng_trajectory_t tng_data,
- char *signature, const int max_len)
+tng_function_status DECLSPECDLLEXPORT tng_first_signature_get
+ (const tng_trajectory_t tng_data,
+ char *signature, const int max_len)
{
strncpy(signature, tng_data->first_pgp_signature, max_len - 1);
signature[max_len - 1] = 0;
@@ -8539,8 +8590,9 @@ tng_function_status tng_first_signature_get(const tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_first_signature_set(tng_trajectory_t tng_data,
- const char *signature)
+tng_function_status DECLSPECDLLEXPORT tng_first_signature_set
+ (tng_trajectory_t tng_data,
+ const char *signature)
{
int len;
@@ -8570,8 +8622,9 @@ tng_function_status tng_first_signature_set(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_last_signature_get(const tng_trajectory_t tng_data,
- char *signature, const int max_len)
+tng_function_status DECLSPECDLLEXPORT tng_last_signature_get
+ (const tng_trajectory_t tng_data,
+ char *signature, const int max_len)
{
strncpy(signature, tng_data->last_pgp_signature, max_len - 1);
signature[max_len - 1] = 0;
@@ -8583,8 +8636,9 @@ tng_function_status tng_last_signature_get(const tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_last_signature_set(tng_trajectory_t tng_data,
- const char *signature)
+tng_function_status DECLSPECDLLEXPORT tng_last_signature_set
+ (tng_trajectory_t tng_data,
+ const char *signature)
{
int len;
@@ -8614,8 +8668,9 @@ tng_function_status tng_last_signature_set(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_forcefield_name_get(const tng_trajectory_t tng_data,
- char *name, const int max_len)
+tng_function_status DECLSPECDLLEXPORT tng_forcefield_name_get
+ (const tng_trajectory_t tng_data,
+ char *name, const int max_len)
{
strncpy(name, tng_data->forcefield_name, max_len - 1);
name[max_len - 1] = 0;
@@ -8627,8 +8682,9 @@ tng_function_status tng_forcefield_name_get(const tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_forcefield_name_set(tng_trajectory_t tng_data,
- const char *new_name)
+tng_function_status DECLSPECDLLEXPORT tng_forcefield_name_set
+ (tng_trajectory_t tng_data,
+ const char *new_name)
{
int len;
@@ -8657,16 +8713,18 @@ tng_function_status tng_forcefield_name_set(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_medium_stride_length_get(const tng_trajectory_t tng_data,
- int64_t *len)
+tng_function_status DECLSPECDLLEXPORT tng_medium_stride_length_get
+ (const tng_trajectory_t tng_data,
+ int64_t *len)
{
*len = tng_data->medium_stride_length;
return(TNG_SUCCESS);
}
-tng_function_status tng_medium_stride_length_set(tng_trajectory_t tng_data,
- const int64_t len)
+tng_function_status DECLSPECDLLEXPORT tng_medium_stride_length_set
+ (tng_trajectory_t tng_data,
+ const int64_t len)
{
if(len >= tng_data->long_stride_length)
{
@@ -8677,16 +8735,18 @@ tng_function_status tng_medium_stride_length_set(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_long_stride_length_get(const tng_trajectory_t tng_data,
- int64_t *len)
+tng_function_status DECLSPECDLLEXPORT tng_long_stride_length_get
+ (const tng_trajectory_t tng_data,
+ int64_t *len)
{
*len = tng_data->long_stride_length;
return(TNG_SUCCESS);
}
-tng_function_status tng_long_stride_length_set(tng_trajectory_t tng_data,
- const int64_t len)
+tng_function_status DECLSPECDLLEXPORT tng_long_stride_length_set
+ (tng_trajectory_t tng_data,
+ const int64_t len)
{
if(len <= tng_data->medium_stride_length)
{
@@ -8697,16 +8757,18 @@ tng_function_status tng_long_stride_length_set(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_input_file_len_get(const tng_trajectory_t tng_data,
- int64_t *len)
+tng_function_status DECLSPECDLLEXPORT tng_input_file_len_get
+ (const tng_trajectory_t tng_data,
+ int64_t *len)
{
*len = tng_data->input_file_len;
return(TNG_SUCCESS);
}
-tng_function_status tng_num_frames_get(const tng_trajectory_t tng_data,
- int64_t *n)
+tng_function_status DECLSPECDLLEXPORT tng_num_frames_get
+ (const tng_trajectory_t tng_data,
+ int64_t *n)
{
tng_gen_block_t block;
tng_function_status stat;
@@ -8749,8 +8811,9 @@ tng_function_status tng_num_frames_get(const tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_num_particles_get(const tng_trajectory_t tng_data,
- int64_t *n)
+tng_function_status DECLSPECDLLEXPORT tng_num_particles_get
+ (const tng_trajectory_t tng_data,
+ int64_t *n)
{
if(tng_data->var_num_atoms_flag == TNG_CONSTANT_N_ATOMS)
{
@@ -8764,8 +8827,9 @@ tng_function_status tng_num_particles_get(const tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_num_molecules_get(const tng_trajectory_t tng_data,
- int64_t *n)
+tng_function_status DECLSPECDLLEXPORT tng_num_molecules_get
+ (const tng_trajectory_t tng_data,
+ int64_t *n)
{
int64_t *cnt_list, cnt = 0, i;
@@ -8788,7 +8852,7 @@ tng_function_status tng_num_molecules_get(const tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_num_frames_per_frame_set_get
+tng_function_status DECLSPECDLLEXPORT tng_num_frames_per_frame_set_get
(const tng_trajectory_t tng_data,
int64_t *n)
{
@@ -8797,7 +8861,7 @@ tng_function_status tng_num_frames_per_frame_set_get
return(TNG_SUCCESS);
}
-tng_function_status tng_num_frames_per_frame_set_set
+tng_function_status DECLSPECDLLEXPORT tng_num_frames_per_frame_set_set
(const tng_trajectory_t tng_data,
const int64_t n)
{
@@ -8806,8 +8870,9 @@ tng_function_status tng_num_frames_per_frame_set_set
return(TNG_SUCCESS);
}
-tng_function_status tng_num_frame_sets_get(const tng_trajectory_t tng_data,
- int64_t *n)
+tng_function_status DECLSPECDLLEXPORT tng_num_frame_sets_get
+ (const tng_trajectory_t tng_data,
+ int64_t *n)
{
int64_t long_stride_length, medium_stride_length;
int64_t file_pos;
@@ -8945,7 +9010,7 @@ tng_function_status tng_num_frame_sets_get(const tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_current_frame_set_get
+tng_function_status DECLSPECDLLEXPORT tng_current_frame_set_get
(tng_trajectory_t tng_data,
tng_trajectory_frame_set_t *frame_set_p)
{
@@ -8954,8 +9019,9 @@ tng_function_status tng_current_frame_set_get
return(TNG_SUCCESS);
}
-tng_function_status tng_frame_set_nr_find(tng_trajectory_t tng_data,
- const int64_t nr)
+tng_function_status DECLSPECDLLEXPORT tng_frame_set_nr_find
+ (tng_trajectory_t tng_data,
+ const int64_t nr)
{
int64_t long_stride_length, medium_stride_length;
int64_t file_pos, curr_nr = 0, n_frame_sets;
@@ -9268,8 +9334,9 @@ tng_function_status tng_frame_set_nr_find(tng_trajectory_t tng_data,
return(TNG_FAILURE);
}
-tng_function_status tng_frame_set_of_frame_find(tng_trajectory_t tng_data,
- const int64_t frame)
+tng_function_status DECLSPECDLLEXPORT tng_frame_set_of_frame_find
+ (tng_trajectory_t tng_data,
+ const int64_t frame)
{
int64_t first_frame, last_frame, n_frames_per_frame_set;
int64_t long_stride_length, medium_stride_length;
@@ -9609,7 +9676,7 @@ tng_function_status tng_frame_set_of_frame_find(tng_trajectory_t tng_data,
return(TNG_FAILURE);
}
-tng_function_status tng_frame_set_next_frame_set_file_pos_get
+tng_function_status DECLSPECDLLEXPORT tng_frame_set_next_frame_set_file_pos_get
(const tng_trajectory_t tng_data,
const tng_trajectory_frame_set_t frame_set,
int64_t *pos)
@@ -9619,7 +9686,7 @@ tng_function_status tng_frame_set_next_frame_set_file_pos_get
return(TNG_SUCCESS);
}
-tng_function_status tng_frame_set_prev_frame_set_file_pos_get
+tng_function_status DECLSPECDLLEXPORT tng_frame_set_prev_frame_set_file_pos_get
(const tng_trajectory_t tng_data,
const tng_trajectory_frame_set_t frame_set,
int64_t *pos)
@@ -9629,7 +9696,7 @@ tng_function_status tng_frame_set_prev_frame_set_file_pos_get
return(TNG_SUCCESS);
}
-tng_function_status tng_frame_set_frame_range_get
+tng_function_status DECLSPECDLLEXPORT tng_frame_set_frame_range_get
(const tng_trajectory_t tng_data,
const tng_trajectory_frame_set_t frame_set,
int64_t *first_frame,
@@ -9649,7 +9716,7 @@ tng_function_status tng_frame_set_frame_range_get
* @return TNG_SUCCESS (0) if successful or TNG_FAILURE (1) if the mapping
* cannot be found.
*/
-static inline tng_function_status tng_particle_mapping_get_real_particle
+static TNG_INLINE tng_function_status tng_particle_mapping_get_real_particle
(const tng_trajectory_frame_set_t frame_set,
const int64_t local,
int64_t *real)
@@ -9685,7 +9752,7 @@ static inline tng_function_status tng_particle_mapping_get_real_particle
* @return TNG_SUCCESS (0) if successful or TNG_FAILURE (1) if the mapping
* cannot be found.
*/
-static inline tng_function_status tng_particle_mapping_get_local_particle
+static TNG_INLINE tng_function_status tng_particle_mapping_get_local_particle
(const tng_trajectory_frame_set_t frame_set,
const int64_t real,
int64_t *local)
@@ -9713,7 +9780,7 @@ static inline tng_function_status tng_particle_mapping_get_local_particle
}
-tng_function_status tng_file_headers_read(tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_file_headers_read(tng_trajectory_t tng_data,
const tng_hash_mode hash_mode)
{
int cnt = 0, prev_pos = 0;
@@ -9760,7 +9827,7 @@ tng_function_status tng_file_headers_read(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_file_headers_write(tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_file_headers_write(tng_trajectory_t tng_data,
const tng_hash_mode hash_mode)
{
int i;
@@ -9810,7 +9877,7 @@ tng_function_status tng_file_headers_write(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_block_read_next(tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_block_read_next(tng_trajectory_t tng_data,
tng_gen_block_t block,
const tng_hash_mode hash_mode)
{
@@ -9839,7 +9906,7 @@ tng_function_status tng_block_read_next(tng_trajectory_t tng_data,
}
-tng_function_status tng_frame_set_read_next(tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_frame_set_read_next(tng_trajectory_t tng_data,
const tng_hash_mode hash_mode)
{
long int file_pos;
@@ -10013,9 +10080,10 @@ tng_function_status tng_frame_set_write(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_frame_set_new(tng_trajectory_t tng_data,
- const int64_t first_frame,
- const int64_t n_frames)
+tng_function_status DECLSPECDLLEXPORT tng_frame_set_new
+ (tng_trajectory_t tng_data,
+ const int64_t first_frame,
+ const int64_t n_frames)
{
int i;
tng_gen_block_t block;
@@ -10205,22 +10273,24 @@ tng_function_status tng_frame_set_new(tng_trajectory_t tng_data,
-tng_function_status tng_data_block_add(tng_trajectory_t tng_data,
- const int64_t id,
- const char *block_name,
- const tng_data_type datatype,
- const tng_block_type block_type_flag,
- int64_t n_frames,
- const int64_t n_values_per_frame,
- int64_t stride_length,
- const int64_t codec_id,
- void *new_data)
+tng_function_status DECLSPECDLLEXPORT tng_data_block_add
+ (tng_trajectory_t tng_data,
+ const int64_t id,
+ const char *block_name,
+ const tng_data_type datatype,
+ const tng_block_type block_type_flag,
+ int64_t n_frames,
+ const int64_t n_values_per_frame,
+ int64_t stride_length,
+ const int64_t codec_id,
+ void *new_data)
{
int i, j, block_index, size, len;
tng_trajectory_frame_set_t frame_set;
tng_non_particle_data_t data;
char **first_dim_values;
void *orig;
+ char *new_data_c=new_data;
frame_set = &tng_data->current_trajectory_frame_set;
@@ -10312,7 +10382,7 @@ tng_function_status tng_data_block_add(tng_trajectory_t tng_data,
break;
}
- if(new_data)
+ if(new_data_c)
{
/* Allocate memory */
if(tng_allocate_data_mem(tng_data, data, n_frames, stride_length,
@@ -10324,7 +10394,7 @@ tng_function_status tng_data_block_add(tng_trajectory_t tng_data,
return(TNG_CRITICAL);
}
- orig = new_data;
+ orig = new_data_c;
if(n_frames > frame_set->n_written_frames)
{
@@ -10338,7 +10408,7 @@ tng_function_status tng_data_block_add(tng_trajectory_t tng_data,
first_dim_values = data->strings[i];
for(j = 0; j < n_values_per_frame; j++)
{
- len = tng_min(strlen(new_data) + 1,
+ len = tng_min(strlen(new_data_c) + 1,
TNG_MAX_STR_LEN);
if(first_dim_values[j])
{
@@ -10352,7 +10422,7 @@ tng_function_status tng_data_block_add(tng_trajectory_t tng_data,
return(TNG_CRITICAL);
}
strncpy(first_dim_values[j],
- new_data, len);
+ new_data_c, len);
new_data += len;
}
}
@@ -10362,32 +10432,32 @@ tng_function_status tng_data_block_add(tng_trajectory_t tng_data,
memcpy(data->values, new_data, size * n_frames / stride_length *
n_values_per_frame);
}
-
- new_data = orig;
}
return(TNG_SUCCESS);
}
-tng_function_status tng_particle_data_block_add(tng_trajectory_t tng_data,
- const int64_t id,
- const char *block_name,
- const tng_data_type datatype,
- const tng_block_type block_type_flag,
- int64_t n_frames,
- const int64_t n_values_per_frame,
- int64_t stride_length,
- const int64_t num_first_particle,
- const int64_t n_particles,
- const int64_t codec_id,
- void *new_data)
+tng_function_status DECLSPECDLLEXPORT tng_particle_data_block_add
+ (tng_trajectory_t tng_data,
+ const int64_t id,
+ const char *block_name,
+ const tng_data_type datatype,
+ const tng_block_type block_type_flag,
+ int64_t n_frames,
+ const int64_t n_values_per_frame,
+ int64_t stride_length,
+ const int64_t num_first_particle,
+ const int64_t n_particles,
+ const int64_t codec_id,
+ void *new_data)
{
int i, j, k, block_index, size, len;
int64_t tot_n_particles;
char ***first_dim_values, **second_dim_values;
tng_trajectory_frame_set_t frame_set;
tng_particle_data_t data;
- void *orig;
+ char *orig;
+ char *new_data_c=new_data;
frame_set = &tng_data->current_trajectory_frame_set;
@@ -10477,7 +10547,7 @@ tng_function_status tng_particle_data_block_add(tng_trajectory_t tng_data,
}
/* If data values are supplied add that data to the data block. */
- if(new_data)
+ if(new_data_c)
{
/* Allocate memory */
if(tng_allocate_particle_data_mem(tng_data, data, n_frames,
@@ -10490,7 +10560,7 @@ tng_function_status tng_particle_data_block_add(tng_trajectory_t tng_data,
return(TNG_CRITICAL);
}
- orig = new_data;
+ orig = new_data_c;
if(n_frames > frame_set->n_written_frames)
{
@@ -10508,7 +10578,7 @@ tng_function_status tng_particle_data_block_add(tng_trajectory_t tng_data,
second_dim_values = first_dim_values[j];
for(k = 0; k < n_values_per_frame; k++)
{
- len = tng_min(strlen(new_data) + 1,
+ len = tng_min(strlen(new_data_c) + 1,
TNG_MAX_STR_LEN);
if(second_dim_values[k])
{
@@ -10522,8 +10592,8 @@ tng_function_status tng_particle_data_block_add(tng_trajectory_t tng_data,
return(TNG_CRITICAL);
}
strncpy(second_dim_values[k],
- new_data, len);
- new_data += len;
+ new_data_c, len);
+ new_data_c += len;
}
}
}
@@ -10544,21 +10614,21 @@ tng_function_status tng_particle_data_block_add(tng_trajectory_t tng_data,
default:
size = sizeof(double);
}
+
memcpy(data->values, new_data, size * n_frames / stride_length *
n_particles * n_values_per_frame);
}
-
- new_data = orig;
}
return(TNG_SUCCESS);
}
-tng_function_status tng_frame_data_write(tng_trajectory_t tng_data,
- const int64_t frame_nr,
- const int64_t block_id,
- const void *values,
- const tng_hash_mode hash_mode)
+tng_function_status DECLSPECDLLEXPORT tng_frame_data_write
+ (tng_trajectory_t tng_data,
+ const int64_t frame_nr,
+ const int64_t block_id,
+ const void *values,
+ const tng_hash_mode hash_mode)
{
int64_t header_pos, file_pos;
int64_t output_file_len, n_values_per_frame, size, contents_size;
@@ -10964,13 +11034,14 @@ tng_function_status tng_frame_data_write(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_frame_particle_data_write(tng_trajectory_t tng_data,
- const int64_t frame_nr,
- const int64_t block_id,
- const int64_t val_first_particle,
- const int64_t val_n_particles,
- const void *values,
- const tng_hash_mode hash_mode)
+tng_function_status DECLSPECDLLEXPORT tng_frame_particle_data_write
+ (tng_trajectory_t tng_data,
+ const int64_t frame_nr,
+ const int64_t block_id,
+ const int64_t val_first_particle,
+ const int64_t val_n_particles,
+ const void *values,
+ const tng_hash_mode hash_mode)
{
int64_t header_pos, file_pos, tot_n_particles;
int64_t output_file_len, n_values_per_frame, size, contents_size;
@@ -11543,11 +11614,12 @@ static tng_function_status tng_data_values_alloc
return(TNG_SUCCESS);
}
-tng_function_status tng_data_values_free(const tng_trajectory_t tng_data,
- union data_values **values,
- const int64_t n_frames,
- const int64_t n_values_per_frame,
- const tng_data_type type)
+tng_function_status DECLSPECDLLEXPORT tng_data_values_free
+ (const tng_trajectory_t tng_data,
+ union data_values **values,
+ const int64_t n_frames,
+ const int64_t n_values_per_frame,
+ const tng_data_type type)
{
int i, j;
@@ -11645,7 +11717,7 @@ static tng_function_status tng_particle_data_values_alloc
return(TNG_SUCCESS);
}
-tng_function_status tng_particle_data_values_free
+tng_function_status DECLSPECDLLEXPORT tng_particle_data_values_free
(const tng_trajectory_t tng_data,
union data_values ***values,
const int64_t n_frames,
@@ -11689,12 +11761,13 @@ tng_function_status tng_particle_data_values_free
}
-tng_function_status tng_data_get(tng_trajectory_t tng_data,
- const int64_t block_id,
- union data_values ***values,
- int64_t *n_frames,
- int64_t *n_values_per_frame,
- tng_data_type *type)
+tng_function_status DECLSPECDLLEXPORT tng_data_get
+ (tng_trajectory_t tng_data,
+ const int64_t block_id,
+ union data_values ***values,
+ int64_t *n_frames,
+ int64_t *n_values_per_frame,
+ tng_data_type *type)
{
int64_t file_pos;
int i, j, block_index, len, size;
@@ -11959,14 +12032,15 @@ tng_function_status tng_data_vector_get(tng_trajectory_t tng_data,
return(TNG_SUCCESS);
}
-tng_function_status tng_data_interval_get(tng_trajectory_t tng_data,
- const int64_t block_id,
- const int64_t start_frame_nr,
- const int64_t end_frame_nr,
- const tng_hash_mode hash_mode,
- union data_values ***values,
- int64_t *n_values_per_frame,
- tng_data_type *type)
+tng_function_status DECLSPECDLLEXPORT tng_data_interval_get
+ (tng_trajectory_t tng_data,
+ const int64_t block_id,
+ const int64_t start_frame_nr,
+ const int64_t end_frame_nr,
+ const tng_hash_mode hash_mode,
+ union data_values ***values,
+ int64_t *n_values_per_frame,
+ tng_data_type *type)
{
int64_t i, j, n_frames, file_pos, current_frame_pos;
int block_index, len, size;
@@ -12145,13 +12219,14 @@ tng_function_status tng_data_interval_get(tng_trajectory_t tng_data,
}
-tng_function_status tng_particle_data_get(tng_trajectory_t tng_data,
- const int64_t block_id,
- union data_values ****values,
- int64_t *n_frames,
- int64_t *n_particles,
- int64_t *n_values_per_frame,
- tng_data_type *type)
+tng_function_status DECLSPECDLLEXPORT tng_particle_data_get
+ (tng_trajectory_t tng_data,
+ const int64_t block_id,
+ union data_values ****values,
+ int64_t *n_frames,
+ int64_t *n_particles,
+ int64_t *n_values_per_frame,
+ tng_data_type *type)
{
int64_t i, j, k, mapping, file_pos, i_step;
int block_index, len, size;
@@ -12345,15 +12420,16 @@ tng_function_status tng_particle_data_get(tng_trajectory_t tng_data,
}
-tng_function_status tng_particle_data_interval_get(tng_trajectory_t tng_data,
- const int64_t block_id,
- const int64_t start_frame_nr,
- const int64_t end_frame_nr,
- const tng_hash_mode hash_mode,
- union data_values ****values,
- int64_t *n_particles,
- int64_t *n_values_per_frame,
- tng_data_type *type)
+tng_function_status DECLSPECDLLEXPORT tng_particle_data_interval_get
+ (tng_trajectory_t tng_data,
+ const int64_t block_id,
+ const int64_t start_frame_nr,
+ const int64_t end_frame_nr,
+ const tng_hash_mode hash_mode,
+ union data_values ****values,
+ int64_t *n_particles,
+ int64_t *n_values_per_frame,
+ tng_data_type *type)
{
int64_t i, j, k, mapping, n_frames, file_pos, current_frame_pos, i_step;
int block_index, len, size;
@@ -12570,8 +12646,9 @@ tng_function_status tng_particle_data_interval_get(tng_trajectory_t tng_data,
}
-tng_function_status tng_time_get_str(const tng_trajectory_t tng_data,
- char *time)
+tng_function_status DECLSPECDLLEXPORT tng_time_get_str
+ (const tng_trajectory_t tng_data,
+ char *time)
{
struct tm *time_data;
time_t secs;
@@ -12579,7 +12656,7 @@ tng_function_status tng_time_get_str(const tng_trajectory_t tng_data,
secs = tng_data->time;
time_data = localtime(&secs); // Returns a statically allocated variable.
- snprintf(time, TNG_MAX_DATE_STR_LEN,
+ TNG_SNPRINTF(time, TNG_MAX_DATE_STR_LEN,
"%4d-%02d-%02d %02d:%02d:%02d",
time_data->tm_year+1900, time_data->tm_mon+1, time_data->tm_mday,
time_data->tm_hour, time_data->tm_min, time_data->tm_sec);
@@ -12591,29 +12668,29 @@ tng_function_status tng_time_get_str(const tng_trajectory_t tng_data,
#ifdef BUILD_FORTRAN
/* The following is for calling the library from fortran */
-tng_function_status tng_trajectory_init_(tng_trajectory_t *tng_data_p)
+tng_function_status DECLSPECDLLEXPORT tng_trajectory_init_(tng_trajectory_t *tng_data_p)
{
return(tng_trajectory_init(tng_data_p));
}
-tng_function_status tng_trajectory_destroy_(tng_trajectory_t *tng_data_p)
+tng_function_status DECLSPECDLLEXPORT tng_trajectory_destroy_(tng_trajectory_t *tng_data_p)
{
return(tng_trajectory_destroy(tng_data_p));
}
-tng_function_status tng_trajectory_init_from_src_(tng_trajectory_t src,
+tng_function_status DECLSPECDLLEXPORT tng_trajectory_init_from_src_(tng_trajectory_t src,
tng_trajectory_t *dest_p)
{
return(tng_trajectory_init_from_src(src, dest_p));
}
-tng_function_status tng_input_file_get_(const tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_input_file_get_(const tng_trajectory_t tng_data,
char *file_name, const int max_len)
{
return(tng_input_file_get(tng_data, file_name, max_len));
}
-tng_function_status tng_input_file_set_(tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_input_file_set_(tng_trajectory_t tng_data,
const char *file_name, int name_len)
{
char *name = malloc(name_len + 1);
@@ -12626,13 +12703,13 @@ tng_function_status tng_input_file_set_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_output_file_get_(const tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_output_file_get_(const tng_trajectory_t tng_data,
char *file_name, const int max_len)
{
return(tng_output_file_get(tng_data, file_name, max_len));
}
-tng_function_status tng_output_file_set_(tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_output_file_set_(tng_trajectory_t tng_data,
const char *file_name, int name_len)
{
char *name = malloc(name_len + 1);
@@ -12645,25 +12722,25 @@ tng_function_status tng_output_file_set_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_first_program_name_get_(const tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_first_program_name_get_(const tng_trajectory_t tng_data,
char *name, const int max_len)
{
return(tng_first_program_name_get(tng_data, name, max_len));
}
-tng_function_status tng_output_file_endianness_get_
+tng_function_status DECLSPECDLLEXPORT tng_output_file_endianness_get_
(tng_trajectory_t tng_data, tng_file_endianness *endianness)
{
return(tng_output_file_endianness_get(tng_data, endianness));
}
-tng_function_status tng_output_file_endianness_set_
+tng_function_status DECLSPECDLLEXPORT tng_output_file_endianness_set_
(tng_trajectory_t tng_data, const tng_file_endianness *endianness)
{
return(tng_output_file_endianness_set(tng_data, *endianness));
}
-tng_function_status tng_first_program_name_set_(tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_first_program_name_set_(tng_trajectory_t tng_data,
const char *new_name,
int name_len)
{
@@ -12677,13 +12754,13 @@ tng_function_status tng_first_program_name_set_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_last_program_name_get_(const tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_last_program_name_get_(const tng_trajectory_t tng_data,
char *name, const int max_len)
{
return(tng_last_program_name_get(tng_data, name, max_len));
}
-tng_function_status tng_last_program_name_set_(tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_last_program_name_set_(tng_trajectory_t tng_data,
const char *new_name,
int name_len)
{
@@ -12697,13 +12774,13 @@ tng_function_status tng_last_program_name_set_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_first_user_name_get_(const tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_first_user_name_get_(const tng_trajectory_t tng_data,
char *name, const int max_len)
{
return(tng_first_user_name_get(tng_data, name, max_len));
}
-tng_function_status tng_first_user_name_set_(tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_first_user_name_set_(tng_trajectory_t tng_data,
const char *new_name,
int name_len)
{
@@ -12717,13 +12794,13 @@ tng_function_status tng_first_user_name_set_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_last_user_name_get_(const tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_last_user_name_get_(const tng_trajectory_t tng_data,
char *name, const int max_len)
{
return(tng_last_user_name_get(tng_data, name, max_len));
}
-tng_function_status tng_last_user_name_set_(tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_last_user_name_set_(tng_trajectory_t tng_data,
const char *new_name,
int name_len)
{
@@ -12737,13 +12814,13 @@ tng_function_status tng_last_user_name_set_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_first_computer_name_get_(const tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_first_computer_name_get_(const tng_trajectory_t tng_data,
char *name, const int max_len)
{
return(tng_first_computer_name_get(tng_data, name, max_len));
}
-tng_function_status tng_first_computer_name_set_(tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_first_computer_name_set_(tng_trajectory_t tng_data,
const char *new_name,
int name_len)
{
@@ -12757,13 +12834,13 @@ tng_function_status tng_first_computer_name_set_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_last_computer_name_get_(const tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_last_computer_name_get_(const tng_trajectory_t tng_data,
char *name, const int max_len)
{
return(tng_last_computer_name_get(tng_data, name, max_len));
}
-tng_function_status tng_last_computer_name_set_(tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_last_computer_name_set_(tng_trajectory_t tng_data,
const char *new_name,
int name_len)
{
@@ -12777,13 +12854,14 @@ tng_function_status tng_last_computer_name_set_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_first_signature_get_(const tng_trajectory_t tng_data,
- char *signature, const int max_len)
+tng_function_status DECLSPECDLLEXPORT tng_first_signature_get_
+ (const tng_trajectory_t tng_data,
+ char *signature, const int max_len)
{
return(tng_first_signature_get(tng_data, signature, max_len));
}
-tng_function_status tng_first_signature_set_(tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_first_signature_set_(tng_trajectory_t tng_data,
const char *signature,
int sign_len)
{
@@ -12797,15 +12875,17 @@ tng_function_status tng_first_signature_set_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_last_signature_get_(const tng_trajectory_t tng_data,
- char *signature, const int max_len)
+tng_function_status DECLSPECDLLEXPORT tng_last_signature_get_
+ (const tng_trajectory_t tng_data,
+ char *signature, const int max_len)
{
return(tng_last_signature_get(tng_data, signature, max_len));
}
-tng_function_status tng_last_signature_set_(tng_trajectory_t tng_data,
- const char *signature,
- int sign_len)
+tng_function_status DECLSPECDLLEXPORT tng_last_signature_set_
+ (tng_trajectory_t tng_data,
+ const char *signature,
+ int sign_len)
{
char *sign = malloc(sign_len + 1);
tng_function_status stat;
@@ -12817,15 +12897,17 @@ tng_function_status tng_last_signature_set_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_forcefield_name_get_(const tng_trajectory_t tng_data,
- char *name, const int max_len)
+tng_function_status DECLSPECDLLEXPORT tng_forcefield_name_get_
+ (const tng_trajectory_t tng_data,
+ char *name, const int max_len)
{
return(tng_forcefield_name_get(tng_data, name, max_len));
}
-tng_function_status tng_forcefield_name_set_(tng_trajectory_t tng_data,
- const char *new_name,
- int name_len)
+tng_function_status DECLSPECDLLEXPORT tng_forcefield_name_set_
+ (tng_trajectory_t tng_data,
+ const char *new_name,
+ int name_len)
{
char *name = malloc(name_len + 1);
tng_function_status stat;
@@ -12837,95 +12919,104 @@ tng_function_status tng_forcefield_name_set_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_medium_stride_length_get_(const tng_trajectory_t tng_data,
- int64_t *len)
+tng_function_status DECLSPECDLLEXPORT tng_medium_stride_length_get_
+ (const tng_trajectory_t tng_data,
+ int64_t *len)
{
return(tng_medium_stride_length_get(tng_data, len));
}
-tng_function_status tng_medium_stride_length_set_(tng_trajectory_t tng_data,
- const int64_t *len)
+tng_function_status DECLSPECDLLEXPORT tng_medium_stride_length_set_
+ (tng_trajectory_t tng_data,
+ const int64_t *len)
{
return(tng_medium_stride_length_set(tng_data, *len));
}
-tng_function_status tng_long_stride_length_get_(const tng_trajectory_t tng_data,
- int64_t *len)
+tng_function_status DECLSPECDLLEXPORT tng_long_stride_length_get_
+ (const tng_trajectory_t tng_data,
+ int64_t *len)
{
return(tng_long_stride_length_get(tng_data, len));
}
-tng_function_status tng_long_stride_length_set_(tng_trajectory_t tng_data,
- const int64_t *len)
+tng_function_status DECLSPECDLLEXPORT tng_long_stride_length_set_
+ (tng_trajectory_t tng_data,
+ const int64_t *len)
{
return(tng_long_stride_length_set(tng_data, *len));
}
-tng_function_status tng_input_file_len_get_(const tng_trajectory_t tng_data,
- int64_t *len)
+tng_function_status DECLSPECDLLEXPORT tng_input_file_len_get_
+ (const tng_trajectory_t tng_data,
+ int64_t *len)
{
return(tng_input_file_len_get(tng_data, len));
}
-tng_function_status tng_num_frames_get_(const tng_trajectory_t tng_data,
- int64_t *n)
+tng_function_status DECLSPECDLLEXPORT tng_num_frames_get_
+ (const tng_trajectory_t tng_data,
+ int64_t *n)
{
return(tng_num_frames_get(tng_data, n));
}
-tng_function_status tng_num_particles_get_(const tng_trajectory_t tng_data,
- int64_t *n)
+tng_function_status DECLSPECDLLEXPORT tng_num_particles_get_
+ (const tng_trajectory_t tng_data,
+ int64_t *n)
{
return(tng_num_particles_get(tng_data, n));
}
-tng_function_status tng_num_molecules_get_(const tng_trajectory_t tng_data,
- int64_t *n)
+tng_function_status DECLSPECDLLEXPORT tng_num_molecules_get_
+ (const tng_trajectory_t tng_data,
+ int64_t *n)
{
return(tng_num_molecules_get(tng_data, n));
}
-tng_function_status tng_num_frames_per_frame_set_get_
+tng_function_status DECLSPECDLLEXPORT tng_num_frames_per_frame_set_get_
(const tng_trajectory_t tng_data,
int64_t *n)
{
return(tng_num_frames_per_frame_set_get(tng_data, n));
}
-tng_function_status tng_num_frames_per_frame_set_set_
+tng_function_status DECLSPECDLLEXPORT tng_num_frames_per_frame_set_set_
(const tng_trajectory_t tng_data,
int64_t *n)
{
return(tng_num_frames_per_frame_set_set(tng_data, *n));
}
-tng_function_status tng_num_frame_sets_get_
+tng_function_status DECLSPECDLLEXPORT tng_num_frame_sets_get_
(const tng_trajectory_t tng_data,
int64_t *n)
{
return(tng_num_frame_sets_get(tng_data, n));
}
-tng_function_status tng_current_frame_set_get_
+tng_function_status DECLSPECDLLEXPORT tng_current_frame_set_get_
(tng_trajectory_t tng_data,
tng_trajectory_frame_set_t *frame_set_p)
{
return(tng_current_frame_set_get(tng_data, frame_set_p));
}
-tng_function_status tng_frame_set_nr_find_(tng_trajectory_t tng_data,
- const int64_t *nr)
+tng_function_status DECLSPECDLLEXPORT tng_frame_set_nr_find_(tng_trajectory_t tng_data,
+ const int64_t *nr)
{
return(tng_frame_set_nr_find(tng_data, *nr));
}
-tng_function_status tng_frame_set_of_frame_find_(tng_trajectory_t tng_data,
- const int64_t *frame)
+tng_function_status DECLSPECDLLEXPORT tng_frame_set_of_frame_find_
+ (tng_trajectory_t tng_data,
+ const int64_t *frame)
{
return(tng_frame_set_of_frame_find(tng_data, *frame));
}
-tng_function_status tng_frame_set_next_frame_set_file_pos_get_
+tng_function_status DECLSPECDLLEXPORT tng_frame_set_next_frame_set_file_pos_get_
(const tng_trajectory_t tng_data,
const tng_trajectory_frame_set_t frame_set,
int64_t *pos)
@@ -12933,7 +13024,7 @@ tng_function_status tng_frame_set_next_frame_set_file_pos_get_
return(tng_frame_set_next_frame_set_file_pos_get(tng_data, frame_set, pos));
}
-tng_function_status tng_frame_set_prev_frame_set_file_pos_get_
+tng_function_status DECLSPECDLLEXPORT tng_frame_set_prev_frame_set_file_pos_get_
(const tng_trajectory_t tng_data,
const tng_trajectory_frame_set_t frame_set,
int64_t *pos)
@@ -12941,7 +13032,7 @@ tng_function_status tng_frame_set_prev_frame_set_file_pos_get_
return(tng_frame_set_prev_frame_set_file_pos_get(tng_data, frame_set, pos));
}
-tng_function_status tng_frame_set_frame_range_get_
+tng_function_status DECLSPECDLLEXPORT tng_frame_set_frame_range_get_
(const tng_trajectory_t tng_data,
const tng_trajectory_frame_set_t frame_set,
int64_t *first_frame,
@@ -12951,22 +13042,23 @@ tng_function_status tng_frame_set_frame_range_get_
last_frame));
}
-tng_function_status tng_molecule_init_(const tng_trajectory_t tng_data,
+tng_function_status DECLSPECDLLEXPORT tng_molecule_init_(const tng_trajectory_t tng_data,
tng_molecule_t molecule)
{
return(tng_molecule_init(tng_data, molecule));
}
-tng_function_status tng_molecule_destroy_(const tng_trajectory_t tng_data,
- tng_molecule_t molecule)
+tng_function_status DECLSPECDLLEXPORT tng_molecule_destroy_
+ (const tng_trajectory_t tng_data,
+ tng_molecule_t molecule)
{
return(tng_molecule_destroy(tng_data, molecule));
}
-tng_function_status tng_molecule_add_(tng_trajectory_t tng_data,
- const char *name,
- tng_molecule_t *molecule,
- int name_len)
+tng_function_status DECLSPECDLLEXPORT tng_molecule_add_(tng_trajectory_t tng_data,
+ const char *name,
+ tng_molecule_t *molecule,
+ int name_len)
{
char *n = malloc(name_len + 1);
tng_function_status stat;
@@ -12978,10 +13070,10 @@ tng_function_status tng_molecule_add_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_molecule_name_set_(tng_trajectory_t tng_data,
- tng_molecule_t molecule,
- const char *new_name,
- int name_len)
+tng_function_status DECLSPECDLLEXPORT tng_molecule_name_set_(tng_trajectory_t tng_data,
+ tng_molecule_t molecule,
+ const char *new_name,
+ int name_len)
{
char *name = malloc(name_len + 1);
tng_function_status stat;
@@ -12993,26 +13085,26 @@ tng_function_status tng_molecule_name_set_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_molecule_cnt_get_(tng_trajectory_t tng_data,
- tng_molecule_t molecule,
- int64_t *cnt)
+tng_function_status DECLSPECDLLEXPORT tng_molecule_cnt_get_(tng_trajectory_t tng_data,
+ tng_molecule_t molecule,
+ int64_t *cnt)
{
return(tng_molecule_cnt_get(tng_data, molecule, cnt));
}
-tng_function_status tng_molecule_cnt_set_(tng_trajectory_t tng_data,
- tng_molecule_t molecule,
- int64_t *cnt)
+tng_function_status DECLSPECDLLEXPORT tng_molecule_cnt_set_(tng_trajectory_t tng_data,
+ tng_molecule_t molecule,
+ int64_t *cnt)
{
return(tng_molecule_cnt_set(tng_data, molecule, *cnt));
}
-tng_function_status tng_molecule_chain_find_(tng_trajectory_t tng_data,
- tng_molecule_t molecule,
- const char *name,
- int64_t id,
- tng_chain_t *chain,
- int name_len)
+tng_function_status DECLSPECDLLEXPORT tng_molecule_chain_find_(tng_trajectory_t tng_data,
+ tng_molecule_t molecule,
+ const char *name,
+ int64_t id,
+ tng_chain_t *chain,
+ int name_len)
{
char *n = malloc(name_len + 1);
tng_function_status stat;
@@ -13024,11 +13116,11 @@ tng_function_status tng_molecule_chain_find_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_molecule_chain_add_(tng_trajectory_t tng_data,
- tng_molecule_t molecule,
- const char *name,
- tng_chain_t *chain,
- int name_len)
+tng_function_status DECLSPECDLLEXPORT tng_molecule_chain_add_(tng_trajectory_t tng_data,
+ tng_molecule_t molecule,
+ const char *name,
+ tng_chain_t *chain,
+ int name_len)
{
char *n = malloc(name_len + 1);
tng_function_status stat;
@@ -13040,10 +13132,10 @@ tng_function_status tng_molecule_chain_add_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_chain_name_set_(tng_trajectory_t tng_data,
- tng_chain_t chain,
- const char *new_name,
- int name_len)
+tng_function_status DECLSPECDLLEXPORT tng_chain_name_set_(tng_trajectory_t tng_data,
+ tng_chain_t chain,
+ const char *new_name,
+ int name_len)
{
char *name = malloc(name_len + 1);
tng_function_status stat;
@@ -13055,11 +13147,11 @@ tng_function_status tng_chain_name_set_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_chain_residue_add_(tng_trajectory_t tng_data,
- tng_chain_t chain,
- const char *name,
- tng_residue_t *residue,
- int name_len)
+tng_function_status DECLSPECDLLEXPORT tng_chain_residue_add_(tng_trajectory_t tng_data,
+ tng_chain_t chain,
+ const char *name,
+ tng_residue_t *residue,
+ int name_len)
{
char *n = malloc(name_len + 1);
tng_function_status stat;
@@ -13071,10 +13163,10 @@ tng_function_status tng_chain_residue_add_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_residue_name_set_(tng_trajectory_t tng_data,
- tng_residue_t residue,
- const char *new_name,
- int name_len)
+tng_function_status DECLSPECDLLEXPORT tng_residue_name_set_(tng_trajectory_t tng_data,
+ tng_residue_t residue,
+ const char *new_name,
+ int name_len)
{
char *name = malloc(name_len + 1);
tng_function_status stat;
@@ -13086,13 +13178,13 @@ tng_function_status tng_residue_name_set_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_residue_atom_add_(tng_trajectory_t tng_data,
- tng_residue_t residue,
- const char *atom_name,
- const char *atom_type,
- tng_atom_t *atom,
- int name_len,
- int type_len)
+tng_function_status DECLSPECDLLEXPORT tng_residue_atom_add_(tng_trajectory_t tng_data,
+ tng_residue_t residue,
+ const char *atom_name,
+ const char *atom_type,
+ tng_atom_t *atom,
+ int name_len,
+ int type_len)
{
char *name = malloc(name_len + 1);
char *type = malloc(type_len + 1);
@@ -13108,10 +13200,10 @@ tng_function_status tng_residue_atom_add_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_atom_name_set_(tng_trajectory_t tng_data,
- tng_atom_t atom,
- const char *new_name,
- int name_len)
+tng_function_status DECLSPECDLLEXPORT tng_atom_name_set_(tng_trajectory_t tng_data,
+ tng_atom_t atom,
+ const char *new_name,
+ int name_len)
{
char *name = malloc(name_len + 1);
tng_function_status stat;
@@ -13123,10 +13215,10 @@ tng_function_status tng_atom_name_set_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_atom_type_set_(tng_trajectory_t tng_data,
- tng_atom_t atom,
- const char *new_type,
- int type_len)
+tng_function_status DECLSPECDLLEXPORT tng_atom_type_set_(tng_trajectory_t tng_data,
+ tng_atom_t atom,
+ const char *new_type,
+ int type_len)
{
char *type = malloc(type_len + 1);
tng_function_status stat;
@@ -13138,7 +13230,7 @@ tng_function_status tng_atom_type_set_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_molecule_name_of_particle_nr_get_
+tng_function_status DECLSPECDLLEXPORT tng_molecule_name_of_particle_nr_get_
(const tng_trajectory_t tng_data,
const int64_t nr,
char *name,
@@ -13147,7 +13239,7 @@ tng_function_status tng_molecule_name_of_particle_nr_get_
return(tng_molecule_name_of_particle_nr_get(tng_data, nr, name, max_len));
}
-tng_function_status tng_chain_name_of_particle_nr_get_
+tng_function_status DECLSPECDLLEXPORT tng_chain_name_of_particle_nr_get_
(const tng_trajectory_t tng_data,
const int64_t nr,
char *name,
@@ -13156,7 +13248,7 @@ tng_function_status tng_chain_name_of_particle_nr_get_
return(tng_chain_name_of_particle_nr_get(tng_data, nr, name, max_len));
}
-tng_function_status tng_residue_name_of_particle_nr_get_
+tng_function_status DECLSPECDLLEXPORT tng_residue_name_of_particle_nr_get_
(const tng_trajectory_t tng_data,
const int64_t nr,
char *name,
@@ -13165,7 +13257,7 @@ tng_function_status tng_residue_name_of_particle_nr_get_
return(tng_residue_name_of_particle_nr_get(tng_data, nr, name, max_len));
}
-tng_function_status tng_atom_name_of_particle_nr_get_
+tng_function_status DECLSPECDLLEXPORT tng_atom_name_of_particle_nr_get_
(const tng_trajectory_t tng_data,
const int64_t nr,
char *name,
@@ -13174,7 +13266,7 @@ tng_function_status tng_atom_name_of_particle_nr_get_
return(tng_atom_name_of_particle_nr_get(tng_data, nr, name, max_len));
}
-tng_function_status tng_atom_type_of_particle_nr_get_
+tng_function_status DECLSPECDLLEXPORT tng_atom_type_of_particle_nr_get_
(const tng_trajectory_t tng_data,
const int64_t nr,
char *type,
@@ -13183,7 +13275,7 @@ tng_function_status tng_atom_type_of_particle_nr_get_
return(tng_atom_type_of_particle_nr_get(tng_data, nr, type, max_len));
}
-tng_function_status tng_particle_mapping_add_
+tng_function_status DECLSPECDLLEXPORT tng_particle_mapping_add_
(tng_trajectory_t tng_data,
const int64_t *first_particle_number,
const int64_t *n_particles,
@@ -13193,55 +13285,59 @@ tng_function_status tng_particle_mapping_add_
*n_particles, mapping_table));
}
-tng_function_status tng_file_headers_read_(tng_trajectory_t tng_data,
- const tng_hash_mode *hash_mode)
+tng_function_status DECLSPECDLLEXPORT tng_file_headers_read_(tng_trajectory_t tng_data,
+ const tng_hash_mode *hash_mode)
{
return(tng_file_headers_read(tng_data, *hash_mode));
}
-tng_function_status tng_file_headers_write_(tng_trajectory_t tng_data,
- const tng_hash_mode *hash_mode)
+tng_function_status DECLSPECDLLEXPORT tng_file_headers_write_
+ (tng_trajectory_t tng_data,
+ const tng_hash_mode *hash_mode)
{
return(tng_file_headers_write(tng_data, *hash_mode));
}
-tng_function_status tng_block_read_next_(tng_trajectory_t tng_data,
- tng_gen_block_t block_data,
- const tng_hash_mode *hash_mode)
+tng_function_status DECLSPECDLLEXPORT tng_block_read_next_
+ (tng_trajectory_t tng_data,
+ tng_gen_block_t block_data,
+ const tng_hash_mode *hash_mode)
{
return(tng_block_read_next(tng_data, block_data, *hash_mode));
}
-tng_function_status tng_frame_set_read_next_(tng_trajectory_t tng_data,
- const tng_hash_mode *hash_mode)
+tng_function_status DECLSPECDLLEXPORT tng_frame_set_read_next_
+ (tng_trajectory_t tng_data,
+ const tng_hash_mode *hash_mode)
{
return(tng_frame_set_read_next(tng_data, *hash_mode));
}
-tng_function_status tng_frame_set_write_(tng_trajectory_t tng_data,
- const tng_hash_mode *hash_mode)
+tng_function_status DECLSPECDLLEXPORT tng_frame_set_write_(tng_trajectory_t tng_data,
+ const tng_hash_mode *hash_mode)
{
return(tng_frame_set_write(tng_data, *hash_mode));
}
-tng_function_status tng_frame_set_new_(tng_trajectory_t tng_data,
- const int64_t *first_frame,
- const int64_t *n_frames)
+tng_function_status DECLSPECDLLEXPORT tng_frame_set_new_(tng_trajectory_t tng_data,
+ const int64_t *first_frame,
+ const int64_t *n_frames)
{
return(tng_frame_set_new(tng_data, *first_frame, *n_frames));
}
-tng_function_status tng_data_block_add_(tng_trajectory_t tng_data,
- const int64_t *id,
- const char *block_name,
- const tng_data_type *datatype,
- const tng_block_type *block_type_flag,
- int64_t *n_frames,
- const int64_t *n_values_per_frame,
- const int64_t *stride_length,
- const int64_t *codec_id,
- void *new_data,
- int name_len)
+tng_function_status DECLSPECDLLEXPORT tng_data_block_add_
+ (tng_trajectory_t tng_data,
+ const int64_t *id,
+ const char *block_name,
+ const tng_data_type *datatype,
+ const tng_block_type *block_type_flag,
+ int64_t *n_frames,
+ const int64_t *n_values_per_frame,
+ const int64_t *stride_length,
+ const int64_t *codec_id,
+ void *new_data,
+ int name_len)
{
char *name = malloc(name_len + 1);
tng_function_status stat;
@@ -13255,7 +13351,7 @@ tng_function_status tng_data_block_add_(tng_trajectory_t tng_data,
return(stat);
}
-tng_function_status tng_particle_data_block_add_
+tng_function_status DECLSPECDLLEXPORT tng_particle_data_block_add_
(tng_trajectory_t tng_data,
const int64_t *id,
const char *block_name,
@@ -13284,96 +13380,104 @@ tng_function_status tng_particle_data_block_add_
return(stat);
}
-tng_function_status tng_frame_data_write_(tng_trajectory_t tng_data,
- const int64_t *frame_nr,
- const int64_t *block_id,
- const void *data,
- const tng_hash_mode *hash_mode)
+tng_function_status DECLSPECDLLEXPORT tng_frame_data_write_
+ (tng_trajectory_t tng_data,
+ const int64_t *frame_nr,
+ const int64_t *block_id,
+ const void *data,
+ const tng_hash_mode *hash_mode)
{
return(tng_frame_data_write(tng_data, *frame_nr, *block_id, data,
*hash_mode));
}
-tng_function_status tng_frame_particle_data_write_(tng_trajectory_t tng_data,
- const int64_t *frame_nr,
- const int64_t *block_id,
- const int64_t *val_first_particle,
- const int64_t *val_n_particles,
- const void *data,
- const tng_hash_mode *hash_mode)
+tng_function_status DECLSPECDLLEXPORT tng_frame_particle_data_write_
+ (tng_trajectory_t tng_data,
+ const int64_t *frame_nr,
+ const int64_t *block_id,
+ const int64_t *val_first_particle,
+ const int64_t *val_n_particles,
+ const void *data,
+ const tng_hash_mode *hash_mode)
{
return(tng_frame_particle_data_write(tng_data, *frame_nr, *block_id,
*val_first_particle, *val_n_particles,
data, *hash_mode));
}
-tng_function_status tng_data_values_free_(const tng_trajectory_t tng_data,
- union data_values **values,
- const int64_t *n_frames,
- const int64_t *n_values_per_frame,
- const tng_data_type *type)
+tng_function_status DECLSPECDLLEXPORT tng_data_values_free_
+ (const tng_trajectory_t tng_data,
+ union data_values **values,
+ const int64_t *n_frames,
+ const int64_t *n_values_per_frame,
+ const tng_data_type *type)
{
return(tng_data_values_free(tng_data, values, *n_frames,
*n_values_per_frame, *type));
}
-tng_function_status tng_particle_data_values_free_(const tng_trajectory_t tng_data,
- union data_values ***values,
- const int64_t *n_frames,
- const int64_t *n_particles,
- const int64_t *n_values_per_frame,
- const tng_data_type *type)
+tng_function_status DECLSPECDLLEXPORT tng_particle_data_values_free_
+ (const tng_trajectory_t tng_data,
+ union data_values ***values,
+ const int64_t *n_frames,
+ const int64_t *n_particles,
+ const int64_t *n_values_per_frame,
+ const tng_data_type *type)
{
return(tng_particle_data_values_free(tng_data, values, *n_frames, *n_particles,
*n_values_per_frame, *type));
}
-tng_function_status tng_data_get_(tng_trajectory_t tng_data,
- const int64_t *block_id,
- union data_values ***values,
- int64_t *n_frames,
- int64_t *n_values_per_frame,
- tng_data_type *type)
+tng_function_status DECLSPECDLLEXPORT tng_data_get_
+ (tng_trajectory_t tng_data,
+ const int64_t *block_id,
+ union data_values ***values,
+ int64_t *n_frames,
+ int64_t *n_values_per_frame,
+ tng_data_type *type)
{
return(tng_data_get(tng_data, *block_id, values, n_frames,
n_values_per_frame, type));
}
-tng_function_status tng_data_interval_get_(tng_trajectory_t tng_data,
- const int64_t *block_id,
- const int64_t *start_frame_nr,
- const int64_t *end_frame_nr,
- const tng_hash_mode *hash_mode,
- union data_values ***values,
- int64_t *n_values_per_frame,
- tng_data_type *type)
+tng_function_status DECLSPECDLLEXPORT tng_data_interval_get_
+ (tng_trajectory_t tng_data,
+ const int64_t *block_id,
+ const int64_t *start_frame_nr,
+ const int64_t *end_frame_nr,
+ const tng_hash_mode *hash_mode,
+ union data_values ***values,
+ int64_t *n_values_per_frame,
+ tng_data_type *type)
{
return(tng_data_interval_get(tng_data, *block_id, *start_frame_nr,
*end_frame_nr, *hash_mode, values,
n_values_per_frame, type));
}
-tng_function_status tng_particle_data_get_(tng_trajectory_t tng_data,
- const int64_t *block_id,
- union data_values ****values,
- int64_t *n_frames,
- int64_t *n_particles,
- int64_t *n_values_per_frame,
- tng_data_type *type)
+tng_function_status DECLSPECDLLEXPORT tng_particle_data_get_
+ (tng_trajectory_t tng_data,
+ const int64_t *block_id,
+ union data_values ****values,
+ int64_t *n_frames,
+ int64_t *n_particles,
+ int64_t *n_values_per_frame,
+ tng_data_type *type)
{
return(tng_particle_data_get(tng_data, *block_id, values, n_frames,
n_particles, n_values_per_frame, type));
}
-tng_function_status tng_particle_data_interval_get_(tng_trajectory_t tng_data,
- const int64_t *block_id,
- const int64_t *start_frame_nr,
- const int64_t *end_frame_nr,
- const tng_hash_mode *hash_mode,
- union data_values ****values,
- int64_t *n_particles,
- int64_t *n_values_per_frame,
- tng_data_type *type)
+tng_function_status DECLSPECDLLEXPORT tng_particle_data_interval_get_
+ (tng_trajectory_t tng_data,
+ const int64_t *block_id,
+ const int64_t *start_frame_nr,
+ const int64_t *end_frame_nr,
+ const tng_hash_mode *hash_mode,
+ union data_values ****values,
+ int64_t *n_particles,
+ int64_t *n_values_per_frame,
+ tng_data_type *type)
{
return(tng_particle_data_interval_get(tng_data, *block_id, *start_frame_nr,
*end_frame_nr, *hash_mode, values,
@@ -13381,8 +13485,9 @@ tng_function_status tng_particle_data_interval_get_(tng_trajectory_t tng_data,
type));
}
-tng_function_status tng_time_get_str_(const tng_trajectory_t tng_data,
- char *time, int64_t str_len)
+tng_function_status DECLSPECDLLEXPORT tng_time_get_str_
+ (const tng_trajectory_t tng_data,
+ char *time, int64_t str_len)
{
return(tng_time_get_str(tng_data, time));
}
contact: Jan Huwald // Impressum