RSA BSAFE Cert-C Micro Edition

The power of PKI for the smallest of devices

BIO_METHOD Reference

This structure stores pointers to functions that implement the BIO methods.

Each BIO has seven methods. A NULL pointer indicates that the method is not implemented.
The methods define the behavior of an individual BIO type, and are called directly by the BIO access functions. The methods modify the general BIO behavior by replacing it with the specific behavior for the BIO sub-class.

#include <bio.h>

typedef struct bio_method_st
{
    /**
     * The numeric identifier for the #BIO_METHOD containing bits for the
     * general/class and specific/instance.
     */
    int type;

    /**
     * The string identifier corresponding to the type.
     *        @see BIO_method_name().
     */
    char *name;

#if defined(MS_CALLBACK) || defined(MS_FAR)
    int (MS_FAR *bwrite)(BIO *bio,char *buf,int len);
    int (MS_FAR *bread)(BIO *bio,char *buf,int len);
    int (MS_FAR *bputs)(BIO *bio,char *buf);
    int (MS_FAR *bgets)(BIO *bio,char *buf, int len);
    long (MS_FAR *ctrl)(BIO *bio,int argi,long argl,char *argp);
    int (MS_FAR *create)(BIO *bio);
    int (MS_FAR *destroy)(BIO *bio);
#else /* !(defined(MS_CALLBACK) || defined(MS_FAR)) */
    /** The method for writing a number of Bytes from a buffer. */
    int (*bwrite)(BIO *bio,char *buf,int len);

    /** The method for reading Bytes into a buffer. */
    int (*bread)(BIO *bio,char *buf,int len);

    /** The special write method. */
    int (*bputs)(BIO *bio,char *buf);

    /** The special read method. */
    int (*bgets)(BIO *bio,char *buf, int len);

    /**
     * A general object control allowing object functionality in addition
     * to read/write and create/destroy operations.
     */
    long (*ctrl)(BIO *bio,int argi,long argl,char *argp);

    /**
     * The method for creating a #BIO instance (including setting values 
     * and allocating context memory).
     */
    int (*create)(BIO *bio);

    /**
     * The method for freeing an instance. The shutdown flag is checked to
     * determine whether the instance state (for example, underlying file
     * descriptors) should also be closed.
     */
    int (*destroy)(BIO *bio);
#endif /* !(defined(MS_CALLBACK) || defined(MS_FAR)) */
} BIO_METHOD;

Data Fields

int type
 The numeric identifier for the BIO_METHOD containing bits for the general/class and specific/instance.

char* name
 The string identifier corresponding to the type. More...

int(* bwrite )(BIO *bio, char *buf, int len)
 The method for writing a number of Bytes from a buffer.

int(* bread )(BIO *bio, char *buf, int len)
 The method for reading Bytes into a buffer.

int(* bputs )(BIO *bio, char *buf)
 The special write method.

int(* bgets )(BIO *bio, char *buf, int len)
 The special read method.

long(* ctrl )(BIO *bio, int argi, long argl, char *argp)
 A general object control allowing object functionality in addition to read/write and create/destroy operations.

int(* create )(BIO *bio)
 The method for creating a BIO instance (including setting values and allocating context memory).

int(* destroy )(BIO *bio)
 The method for freeing an instance. More...


Field Documentation

int(* destroy)(BIO *bio)
 

The method for freeing an instance. The shutdown flag is checked to determine whether the instance state (for example, underlying file descriptors) should also be closed.

char* name
 

The string identifier corresponding to the type.

See also:
BIO_method_name().


Copyright (c) 1999-2002 RSA Security Inc. All rights reserved. 061-001005-150-001-000-3768 - 1.5