1 /* $Id: filestring.h 213279 2018-02-10 10:50:45Z twu $ */
2 #ifndef FILESTRING_INCLUDED
3 #define FILESTRING_INCLUDED
4 
5 #ifdef USE_MPI
6 #include <mpi.h>
7 #include "mpidebug.h"
8 #endif
9 
10 #include <stdio.h>
11 #include "samflags.h"
12 
13 #define FPRINTF Filestring_put
14 #define PUTC Filestring_putc
15 
16 
17 #define T Filestring_T
18 typedef struct T *T;
19 
20 extern int
21 Filestring_id (T this);
22 extern void
23 Filestring_set_split_output (T this, int split_output);
24 extern SAM_split_output_type
25 Filestring_split_output (T this);
26 extern T
27 Filestring_new (int id);
28 extern void
29 Filestring_free (T *old);
30 extern void
31 Filestring_stringify (T this);
32 extern void
33 Filestring_print (
34 #ifdef USE_MPI
35 		  MPI_File fp,
36 #else
37 		  FILE *fp,
38 #endif
39 		  T this);
40 extern char *
41 Filestring_get (int *strlength, T this);
42 extern void
43 Filestring_put (T this, const char *format, ...);
44 extern void
45 Filestring_putc (char c, T this);
46 extern void
47 Filestring_puts (T this, char *string, int strlength);
48 extern void
49 Filestring_merge (T dest, T source);
50 
51 #ifdef USE_MPI
52 extern char *
53 Filestring_extract (int *strlength, T this);
54 extern void
55 Filestring_send (T this, int dest, int tag, MPI_Comm comm);
56 extern char *
57 Filestring_recv (int *strlength, int source, int tag, MPI_Comm comm);
58 #endif
59 
60 
61 #undef T
62 #endif
63 
64 
65