cfunc.writev

C Function/C Functions, Releases: AP 6.1

Pick/BASIC 'writev' functionality from C.

Syntax

int _CP_writev(int type, CPSTR* string1, int expression1, CPSTR* string2, expression2)

Description

equivalent to the Pick/BASIC statements: writev, writevu

type Pick/BASIC statement

_CP_WRITEV writev string1 on expression1,string2,expression2

_CP_WRITEUV writevu string1 on expression1,string2,expression2

The expression1 should be an integer file descriptor returned by the _CP_open call.

This function returns -1 if an error occurs. The error code is contained in _CP_errno.

Example

The following example writes 'hi' into attribute 1 of item
'myid' in 'myfile'.

CPSTR * s = _CP_mkstr('myfile');
CPSTR * t = _CP_mkstr('hi');
CPSTR * id = _CP_mkstr('myid');
int f;

_CP_open(&f,_CP_str_null,s);
_CP_writev(_CP_WRITE, t, f, id, 1);

See Also

Command Name Type Description
cfunc.introduction Introductory Overview
cfunc.open C Function Pick/BASIC 'open' functionality from C.
cfunc.close C Function Pick/BASIC 'close' functionality from C.
cfunc.write C Function Pick/BASIC 'write' functionality from C.
cfunc.read C Function Pick/BASIC 'read' functionality from C.
cfunc.readv C Function Pick/BASIC 'readv' functionality from C.

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.