RSA Security logo

RSA BSAFE Cert-C
API Reference

certio.h

Go to the documentation of this file.
00001 /*
00002 * Copyright (c) RSA Security Inc., 1999-2002.  All rights reserved.
00003 * This work contains proprietary, confidential, and trade secret
00004 * information of RSA Security Inc.  Use, disclosure or reproduction
00005 * without the express written authorization of RSA Security Inc. is
00006 * prohibited.
00007 */
00008 
00009 #ifndef _CERTIO_H_
00010 #define _CERTIO_H_ 1
00011 
00018 #include "basetype.h"
00019 #include "service.h"
00020 
00021 /* C_Open flags */
00022 #define IO_RDONLY   0x0000              /* open for reading only */
00023 #define IO_WRONLY   0x0001              /* open for writing only */
00024 #define IO_RDWR     0x0002              /* open for reading and writing */
00025 
00026 #define IO_CREAT    0x0100              /* create and open stream */
00027 #define IO_TRUNC    0x0200              /* open and truncate */
00028 #define IO_EXCL     0x0400              /* open only if stream doesn't already
00029                                            exist */
00030 #define IO_TEXT     0x4000              /* i/o mode is text (translated) */
00031 #define IO_BINARY   0x8000              /* i/o mode is binary (untranslated) */
00032 
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036 
00042 typedef POINTER     STREAM;             /* Cert-C stream pointer */
00043 
00115 int C_OpenStream (
00116   CERTC_CTX         ctx,                /* Cert-C context */
00117   char *            serviceName,        /* i/o service handler for stream */
00118   POINTER           streamName,         /* name of stream */
00119   unsigned int      flags,              /* stream flags */
00120   STREAM            *stream);           /* (out) stream pointer */
00121 
00132 int C_CloseStream (
00133   STREAM            stream);            /* stream pointer */
00134 
00179 int C_GetStreamLine (
00180   STREAM            stream,             /* stream pointer */
00181   char              *str,               /* storage for string */
00182   unsigned int      maxLen);            /* max # of characters to read */
00183 
00200 int C_PutStreamLine (
00201   STREAM            stream,             /* stream pointer */
00202   char              *str);              /* output string */
00203 
00234 int C_ReadStream (
00235   STREAM            stream,             /* stream pointer */
00236   unsigned char     *buf,               /* storage for data */
00237   unsigned int      len,                /* # of bytes to read */
00238   unsigned int      *actualLen);        /* (out) # of bytes read */
00239 
00257 int C_WriteStream (
00258   STREAM            stream,             /* stream pointer */
00259   unsigned char     *buf,               /* buffer */
00260   unsigned int      len);               /* # of bytes to write */
00261 
00279 int C_RewindStream (
00280   STREAM            stream);            /* stream pointer */
00281 
00282 #ifdef __cplusplus
00283 }
00284 #endif
00285 
00286 #endif /* _CERTIO_H_ */



RSA BSAFE® Cert-C 2.7 API Reference