Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenslang_utility.hGo to the documentation of this file.00001 /* 00002 * Mesa 3-D graphics library 00003 * Version: 6.5.3 00004 * 00005 * Copyright (C) 2005-2007 Brian Paul All Rights Reserved. 00006 * 00007 * Permission is hereby granted, free of charge, to any person obtaining a 00008 * copy of this software and associated documentation files (the "Software"), 00009 * to deal in the Software without restriction, including without limitation 00010 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 00011 * and/or sell copies of the Software, and to permit persons to whom the 00012 * Software is furnished to do so, subject to the following conditions: 00013 * 00014 * The above copyright notice and this permission notice shall be included 00015 * in all copies or substantial portions of the Software. 00016 * 00017 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00018 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00019 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 00020 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 00021 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00022 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00023 */ 00024 00025 #ifndef SLANG_UTILITY_H 00026 #define SLANG_UTILITY_H 00027 00028 00029 /* Compile-time assertions. If the expression is zero, try to declare an 00030 * array of size [-1] to cause compilation error. 00031 */ 00032 #define static_assert(expr) do { int _array[(expr) ? 1 : -1]; (void) _array[0]; } while (0) 00033 00034 00035 #define slang_string_compare(str1, str2) _mesa_strcmp (str1, str2) 00036 #define slang_string_copy(dst, src) _mesa_strcpy (dst, src) 00037 #define slang_string_length(str) _mesa_strlen (str) 00038 00039 char *slang_string_concat (char *, const char *); 00040 00041 /* slang_string */ 00042 00043 typedef struct 00044 { 00045 char *data; 00046 GLuint length; 00047 GLuint capacity; 00048 GLboolean fail; 00049 } slang_string; 00050 00051 GLvoid 00052 slang_string_init (slang_string *); 00053 00054 GLvoid 00055 slang_string_free (slang_string *); 00056 00057 GLvoid 00058 slang_string_reset (slang_string *); 00059 00060 GLvoid 00061 slang_string_push (slang_string *, const slang_string *); 00062 00063 GLvoid 00064 slang_string_pushc (slang_string *, const char); 00065 00066 GLvoid 00067 slang_string_pushs (slang_string *, const char *, GLuint); 00068 00069 GLvoid 00070 slang_string_pushi (slang_string *, GLint); 00071 00072 const char * 00073 slang_string_cstr (slang_string *); 00074 00075 /* slang_atom */ 00076 00077 typedef GLvoid *slang_atom; 00078 00079 #define SLANG_ATOM_NULL ((slang_atom) 0) 00080 00081 typedef struct slang_atom_entry_ 00082 { 00083 char *id; 00084 struct slang_atom_entry_ *next; 00085 } slang_atom_entry; 00086 00087 #define SLANG_ATOM_POOL_SIZE 1023 00088 00089 typedef struct slang_atom_pool_ 00090 { 00091 slang_atom_entry *entries[SLANG_ATOM_POOL_SIZE]; 00092 } slang_atom_pool; 00093 00094 GLvoid slang_atom_pool_construct (slang_atom_pool *); 00095 GLvoid slang_atom_pool_destruct (slang_atom_pool *); 00096 slang_atom slang_atom_pool_atom (slang_atom_pool *, const char *); 00097 const char *slang_atom_pool_id (slang_atom_pool *, slang_atom); 00098 00099 00100 #endif Generated on Tue May 15 04:42:35 2012 for ReactOS by
1.6.3
|