BIO_push 3 2001-04-11 0.9.9-dev OpenSSL

NAME

BIO_push, BIO_pop - add and remove BIOs from a chain.

LIBRARY

libcrypto, -lcrypto

SYNOPSIS


 #include 


 BIO *  BIO_push(BIO *b,BIO *append);
 BIO *  BIO_pop(BIO *b);

DESCRIPTION

The _B_I_O___p_u_s_h_(_) function appends the BIO aappppeenndd to bb, it returns bb.

_B_I_O___p_o_p_(_) removes the BIO bb from a chain and returns the next BIO in the chain, or NULL if there is no next BIO. The removed BIO then becomes a single BIO with no association with the original chain, it can thus be freed or attached to a different chain.

NOTES

The names of these functions are perhaps a little misleading. _B_I_O___p_u_s_h_(_) joins two BIO chains whereas _B_I_O___p_o_p_(_) deletes a single BIO from a chain, the deleted BIO does not need to be at the end of a chain.

The process of calling _B_I_O___p_u_s_h_(_) and _B_I_O___p_o_p_(_) on a BIO may have additional consequences (a control call is made to the affected BIOs) any effects will be noted in the descriptions of individual BIOs.

EXAMPLES

For these examples suppose mmdd11 and mmdd22 are digest BIOs, bb6644 is a base64 BIO and ff is a file BIO.

If the call:


 BIO_push(b64, f);

is made then the new chain will be bb6644--cchhaaiinn. After making the calls



 BIO_push(md2, b64);
 BIO_push(md1, md2);

the new chain is mmdd11--mmdd22--bb6644--ff. Data written to mmdd11 will be digested by mmdd11 and mmdd22, bbaassee6644 encoded and written to ff.

It should be noted that reading causes data to pass in the reverse direction, that is data is read from ff, base64 ddeeccooddeedd and digested by mmdd11 and mmdd22. If the call:


 BIO_pop(md2);

The call will return bb6644 and the new chain will be mmdd11--bb6644--ff data can be written to mmdd11 as before.

RETURN VALUES

_B_I_O___p_u_s_h_(_) returns the end of the chain, bb.

_B_I_O___p_o_p_(_) returns the next BIO in the chain, or NULL if there is no next BIO.

SEE ALSO

TBA