1 /* This code is part of the tng binary trajectory format.
5 * Written by Magnus Lundborg
6 * Copyright (c) 2012-2013, The GROMACS development team.
7 * Check out http://www.gromacs.org for more information.
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the Revised BSD License.
14 #include "../../include/tng_io.h"
16 /* The following is for calling the library from fortran */
18 tng_function_status DECLSPECDLLEXPORT
tng_trajectory_init_(tng_trajectory_t
*tng_data_p
)
20 return(tng_trajectory_init(tng_data_p
));
23 tng_function_status DECLSPECDLLEXPORT
tng_trajectory_destroy_(tng_trajectory_t
*tng_data_p
)
25 return(tng_trajectory_destroy(tng_data_p
));
28 tng_function_status DECLSPECDLLEXPORT
tng_trajectory_init_from_src_(tng_trajectory_t src
,
29 tng_trajectory_t
*dest_p
)
31 return(tng_trajectory_init_from_src(src
, dest_p
));
34 tng_function_status DECLSPECDLLEXPORT
tng_input_file_get_(const tng_trajectory_t tng_data
,
35 char *file_name
, const int max_len
)
37 return(tng_input_file_get(tng_data
, file_name
, max_len
));
40 tng_function_status DECLSPECDLLEXPORT
tng_input_file_set_(tng_trajectory_t tng_data
,
41 const char *file_name
, int name_len
)
43 char *name
= malloc(name_len
+ 1);
44 tng_function_status stat
;
46 strncpy(name
, file_name
, name_len
);
48 stat
= tng_input_file_set(tng_data
, name
);
53 tng_function_status DECLSPECDLLEXPORT
tng_output_file_get_(const tng_trajectory_t tng_data
,
54 char *file_name
, const int max_len
)
56 return(tng_output_file_get(tng_data
, file_name
, max_len
));
59 tng_function_status DECLSPECDLLEXPORT
tng_output_file_set_(tng_trajectory_t tng_data
,
60 const char *file_name
, int name_len
)
62 char *name
= malloc(name_len
+ 1);
63 tng_function_status stat
;
65 strncpy(name
, file_name
, name_len
);
67 stat
= tng_output_file_set(tng_data
, name
);
72 tng_function_status DECLSPECDLLEXPORT
tng_first_program_name_get_(const tng_trajectory_t tng_data
,
73 char *name
, const int max_len
)
75 return(tng_first_program_name_get(tng_data
, name
, max_len
));
78 tng_function_status DECLSPECDLLEXPORT tng_output_file_endianness_get_
79 (tng_trajectory_t tng_data
, tng_file_endianness
*endianness
)
81 return(tng_output_file_endianness_get(tng_data
, endianness
));
84 tng_function_status DECLSPECDLLEXPORT tng_output_file_endianness_set_
85 (tng_trajectory_t tng_data
, const tng_file_endianness
*endianness
)
87 return(tng_output_file_endianness_set(tng_data
, *endianness
));
90 tng_function_status DECLSPECDLLEXPORT
tng_first_program_name_set_(tng_trajectory_t tng_data
,
94 char *name
= malloc(name_len
+ 1);
95 tng_function_status stat
;
97 strncpy(name
, new_name
, name_len
);
99 stat
= tng_first_program_name_set(tng_data
, name
);
104 tng_function_status DECLSPECDLLEXPORT
tng_last_program_name_get_(const tng_trajectory_t tng_data
,
105 char *name
, const int max_len
)
107 return(tng_last_program_name_get(tng_data
, name
, max_len
));
110 tng_function_status DECLSPECDLLEXPORT
tng_last_program_name_set_(tng_trajectory_t tng_data
,
111 const char *new_name
,
114 char *name
= malloc(name_len
+ 1);
115 tng_function_status stat
;
117 strncpy(name
, new_name
, name_len
);
119 stat
= tng_last_program_name_set(tng_data
, name
);
124 tng_function_status DECLSPECDLLEXPORT
tng_first_user_name_get_(const tng_trajectory_t tng_data
,
125 char *name
, const int max_len
)
127 return(tng_first_user_name_get(tng_data
, name
, max_len
));
130 tng_function_status DECLSPECDLLEXPORT
tng_first_user_name_set_(tng_trajectory_t tng_data
,
131 const char *new_name
,
134 char *name
= malloc(name_len
+ 1);
135 tng_function_status stat
;
137 strncpy(name
, new_name
, name_len
);
139 stat
= tng_first_user_name_set(tng_data
, name
);
144 tng_function_status DECLSPECDLLEXPORT
tng_last_user_name_get_(const tng_trajectory_t tng_data
,
145 char *name
, const int max_len
)
147 return(tng_last_user_name_get(tng_data
, name
, max_len
));
150 tng_function_status DECLSPECDLLEXPORT
tng_last_user_name_set_(tng_trajectory_t tng_data
,
151 const char *new_name
,
154 char *name
= malloc(name_len
+ 1);
155 tng_function_status stat
;
157 strncpy(name
, new_name
, name_len
);
159 stat
= tng_last_user_name_set(tng_data
, name
);
164 tng_function_status DECLSPECDLLEXPORT
tng_first_computer_name_get_(const tng_trajectory_t tng_data
,
165 char *name
, const int max_len
)
167 return(tng_first_computer_name_get(tng_data
, name
, max_len
));
170 tng_function_status DECLSPECDLLEXPORT
tng_first_computer_name_set_(tng_trajectory_t tng_data
,
171 const char *new_name
,
174 char *name
= malloc(name_len
+ 1);
175 tng_function_status stat
;
177 strncpy(name
, new_name
, name_len
);
179 stat
= tng_first_computer_name_set(tng_data
, name
);
184 tng_function_status DECLSPECDLLEXPORT
tng_last_computer_name_get_(const tng_trajectory_t tng_data
,
185 char *name
, const int max_len
)
187 return(tng_last_computer_name_get(tng_data
, name
, max_len
));
190 tng_function_status DECLSPECDLLEXPORT
tng_last_computer_name_set_(tng_trajectory_t tng_data
,
191 const char *new_name
,
194 char *name
= malloc(name_len
+ 1);
195 tng_function_status stat
;
197 strncpy(name
, new_name
, name_len
);
199 stat
= tng_last_computer_name_set(tng_data
, name
);
204 tng_function_status DECLSPECDLLEXPORT tng_first_signature_get_
205 (const tng_trajectory_t tng_data
,
206 char *signature
, const int max_len
)
208 return(tng_first_signature_get(tng_data
, signature
, max_len
));
211 tng_function_status DECLSPECDLLEXPORT
tng_first_signature_set_(tng_trajectory_t tng_data
,
212 const char *signature
,
215 char *sign
= malloc(sign_len
+ 1);
216 tng_function_status stat
;
218 strncpy(sign
, signature
, sign_len
);
220 stat
= tng_first_signature_set(tng_data
, sign
);
225 tng_function_status DECLSPECDLLEXPORT tng_last_signature_get_
226 (const tng_trajectory_t tng_data
,
227 char *signature
, const int max_len
)
229 return(tng_last_signature_get(tng_data
, signature
, max_len
));
232 tng_function_status DECLSPECDLLEXPORT tng_last_signature_set_
233 (tng_trajectory_t tng_data
,
234 const char *signature
,
237 char *sign
= malloc(sign_len
+ 1);
238 tng_function_status stat
;
240 strncpy(sign
, signature
, sign_len
);
242 stat
= tng_last_signature_set(tng_data
, sign
);
247 tng_function_status DECLSPECDLLEXPORT tng_forcefield_name_get_
248 (const tng_trajectory_t tng_data
,
249 char *name
, const int max_len
)
251 return(tng_forcefield_name_get(tng_data
, name
, max_len
));
254 tng_function_status DECLSPECDLLEXPORT tng_forcefield_name_set_
255 (tng_trajectory_t tng_data
,
256 const char *new_name
,
259 char *name
= malloc(name_len
+ 1);
260 tng_function_status stat
;
262 strncpy(name
, new_name
, name_len
);
264 stat
= tng_forcefield_name_set(tng_data
, name
);
269 tng_function_status DECLSPECDLLEXPORT tng_medium_stride_length_get_
270 (const tng_trajectory_t tng_data
,
273 return(tng_medium_stride_length_get(tng_data
, len
));
276 tng_function_status DECLSPECDLLEXPORT tng_medium_stride_length_set_
277 (tng_trajectory_t tng_data
,
280 return(tng_medium_stride_length_set(tng_data
, *len
));
283 tng_function_status DECLSPECDLLEXPORT tng_long_stride_length_get_
284 (const tng_trajectory_t tng_data
,
287 return(tng_long_stride_length_get(tng_data
, len
));
290 tng_function_status DECLSPECDLLEXPORT tng_long_stride_length_set_
291 (tng_trajectory_t tng_data
,
294 return(tng_long_stride_length_set(tng_data
, *len
));
297 tng_function_status DECLSPECDLLEXPORT tng_time_per_frame_get_
298 (const tng_trajectory_t tng_data
,
301 return(tng_time_per_frame_get(tng_data
, time
));
304 tng_function_status DECLSPECDLLEXPORT tng_time_per_frame_set_
305 (tng_trajectory_t tng_data
,
308 return(tng_time_per_frame_set(tng_data
, *time
));
311 tng_function_status DECLSPECDLLEXPORT tng_input_file_len_get_
312 (const tng_trajectory_t tng_data
,
315 return(tng_input_file_len_get(tng_data
, len
));
318 tng_function_status DECLSPECDLLEXPORT tng_num_frames_get_
319 (const tng_trajectory_t tng_data
,
322 return(tng_num_frames_get(tng_data
, n
));
325 tng_function_status DECLSPECDLLEXPORT tng_num_particles_get_
326 (const tng_trajectory_t tng_data
,
329 return(tng_num_particles_get(tng_data
, n
));
332 tng_function_status DECLSPECDLLEXPORT tng_num_molecules_get_
333 (const tng_trajectory_t tng_data
,
336 return(tng_num_molecules_get(tng_data
, n
));
339 tng_function_status DECLSPECDLLEXPORT tng_distance_unit_exponential_get_
340 (const tng_trajectory_t tng_data
,
343 return(tng_distance_unit_exponential_get(tng_data
, exp
));
346 tng_function_status DECLSPECDLLEXPORT tng_distance_unit_exponential_set_
347 (const tng_trajectory_t tng_data
,
350 return(tng_distance_unit_exponential_set(tng_data
, *exp
));
353 tng_function_status DECLSPECDLLEXPORT tng_num_frames_per_frame_set_get_
354 (const tng_trajectory_t tng_data
,
357 return(tng_num_frames_per_frame_set_get(tng_data
, n
));
360 tng_function_status DECLSPECDLLEXPORT tng_num_frames_per_frame_set_set_
361 (const tng_trajectory_t tng_data
,
364 return(tng_num_frames_per_frame_set_set(tng_data
, *n
));
367 tng_function_status DECLSPECDLLEXPORT tng_num_frame_sets_get_
368 (const tng_trajectory_t tng_data
,
371 return(tng_num_frame_sets_get(tng_data
, n
));
374 tng_function_status DECLSPECDLLEXPORT tng_current_frame_set_get_
375 (tng_trajectory_t tng_data
,
376 tng_trajectory_frame_set_t
*frame_set_p
)
378 return(tng_current_frame_set_get(tng_data
, frame_set_p
));
381 tng_function_status DECLSPECDLLEXPORT
tng_frame_set_nr_find_(tng_trajectory_t tng_data
,
384 return(tng_frame_set_nr_find(tng_data
, *nr
));
387 tng_function_status DECLSPECDLLEXPORT tng_frame_set_of_frame_find_
388 (tng_trajectory_t tng_data
,
389 const int64_t *frame
)
391 return(tng_frame_set_of_frame_find(tng_data
, *frame
));
394 tng_function_status DECLSPECDLLEXPORT tng_frame_set_next_frame_set_file_pos_get_
395 (const tng_trajectory_t tng_data
,
396 const tng_trajectory_frame_set_t frame_set
,
399 return(tng_frame_set_next_frame_set_file_pos_get(tng_data
, frame_set
, pos
));
402 tng_function_status DECLSPECDLLEXPORT tng_frame_set_prev_frame_set_file_pos_get_
403 (const tng_trajectory_t tng_data
,
404 const tng_trajectory_frame_set_t frame_set
,
407 return(tng_frame_set_prev_frame_set_file_pos_get(tng_data
, frame_set
, pos
));
410 tng_function_status DECLSPECDLLEXPORT tng_frame_set_frame_range_get_
411 (const tng_trajectory_t tng_data
,
412 const tng_trajectory_frame_set_t frame_set
,
413 int64_t *first_frame
,
416 return(tng_frame_set_frame_range_get(tng_data
, frame_set
, first_frame
,
420 tng_function_status DECLSPECDLLEXPORT
tng_molecule_init_(const tng_trajectory_t tng_data
,
421 tng_molecule_t molecule
)
423 return(tng_molecule_init(tng_data
, molecule
));
426 tng_function_status DECLSPECDLLEXPORT tng_molecule_destroy_
427 (const tng_trajectory_t tng_data
,
428 tng_molecule_t molecule
)
430 return(tng_molecule_destroy(tng_data
, molecule
));
433 tng_function_status DECLSPECDLLEXPORT
tng_molecule_add_(tng_trajectory_t tng_data
,
435 tng_molecule_t
*molecule
,
438 char *n
= malloc(name_len
+ 1);
439 tng_function_status stat
;
441 strncpy(n
, name
, name_len
);
443 stat
= tng_molecule_add(tng_data
, n
, molecule
);
448 tng_function_status DECLSPECDLLEXPORT
tng_molecule_name_set_(tng_trajectory_t tng_data
,
449 tng_molecule_t molecule
,
450 const char *new_name
,
453 char *name
= malloc(name_len
+ 1);
454 tng_function_status stat
;
456 strncpy(name
, new_name
, name_len
);
458 stat
= tng_molecule_name_set(tng_data
, molecule
, name
);
463 tng_function_status DECLSPECDLLEXPORT
tng_molecule_cnt_get_(tng_trajectory_t tng_data
,
464 tng_molecule_t molecule
,
467 return(tng_molecule_cnt_get(tng_data
, molecule
, cnt
));
470 tng_function_status DECLSPECDLLEXPORT
tng_molecule_cnt_set_(tng_trajectory_t tng_data
,
471 tng_molecule_t molecule
,
474 return(tng_molecule_cnt_set(tng_data
, molecule
, *cnt
));
477 tng_function_status DECLSPECDLLEXPORT
tng_molecule_find_(tng_trajectory_t tng_data
,
480 tng_molecule_t
*molecule
,
483 char *n
= malloc(name_len
+ 1);
484 tng_function_status stat
;
486 strncpy(n
, name
, name_len
);
488 stat
= tng_molecule_find(tng_data
, n
, nr
, molecule
);
493 tng_function_status DECLSPECDLLEXPORT
tng_molecule_chain_find_(tng_trajectory_t tng_data
,
494 tng_molecule_t molecule
,
500 char *n
= malloc(name_len
+ 1);
501 tng_function_status stat
;
503 strncpy(n
, name
, name_len
);
505 stat
= tng_molecule_chain_find(tng_data
, molecule
, n
, id
, chain
);
510 tng_function_status DECLSPECDLLEXPORT
tng_molecule_chain_add_(tng_trajectory_t tng_data
,
511 tng_molecule_t molecule
,
516 char *n
= malloc(name_len
+ 1);
517 tng_function_status stat
;
519 strncpy(n
, name
, name_len
);
521 stat
= tng_molecule_chain_add(tng_data
, molecule
, n
, chain
);
526 tng_function_status DECLSPECDLLEXPORT
tng_chain_name_set_(tng_trajectory_t tng_data
,
528 const char *new_name
,
531 char *name
= malloc(name_len
+ 1);
532 tng_function_status stat
;
534 strncpy(name
, new_name
, name_len
);
536 stat
= tng_chain_name_set(tng_data
, chain
, name
);
541 tng_function_status DECLSPECDLLEXPORT
tng_chain_residue_add_(tng_trajectory_t tng_data
,
544 tng_residue_t
*residue
,
547 char *n
= malloc(name_len
+ 1);
548 tng_function_status stat
;
550 strncpy(n
, name
, name_len
);
552 stat
= tng_chain_residue_add(tng_data
, chain
, n
, residue
);
557 tng_function_status DECLSPECDLLEXPORT
tng_residue_name_set_(tng_trajectory_t tng_data
,
558 tng_residue_t residue
,
559 const char *new_name
,
562 char *name
= malloc(name_len
+ 1);
563 tng_function_status stat
;
565 strncpy(name
, new_name
, name_len
);
567 stat
= tng_residue_name_set(tng_data
, residue
, name
);
572 tng_function_status DECLSPECDLLEXPORT
tng_residue_atom_add_(tng_trajectory_t tng_data
,
573 tng_residue_t residue
,
574 const char *atom_name
,
575 const char *atom_type
,
580 char *name
= malloc(name_len
+ 1);
581 char *type
= malloc(type_len
+ 1);
582 tng_function_status stat
;
584 strncpy(name
, atom_name
, name_len
);
585 strncpy(type
, atom_type
, type_len
);
588 stat
= tng_residue_atom_add(tng_data
, residue
, name
, type
, atom
);
594 tng_function_status DECLSPECDLLEXPORT
tng_atom_name_set_(tng_trajectory_t tng_data
,
596 const char *new_name
,
599 char *name
= malloc(name_len
+ 1);
600 tng_function_status stat
;
602 strncpy(name
, new_name
, name_len
);
604 stat
= tng_atom_name_set(tng_data
, atom
, name
);
609 tng_function_status DECLSPECDLLEXPORT
tng_atom_type_set_(tng_trajectory_t tng_data
,
611 const char *new_type
,
614 char *type
= malloc(type_len
+ 1);
615 tng_function_status stat
;
617 strncpy(type
, new_type
, type_len
);
619 stat
= tng_atom_type_set(tng_data
, atom
, type
);
624 tng_function_status DECLSPECDLLEXPORT tng_molecule_name_of_particle_nr_get_
625 (const tng_trajectory_t tng_data
,
630 return(tng_molecule_name_of_particle_nr_get(tng_data
, nr
, name
, max_len
));
633 tng_function_status DECLSPECDLLEXPORT tng_chain_name_of_particle_nr_get_
634 (const tng_trajectory_t tng_data
,
639 return(tng_chain_name_of_particle_nr_get(tng_data
, nr
, name
, max_len
));
642 tng_function_status DECLSPECDLLEXPORT tng_residue_name_of_particle_nr_get_
643 (const tng_trajectory_t tng_data
,
648 return(tng_residue_name_of_particle_nr_get(tng_data
, nr
, name
, max_len
));
651 tng_function_status DECLSPECDLLEXPORT tng_residue_id_of_particle_nr_get_
652 (const tng_trajectory_t tng_data
,
656 return(tng_residue_id_of_particle_nr_get(tng_data
, nr
, id
));
659 tng_function_status DECLSPECDLLEXPORT tng_atom_name_of_particle_nr_get_
660 (const tng_trajectory_t tng_data
,
665 return(tng_atom_name_of_particle_nr_get(tng_data
, nr
, name
, max_len
));
668 tng_function_status DECLSPECDLLEXPORT tng_atom_type_of_particle_nr_get_
669 (const tng_trajectory_t tng_data
,
674 return(tng_atom_type_of_particle_nr_get(tng_data
, nr
, type
, max_len
));
677 tng_function_status DECLSPECDLLEXPORT tng_particle_mapping_add_
678 (tng_trajectory_t tng_data
,
679 const int64_t *first_particle_number
,
680 const int64_t *n_particles
,
681 const int64_t *mapping_table
)
683 return(tng_particle_mapping_add(tng_data
, *first_particle_number
,
684 *n_particles
, mapping_table
));
687 tng_function_status DECLSPECDLLEXPORT
tng_file_headers_read_(tng_trajectory_t tng_data
,
688 const char *hash_mode
)
690 return(tng_file_headers_read(tng_data
, *hash_mode
));
693 tng_function_status DECLSPECDLLEXPORT tng_file_headers_write_
694 (tng_trajectory_t tng_data
,
695 const char *hash_mode
)
697 return(tng_file_headers_write(tng_data
, *hash_mode
));
700 tng_function_status DECLSPECDLLEXPORT tng_block_read_next_
701 (tng_trajectory_t tng_data
,
702 tng_gen_block_t block_data
,
703 const char *hash_mode
)
705 return(tng_block_read_next(tng_data
, block_data
, *hash_mode
));
708 tng_function_status DECLSPECDLLEXPORT tng_frame_set_read_next_
709 (tng_trajectory_t tng_data
,
710 const char *hash_mode
)
712 return(tng_frame_set_read_next(tng_data
, *hash_mode
));
715 tng_function_status DECLSPECDLLEXPORT
tng_frame_set_write_(tng_trajectory_t tng_data
,
716 const char *hash_mode
)
718 return(tng_frame_set_write(tng_data
, *hash_mode
));
721 tng_function_status DECLSPECDLLEXPORT
tng_frame_set_new_(tng_trajectory_t tng_data
,
722 const int64_t *first_frame
,
723 const int64_t *n_frames
)
725 return(tng_frame_set_new(tng_data
, *first_frame
, *n_frames
));
728 tng_function_status DECLSPECDLLEXPORT tng_frame_set_with_time_new_
729 (tng_trajectory_t tng_data
,
730 const int64_t *first_frame
,
731 const int64_t *n_frames
,
732 const double *first_frame_time
)
734 return(tng_frame_set_with_time_new(tng_data
, *first_frame
, *n_frames
,
738 tng_function_status DECLSPECDLLEXPORT tng_frame_set_first_frame_time_set_
739 (tng_trajectory_t tng_data
,
740 const double *first_frame_time
)
742 return(tng_frame_set_first_frame_time_set(tng_data
, *first_frame_time
));
745 tng_function_status DECLSPECDLLEXPORT tng_data_block_add_
746 (tng_trajectory_t tng_data
,
748 const char *block_name
,
749 const char *datatype
,
750 const char *block_type_flag
,
752 const int64_t *n_values_per_frame
,
753 const int64_t *stride_length
,
754 const int64_t *codec_id
,
758 char *name
= malloc(name_len
+ 1);
759 tng_function_status stat
;
761 strncpy(name
, block_name
, name_len
);
763 stat
= tng_data_block_add(tng_data
, *id
, name
, *datatype
, *block_type_flag
,
764 *n_frames
, *n_values_per_frame
, *stride_length
,
765 *codec_id
, new_data
);
770 tng_function_status DECLSPECDLLEXPORT tng_particle_data_block_add_
771 (tng_trajectory_t tng_data
,
773 const char *block_name
,
774 const char *datatype
,
775 const char *block_type_flag
,
777 const int64_t *n_values_per_frame
,
778 const int64_t *stride_length
,
779 const int64_t *first_particle_number
,
780 const int64_t *n_particles
,
781 const int64_t *codec_id
,
785 char *name
= malloc(name_len
+ 1);
786 tng_function_status stat
;
788 strncpy(name
, block_name
, name_len
);
790 stat
= tng_particle_data_block_add(tng_data
, *id
, name
, *datatype
,
791 *block_type_flag
, *n_frames
,
792 *n_values_per_frame
, *stride_length
,
793 *first_particle_number
, *n_particles
,
794 *codec_id
, new_data
);
799 tng_function_status DECLSPECDLLEXPORT tng_frame_data_write_
800 (tng_trajectory_t tng_data
,
801 const int64_t *frame_nr
,
802 const int64_t *block_id
,
804 const char *hash_mode
)
806 return(tng_frame_data_write(tng_data
, *frame_nr
, *block_id
, data
,
810 tng_function_status DECLSPECDLLEXPORT tng_frame_particle_data_write_
811 (tng_trajectory_t tng_data
,
812 const int64_t *frame_nr
,
813 const int64_t *block_id
,
814 const int64_t *val_first_particle
,
815 const int64_t *val_n_particles
,
817 const char *hash_mode
)
819 return(tng_frame_particle_data_write(tng_data
, *frame_nr
, *block_id
,
820 *val_first_particle
, *val_n_particles
,
824 tng_function_status DECLSPECDLLEXPORT tng_data_values_free_
825 (const tng_trajectory_t tng_data
,
826 union data_values
**values
,
827 const int64_t *n_frames
,
828 const int64_t *n_values_per_frame
,
831 return(tng_data_values_free(tng_data
, values
, *n_frames
,
832 *n_values_per_frame
, *type
));
835 tng_function_status DECLSPECDLLEXPORT tng_particle_data_values_free_
836 (const tng_trajectory_t tng_data
,
837 union data_values
***values
,
838 const int64_t *n_frames
,
839 const int64_t *n_particles
,
840 const int64_t *n_values_per_frame
,
843 return(tng_particle_data_values_free(tng_data
, values
, *n_frames
, *n_particles
,
844 *n_values_per_frame
, *type
));
847 tng_function_status DECLSPECDLLEXPORT tng_data_get_
848 (tng_trajectory_t tng_data
,
849 const int64_t *block_id
,
850 union data_values
***values
,
852 int64_t *n_values_per_frame
,
855 return(tng_data_get(tng_data
, *block_id
, values
, n_frames
,
856 n_values_per_frame
, type
));
859 tng_function_status DECLSPECDLLEXPORT tng_data_interval_get_
860 (tng_trajectory_t tng_data
,
861 const int64_t *block_id
,
862 const int64_t *start_frame_nr
,
863 const int64_t *end_frame_nr
,
864 const char *hash_mode
,
865 union data_values
***values
,
866 int64_t *n_values_per_frame
,
869 return(tng_data_interval_get(tng_data
, *block_id
, *start_frame_nr
,
870 *end_frame_nr
, *hash_mode
, values
,
871 n_values_per_frame
, type
));
874 tng_function_status DECLSPECDLLEXPORT tng_particle_data_get_
875 (tng_trajectory_t tng_data
,
876 const int64_t *block_id
,
877 union data_values
****values
,
879 int64_t *n_particles
,
880 int64_t *n_values_per_frame
,
883 return(tng_particle_data_get(tng_data
, *block_id
, values
, n_frames
,
884 n_particles
, n_values_per_frame
, type
));
887 tng_function_status DECLSPECDLLEXPORT tng_particle_data_interval_get_
888 (tng_trajectory_t tng_data
,
889 const int64_t *block_id
,
890 const int64_t *start_frame_nr
,
891 const int64_t *end_frame_nr
,
892 const char *hash_mode
,
893 union data_values
****values
,
894 int64_t *n_particles
,
895 int64_t *n_values_per_frame
,
898 return(tng_particle_data_interval_get(tng_data
, *block_id
, *start_frame_nr
,
899 *end_frame_nr
, *hash_mode
, values
,
900 n_particles
, n_values_per_frame
,
904 tng_function_status DECLSPECDLLEXPORT tng_time_get_str_
905 (const tng_trajectory_t tng_data
,
906 char *time
, int64_t str_len
)
908 return(tng_time_get_str(tng_data
, time
));
911 tng_function_status DECLSPECDLLEXPORT tng_util_trajectory_open_
912 (const char *filename
, const char *mode
,
913 tng_trajectory_t
*tng_data_p
)
915 return(tng_util_trajectory_open(filename
, *mode
, tng_data_p
));
918 tng_function_status DECLSPECDLLEXPORT tng_util_trajectory_close_
919 (tng_trajectory_t
*tng_data_p
)
921 return(tng_util_trajectory_close(tng_data_p
));
924 tng_function_status DECLSPECDLLEXPORT tng_util_pos_read_
925 (tng_trajectory_t tng_data
,
927 int64_t *stride_length
)
929 return(tng_util_pos_read(tng_data
, positions
, stride_length
));
932 tng_function_status DECLSPECDLLEXPORT tng_util_vel_read_
933 (tng_trajectory_t tng_data
,
935 int64_t *stride_length
)
937 return(tng_util_vel_read(tng_data
, velocities
, stride_length
));
940 tng_function_status DECLSPECDLLEXPORT tng_util_force_read_
941 (tng_trajectory_t tng_data
,
943 int64_t *stride_length
)
945 return(tng_util_force_read(tng_data
, forces
, stride_length
));
948 tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_read_
949 (tng_trajectory_t tng_data
,
951 int64_t *stride_length
)
953 return(tng_util_box_shape_read(tng_data
, box_shape
, stride_length
));
956 tng_function_status DECLSPECDLLEXPORT tng_util_pos_read_range_
957 (tng_trajectory_t tng_data
,
958 const int64_t *first_frame
,
959 const int64_t *last_frame
,
961 int64_t *stride_length
)
963 return(tng_util_pos_read_range(tng_data
, *first_frame
, *last_frame
,
964 positions
, stride_length
));
967 tng_function_status DECLSPECDLLEXPORT tng_util_vel_read_range_
968 (tng_trajectory_t tng_data
,
969 const int64_t *first_frame
,
970 const int64_t *last_frame
,
972 int64_t *stride_length
)
974 return(tng_util_vel_read_range(tng_data
, *first_frame
, *last_frame
,
975 velocities
, stride_length
));
978 tng_function_status DECLSPECDLLEXPORT tng_util_force_read_range_
979 (tng_trajectory_t tng_data
,
980 const int64_t *first_frame
,
981 const int64_t *last_frame
,
983 int64_t *stride_length
)
985 return(tng_util_force_read_range(tng_data
, *first_frame
, *last_frame
,
986 forces
, stride_length
));
989 tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_read_range_
990 (tng_trajectory_t tng_data
,
991 const int64_t *first_frame
,
992 const int64_t *last_frame
,
994 int64_t *stride_length
)
996 return(tng_util_box_shape_read_range(tng_data
, *first_frame
, *last_frame
,
997 box_shape
, stride_length
));
1000 tng_function_status DECLSPECDLLEXPORT tng_util_generic_write_frequency_set_
1001 (tng_trajectory_t tng_data
,
1003 const int64_t *n_values_per_frame
,
1004 const int64_t *block_id
,
1005 const char *block_name
,
1006 const char *particle_dependency
,
1007 const char *compression
)
1009 return(tng_util_generic_write_frequency_set(tng_data
, *f
,
1010 *n_values_per_frame
, *block_id
,
1012 *particle_dependency
,
1016 tng_function_status DECLSPECDLLEXPORT tng_util_pos_write_frequency_set_
1017 (tng_trajectory_t tng_data
,
1020 return(tng_util_pos_write_frequency_set(tng_data
, *f
));
1023 tng_function_status DECLSPECDLLEXPORT tng_util_vel_write_frequency_set_
1024 (tng_trajectory_t tng_data
,
1027 return(tng_util_vel_write_frequency_set(tng_data
, *f
));
1030 tng_function_status DECLSPECDLLEXPORT tng_util_force_write_frequency_set_
1031 (tng_trajectory_t tng_data
,
1034 return(tng_util_force_write_frequency_set(tng_data
, *f
));
1037 tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_write_frequency_set_
1038 (tng_trajectory_t tng_data
,
1041 return(tng_util_box_shape_write_frequency_set(tng_data
, *f
));
1044 tng_function_status DECLSPECDLLEXPORT tng_util_generic_write_
1045 (tng_trajectory_t tng_data
,
1046 const int64_t *frame_nr
,
1047 const float *values
,
1048 const int64_t *n_values_per_frame
,
1049 const int64_t *block_id
,
1050 const char *block_name
,
1051 const char *particle_dependency
,
1052 const char *compression
)
1054 return(tng_util_generic_write(tng_data
, *frame_nr
, values
,
1055 *n_values_per_frame
, *block_id
, block_name
,
1056 *particle_dependency
, *compression
));
1059 tng_function_status DECLSPECDLLEXPORT tng_util_pos_write_
1060 (tng_trajectory_t tng_data
,
1061 const int64_t *frame_nr
,
1062 const float *positions
)
1064 return(tng_util_vel_write(tng_data
, *frame_nr
, positions
));
1067 tng_function_status DECLSPECDLLEXPORT tng_util_vel_write_
1068 (tng_trajectory_t tng_data
,
1069 const int64_t *frame_nr
,
1070 const float *velocities
)
1072 return(tng_util_vel_write(tng_data
, *frame_nr
, velocities
));
1075 tng_function_status DECLSPECDLLEXPORT tng_util_force_write_
1076 (tng_trajectory_t tng_data
,
1077 const int64_t *frame_nr
,
1078 const float *forces
)
1080 return(tng_util_force_write(tng_data
, *frame_nr
, forces
));
1083 tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_write_
1084 (tng_trajectory_t tng_data
,
1085 const int64_t *frame_nr
,
1086 const float *box_shape
)
1088 return(tng_util_box_shape_write(tng_data
, *frame_nr
, box_shape
));
1091 tng_function_status DECLSPECDLLEXPORT tng_util_pos_with_time_write_
1092 (tng_trajectory_t tng_data
,
1093 const int64_t *frame_nr
,
1094 const int64_t *time
,
1095 const float *positions
)
1097 return(tng_util_pos_with_time_write(tng_data
, *frame_nr
, *time
,
1101 tng_function_status DECLSPECDLLEXPORT tng_util_vel_with_time_write_
1102 (tng_trajectory_t tng_data
,
1103 const int64_t *frame_nr
,
1104 const int64_t *time
,
1105 const float *velocities
)
1107 return(tng_util_vel_with_time_write(tng_data
, *frame_nr
, *time
,
1111 tng_function_status DECLSPECDLLEXPORT tng_util_force_with_time_write_
1112 (tng_trajectory_t tng_data
,
1113 const int64_t *frame_nr
,
1114 const int64_t *time
,
1115 const float *forces
)
1117 return(tng_util_force_with_time_write(tng_data
, *frame_nr
, *time
,
1121 tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_with_time_write_
1122 (tng_trajectory_t tng_data
,
1123 const int64_t *frame_nr
,
1124 const int64_t *time
,
1125 const float *box_shape
)
1127 return(tng_util_box_shape_with_time_write(tng_data
, *frame_nr
, *time
,