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


A.5.17 bpipe_iochannel_new

create and initialize an IOchannel structure

Synopsis

#include <bpipe/bpipe.h>

IOchannel *bpipe_iochannel_new(const char *path);

Parameters

const char *path

a path to the file or device to use as the I/O channel

Description

This routine allocates an IOchannel structure, making a copy of the passed path to the file or device to use as the I/O channel. It does not open the I/O channel.

Returns

It returns a pointer to a dynamically allocated IOchannel structure. It returns NULL if path is empty or NULL, or if it couldn’t allocate memory for the structure.. Upon error bpipe_errno is set and NULL is returned.

Errors

Upon error bpipe_errno is set to one of the following errors:

BPENOMEM

a memory allocation failed