ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

grammar.h
Go to the documentation of this file.
00001 /*
00002  * Mesa 3-D graphics library
00003  * Version:  6.2
00004  *
00005  * Copyright (C) 1999-2004  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 GRAMMAR_H
00026 #define GRAMMAR_H
00027 
00028 
00029 #ifndef GRAMMAR_PORT_INCLUDE
00030 #error Do not include this file directly, include your grammar_XXX.h instead
00031 #endif
00032 
00033 
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037 
00038 void grammar_alloc_free (void *);
00039 void *grammar_alloc_malloc (size_t);
00040 void *grammar_alloc_realloc (void *, size_t, size_t);
00041 void *grammar_memory_copy (void *, const void *, size_t);
00042 int grammar_string_compare (const byte *, const byte *);
00043 int grammar_string_compare_n (const byte *, const byte *, size_t);
00044 byte *grammar_string_copy (byte *, const byte *);
00045 byte *grammar_string_copy_n (byte *, const byte *, size_t);
00046 byte *grammar_string_duplicate (const byte *);
00047 unsigned int grammar_string_length (const byte *);
00048 
00049 /*
00050     loads grammar script from null-terminated ASCII <text>
00051     returns unique grammar id to grammar object
00052     returns 0 if an error occurs (call grammar_get_last_error to retrieve the error text)
00053 */
00054 grammar grammar_load_from_text (const byte *text);
00055 
00056 /*
00057     sets a new <value> to a register <name> for grammar <id>
00058     returns 0 on error (call grammar_get_last_error to retrieve the error text)
00059     returns 1 on success
00060 */
00061 int grammar_set_reg8 (grammar id, const byte *name, byte value);
00062 
00063 /*
00064     this function is obsolete, use only for debugging purposes
00065 
00066     checks if a null-terminated <text> matches given grammar <id>
00067     returns 0 on error (call grammar_get_last_error to retrieve the error text)
00068     returns 1 on success, the <prod> points to newly allocated buffer with production and <size>
00069     is filled with the production size
00070     call grammar_alloc_free to free the memory block pointed by <prod>
00071 */
00072 int grammar_check (grammar id, const byte *text, byte **prod, unsigned int *size);
00073 
00074 /*
00075     does the same what grammar_check does but much more (approx. 4 times) faster
00076     use this function instead of grammar_check
00077     <estimate_prod_size> is a hint - the initial production buffer size will be of this size,
00078     but if more room is needed it will be safely resized; set it to 0x1000 or so
00079 */
00080 int grammar_fast_check (grammar id, const byte *text, byte **prod, unsigned int *size,
00081     unsigned int estimate_prod_size);
00082 
00083 /*
00084     destroys grammar object identified by <id>
00085     returns 0 on error (call grammar_get_last_error to retrieve the error text)
00086     returns 1 on success
00087 */
00088 int grammar_destroy (grammar id);
00089 
00090 /*
00091     retrieves last grammar error reported either by grammar_load_from_text, grammar_check
00092     or grammar_destroy
00093     the user allocated <text> buffer receives error description, <pos> points to error position,
00094     <size> is the size of the text buffer to fill in - it must be at least 4 bytes long,
00095 */
00096 void grammar_get_last_error (byte *text, unsigned int size, int *pos);
00097 
00098 #ifdef __cplusplus
00099 }
00100 #endif
00101 
00102 #endif
00103 

Generated on Fri May 25 2012 04:18:45 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.