Removes C++ style comments.
This commit is contained in:
@@ -1,72 +1,72 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2000-2003 Intel Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// * Neither name of Intel Corporation nor the names of its contributors
|
||||
// may be used to endorse or promote products derived from this software
|
||||
// without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Copyright (c) 2000-2003 Intel Corporation
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* - Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* - Neither name of Intel Corporation nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef GENLIB_UTIL_MEMBUFFER_H
|
||||
#define GENLIB_UTIL_MEMBUFFER_H
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "upnputil.h"
|
||||
|
||||
#define MINVAL( a, b ) ( (a) < (b) ? (a) : (b) )
|
||||
#define MAXVAL( a, b ) ( (a) > (b) ? (a) : (b) )
|
||||
|
||||
// pointer to a chunk of memory
|
||||
typedef struct // memptr
|
||||
/*! pointer to a chunk of memory. */
|
||||
typedef struct
|
||||
{
|
||||
char *buf; // start of memory (read/write)
|
||||
size_t length; // length of memory (read-only)
|
||||
/*! start of memory (read/write). */
|
||||
char *buf;
|
||||
/*! length of memory (read-only). */
|
||||
size_t length;
|
||||
} memptr;
|
||||
|
||||
|
||||
// maintains a block of dynamically allocated memory
|
||||
// note: Total length/capacity should not exceed MAX_INT
|
||||
typedef struct // membuffer
|
||||
/*! Maintains a block of dynamically allocated memory
|
||||
* note: Total length/capacity should not exceed MAX_INT */
|
||||
typedef struct
|
||||
{
|
||||
char *buf; // mem buffer; must not write beyond buf[length-1] (read/write)
|
||||
size_t length; // length of buffer (read-only)
|
||||
size_t capacity; // total allocated memory (read-only)
|
||||
size_t size_inc; // used to increase size; MUST be > 0; (read/write)
|
||||
|
||||
// default value of size_inc
|
||||
#define MEMBUF_DEF_SIZE_INC 5
|
||||
/*! mem buffer; must not write beyond buf[length-1] (read/write). */
|
||||
char *buf;
|
||||
/*! length of buffer (read-only). */
|
||||
size_t length;
|
||||
/*! total allocated memory (read-only). */
|
||||
size_t capacity;
|
||||
/*! used to increase size; MUST be > 0; (read/write). */
|
||||
size_t size_inc;
|
||||
/*! default value of size_inc. */
|
||||
#define MEMBUF_DEF_SIZE_INC 5
|
||||
} membuffer;
|
||||
|
||||
//--------------------------------------------------
|
||||
//////////////// functions /////////////////////////
|
||||
//--------------------------------------------------
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/************************************************************************
|
||||
* Function : str_alloc
|
||||
@@ -84,7 +84,7 @@ extern "C" {
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
char* str_alloc( IN const char* str, IN size_t str_len );
|
||||
char *str_alloc( IN const char* str, IN size_t str_len );
|
||||
|
||||
/************************************************************************
|
||||
* Function : memptr_cmp
|
||||
@@ -332,7 +332,8 @@ char* membuffer_detach( INOUT membuffer* m );
|
||||
************************************************************************/
|
||||
void membuffer_attach( INOUT membuffer* m, IN char* new_buf, IN size_t buf_len );
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif // __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* GENLIB_UTIL_H */
|
||||
|
||||
#endif // GENLIB_UTIL_H
|
||||
|
||||
Reference in New Issue
Block a user