Next: , Previous: dpktf_name_cmp, Up: Internal Functions   [Contents]


A.5.34 dpktf_new

Create and initialize a data packet field.

Synopsis

#include <bpipe/bpipe.h>

static DpktField *dpktf_new(
  const char *name,
  BPDataType type
);

Parameters

const char *name

name of data packet field

BPDataType type

storage class of field


Possible values for a BPDataType are as follows: BPDType_char, BPDType_double, BPDType_int, BPDType_uint, BPDType_DVector2, BPDType_DVector3, BPDType_IVector2, BPDType_IVector3, BPDType_UIVector2, BPDType_UIVector3, BPDType_DComplex, BPDType_DCVector2, BPDType_DCVector3

Description

This routine creates and initializes a data packet field structure. It duplicates the passed field name, and type. They are all assumed to be valid.

Returns

It returns a pointer to a dynamically allocated and initialized DpktField structure. Upon error it returns NULL and sets bpipe_errno.

Errors

Upon error bpipe_errno is set to one of the following:

BPENOMEM

a memory allocation failed