Manual Pages for UNIX Darwin command on man BIO_get_info_callback
MyWebUniversity

Manual Pages for UNIX Darwin command on man BIO_get_info_callback

BIOctrl(3) OpenSSL BIOctrl(3)

NAME

BIOctrl, BIOcallbackctrl, BIOptrctrl, BIOintctrl, BIOreset, BIOseek, BIOtell, BIOflush, BIOeof, BIOsetclose, BIOgetclose, BIOpending, BIOwpending, BIOctrlpending, BIOctrlwpending,

BIOgetinfocallback, BIOsetinfocallback - BIO control operations

SYNOPSIS

#include

long BIOctrl(BIO *bp,int cmd,long larg,void *parg); long BIOcallbackctrl(BIO *b, int cmd, void (*fp)(struct biost *, int, const char *, int, long, long)); char * BIOptrctrl(BIO *bp,int cmd,long larg); long BIOintctrl(BIO *bp,int cmd,long larg,int iarg); int BIOreset(BIO *b); int BIOseek(BIO *b, int ofs); int BIOtell(BIO *b); int BIOflush(BIO *b); int BIOeof(BIO *b); int BIOsetclose(BIO *b,long flag); int BIOgetclose(BIO *b); int BIOpending(BIO *b); int BIOwpending(BIO *b); sizet BIOctrlpending(BIO *b); sizet BIOctrlwpending(BIO *b); int BIOgetinfocallback(BIO *b,bioinfocb **cbp); int BIOsetinfocallback(BIO *b,bioinfocb *cb); typedef void bioinfocb(BIO *b, int oper, const char *ptr, int arg1, long arg2, long arg3);

DESCRIPTION

BIOctrl(), BIOcallbackctrl(), BIOptrctrl() and BIOintctrl() are BIO "control" operations taking arguments of various types. These functions are not normally called directly, various macros are used instead. The standard macros are described below, macros specific to a particular type of BIO are described in the specific BIOs manual page as well as any special features of the standard calls. BIOreset() typically resets a BIO to some initial state, in the case of file related BIOs for example it rewinds the file pointer to the start of the file. BIOseek() resets a file related BIO's (that is file descriptor and FILE BIOs) file position pointer to ooffss bytes from start of file. BIOtell() returns the current file position of a file related BIO. BIOflush() normally writes out any internally buffered data, in some cases it is used to signal EOF and that no more data will be written. BIOeof() returns 1 if the BIO has read EOF, the precise meaning of "EOF" varies according to the BIO type. BIOsetclose() sets the BIO bb close flag to ffllaagg. ffllaagg can take the value BIOCLOSE or BIONOCLOSE. Typically BIOCLOSE is used in a source/sink BIO to indicate that the underlying I/O stream should be closed when the BIO is freed. BIOgetclose() returns the BIOs close flag. BIOpending(), BIOctrlpending(), BIOwpending() and BIOctrlwpending() return the number of pending characters in the BIOs read and write buffers. Not all BIOs support these calls. BIOctrlpending() and BIOctrlwpending() return a sizet type and are functions, BIOpending() and BIOwpending() are macros which call BIOctrl().

RETURN VALUES

BIOreset() normally returns 1 for success and 0 or -1 for failure.

File BIOs are an exception, they return 0 for success and -1 for

failure. BIOseek() and BIOtell() both return the current file position on

success and -1 for failure, except file BIOs which for BIOseek()

always return 0 for success and -1 for failure.

BIOflush() returns 1 for success and 0 or -1 for failure.

BIOeof() returns 1 if EOF has been reached 0 otherwise. BIOsetclose() always returns 1. BIOgetclose() returns the close flag value: BIOCLOSE or BIONOCLOSE. BIOpending(), BIOctrlpending(), BIOwpending() and BIOctrlwpending() return the amount of pending data. NNOOTTEESS

BIOflush(), because it can write data may return 0 or -1 indicating

that the call should be retried later in a similar manner to BIOwrite(). The BIOshouldretry() call should be used and appropriate action taken is the call fails. The return values of BIOpending() and BIOwpending() may not reliably determine the amount of pending data in all cases. For example in the case of a file BIO some data may be available in the FILE structures internal buffers but it is not possible to determine this in a portably way. For other types of BIO they may not be supported. Filter BIOs if they do not internally handle a particular BIOctrl() operation usually pass the operation to the next BIO in the chain. This often means there is no need to locate the required BIO for a particular operation, it can be called on a chain and it will be automatically passed to the relevant BIO. However this can cause unexpected results: for example no current filter BIOs implement BIOseek(), but this may still succeed if the chain ends in a FILE or file descriptor BIO. Source/sink BIOs return an 0 if they do not recognize the BIOctrl() operation.

BUGS

Some of the return values are ambiguous and care should be taken. In particular a return value of 0 can be returned if an operation is not supported, if an error occurred, if EOF has not been reached and in the case of BIOseek() on a file BIO for a successful operation.

SEE ALSO

TBA

0.9.7l 2000-09-18 BIOctrl(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™