#include "Pkt.h" PacketType *suffix2pkttype(char *suffix) PacketType *header2pkttype(short hdrcode, short bodycode) Tbl *pktsuffixes(int content)
Because some earlier packet source names don't include a suffix, but instead use a now deprecated "standard" header, a secondary method using the hdrcode and bodycode from that header for cases where the suffix is null.
pktsuffixes returns a list of the suffixes which promise to return a particular content: waveform (Pkt_wf), database row (Pkt_db), etcetera. However, the actual content may be dynamic: a few packets sometimes return waveform data, and other times return some other data type. Only unstuffPkt can truly determine the content of every packet. The list may be freed with freetbl(list,0) ;
The return value is zero if no packet matches; otherwise the returned PacketType * value contains at least the following:
typedef struct PacketType { char *name ; char *suffix ; int content ; int hdrcode ; int bodycode ; char *desc ; int (*stuff)(Packet *,char *,double *,char **,int *,int *) ; int (*unstuff)(char *,double,char *,int,Packet *) ; } PacketType ;
stuffPkt(3) unstuffPkt(3)