rtxStreamCtxtBuf.h
00001 /* 00002 * Copyright (c) 2003-2009 Objective Systems, Inc. 00003 * 00004 * This software is furnished under a license and may be used and copied 00005 * only in accordance with the terms of such license and with the 00006 * inclusion of the above copyright notice. This software or any other 00007 * copies thereof may not be provided or otherwise made available to any 00008 * other person. No title to and ownership of the software is hereby 00009 * transferred. 00010 * 00011 * The information in this software is subject to change without notice 00012 * and should not be construed as a commitment by Objective Systems, Inc. 00013 * 00014 * PROPRIETARY NOTICE 00015 * 00016 * This software is an unpublished work subject to a confidentiality agreement 00017 * and is protected by copyright and trade secret law. Unauthorized copying, 00018 * redistribution or other use of this work is prohibited. 00019 * 00020 * The above notice of copyright on this source code product does not indicate 00021 * any actual or intended publication of such source code. 00022 * 00023 *****************************************************************************/ 00024 /* 00025 * @file rtxStreamCtxtBuf.h 00026 * Stream functions that work directly with the context buffer. 00027 */ 00028 #ifndef _RTXSTREAMCTXTBUF_H_ 00029 #define _RTXSTREAMCTXTBUF_H_ 00030 00031 #include "rtxsrc/osSysTypes.h" 00032 #include "rtxsrc/rtxExternDefs.h" 00033 #include "rtxsrc/rtxStream.h" 00034 00035 #ifdef __cplusplus 00036 extern "C" { 00037 #endif 00038 00039 /* 00040 * This function create and initializes a context-buffered stream. This 00041 * function should be called first before any operation with the stream. 00042 * 00043 * @param pctxt Pointer to context structure variable. 00044 * @return Completion status of operation: 0 (0) = success, 00045 * negative return value is error. 00046 */ 00047 EXTERNRT int rtxStreamCtxtBufCreate (OSCTXT* pctxt); 00048 00049 /* 00050 * This function pre-reads a 'size' number of octets of data from the input 00051 * stream into the internal stream buffer. This functions blocks until all 00052 * necessary data is read, end of file is detected, or another error 00053 * occurs. This function guarantees that the internal buffer will contain at 00054 * least the 'size' number of octets. Thus, it is possible to obtain direct 00055 * access to the memory buffer with pre-read data by using the 'buffer' field 00056 * of the OSCTXT context block. 00057 * 00058 * @param pctxt Pointer to a context structure variable that has 00059 * been initialized for stream operations. 00060 * @param size Number of octets to be pre-read. 00061 * @return Completion status of operation: 0 (0) = success, 00062 * negative return value is error. 00063 */ 00064 EXTERNRT int rtxStreamCtxtBufPreRead (OSCTXT* pctxt, size_t size); 00065 00066 /* 00067 * This function checks if the stream is already context-buffered or not. 00068 * If not, the stream will be created above the existing stream. 00069 * If the stream cannot be opened, an error code is returned. 00070 * 00071 * @param pctxt Pointer to a context structure variable that has 00072 * been initialized for stream operations. 00073 * @return Completion status of operation: 0 (0) = success, 00074 * negative return value is error. 00075 */ 00076 EXTERNRT int rtxStreamCtxtBufCheck (OSCTXT* pctxt); 00077 00078 /* 00079 * This function frees a context-buffered stream and restores the underlying stream. 00080 * 00081 * @param pctxt Pointer to context structure variable. 00082 * @return Completion status of operation: 0 (0) = success, 00083 * negative return value is error. 00084 */ 00085 EXTERNRT int rtxStreamCtxtBufFree (OSCTXT* pctxt); 00086 00087 #ifdef __cplusplus 00088 } 00089 #endif 00090 00091 #endif /* _RTXSTREAMCTXTBUF_H_ */ 00092