1 /** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
\r
2 * This file is part of clib library
\r
3 * Copyright (C) 2011 Avinash Dongre ( dongre.avinash@gmail.com )
\r
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
\r
6 * of this software and associated documentation files (the "Software"), to deal
\r
7 * in the Software without restriction, including without limitation the rights
\r
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\r
9 * copies of the Software, and to permit persons to whom the Software is
\r
10 * furnished to do so, subject to the following conditions:
\r
12 * The above copyright notice and this permission notice shall be included in
\r
13 * all copies or substantial portions of the Software.
\r
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
\r
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
\r
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
\r
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
\r
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
\r
22 ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/
\r
27 #include "c_errors.h"
\r
30 /* ------------------------------------------------------------------------*/
\r
31 /* C O M M O N D E F I N I T O N S */
\r
32 /* ------------------------------------------------------------------------*/
\r
34 typedef void (*clib_destroy)(void*);
\r
35 typedef int (*clib_compare)(void*,void*);
\r
36 typedef void (*clib_traversal)( void*);
\r
38 typedef int clib_error;
\r
39 typedef int clib_bool;
\r
41 #define clib_black 0
\r
44 #define clib_false 0
\r
46 /* ------------------------------------------------------------------------*/
\r
48 /* ------------------------------------------------------------------------*/
\r
50 struct clib_object {
\r
55 #include "c_array.h"
\r
56 #include "c_deque.h"
\r
60 #include "c_slist.h"
\r
62 #include "c_stack.h"
\r
65 /* ------------------------------------------------------------------------*/
\r
66 /* H E L P E R F U N C T I O N S */
\r
67 /* ------------------------------------------------------------------------*/
\r
69 extern void clib_copy ( void *destination, void *source, size_t size );
\r
70 extern void clib_get ( void *destination, void *source, size_t size);
\r
71 extern char* clib_strdup ( char *ptr );
\r
73 extern struct clib_object* new_clib_object (void *inObject, size_t obj_size);
\r
74 extern clib_error get_raw_clib_object (struct clib_object *inObject, void**elem);
\r
75 extern void delete_clib_object (struct clib_object* inObject );
\r
76 extern void replace_raw_clib_object(struct clib_object* current_object,void *elem, size_t elem_size);
\r