Top | ![]() |
![]() |
![]() |
![]() |
Stream * | open_stream_fd_for_write () |
Stream * | open_stream_for_read () |
Stream * | open_stream_for_write () |
Stream * | open_stream_for_write_2 () |
int | get_stream_fd () |
void | close_stream () |
int | read_chunk () |
int | read_chunk_2 () |
int | write_chunk () |
int | rewind_stream () |
int | is_stream () |
void | write_command () |
void | write_geometry_file () |
typedef | Stream |
enum | StreamReadFlags |
#define | CHUNK_END_MARKER |
#define | CHUNK_START_MARKER |
#define | CRYSTAL_END_MARKER |
#define | CRYSTAL_START_MARKER |
#define | PEAK_LIST_END_MARKER |
#define | PEAK_LIST_START_MARKER |
#define | REFLECTION_END_MARKER |
#define | REFLECTION_START_MARKER |
#define | GEOM_END_MARKER |
#define | GEOM_START_MARKER |
struct | stuff_from_stream |
Stream *
open_stream_fd_for_write (int fd
);
Creates a new Stream
from fd
, so that stream data can be written to fd
using write_chunk()
.
In contrast to open_stream_for_write()
, this function does not write any of
the usual headers. This function is mostly for use when multiple substreams
need to be multiplexed into a single master stream. The master would be
opened using open_stream_for_write()
, and the substreams using this function.
Stream *
open_stream_for_write (const char *filename
);
Creates a new stream with name filename
, and adds the stream format
and version headers.
You may want to follow this with a call to write_command()
to record the
command line.
Stream * open_stream_for_write_2 (const char *filename
,const char *geom_filename
,int argc
,char *argv[]
);
Creates a new stream with name filename
, and adds the stream format
and version header, plus a verbatim copy of the geometry file
You may want to follow this with a call to write_command()
to record the
command line.
int
get_stream_fd (Stream *st
);
This function gets the integer file descriptor for st
, a bit like fileno()
.
This is useful in conjunction with open_stream_fd_for_write()
, to get the
underlying file descriptor to which the multiplexed stream data should be
written. In this case, the only other operations you should ever do (or have
done) on st
are open_stream_for_write()
and close_stream()
.
int write_chunk (Stream *st
,struct image *image
,struct hdfile *hdfile
,int include_peaks
,int include_reflections
,struct event *ev
);
int
rewind_stream (Stream *st
);
Attempts to set the file pointer for st
to the start of the stream, so that
later calls to read_chunk()
will repeat the sequence of chunks from the
start.
Programs must not assume that this operation always succeeds!
void write_command (Stream *st
,int argc
,char *argv[]
);
Writes the command line to st
. argc
and argv
should be exactly as were
given to main()
. This should usually be called immediately after
open_stream_for_write()
.
void write_geometry_file (Stream *st
,const char *geom_filename
);
Writes the content of the geometry file to st
. This should usually be
called immediately after write_command()
.
A bitfield of things that can be read from a stream. Use this (and
read_chunk_2()
) to read the stream faster if you don't need the entire
contents of the stream.
Using either or both of STREAM_READ_REFLECTIONS
and STREAM_READ_UNITCELL
implies STREAM_READ_CRYSTALS
.