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_crt.c
Go to the documentation of this file.
00001 #include "grammar_crt.h"
00002 
00003 #define GRAMMAR_PORT_BUILD 1
00004 #include "grammar.c"
00005 #undef GRAMMAR_PORT_BUILD
00006 
00007 
00008 void grammar_alloc_free (void *ptr)
00009 {
00010     free (ptr);
00011 }
00012 
00013 void *grammar_alloc_malloc (size_t size)
00014 {
00015     return malloc (size);
00016 }
00017 
00018 void *grammar_alloc_realloc (void *ptr, size_t old_size, size_t size)
00019 {
00020     return realloc (ptr, size);
00021 }
00022 
00023 void *grammar_memory_copy (void *dst, const void * src, size_t size)
00024 {
00025     return memcpy (dst, src, size);
00026 }
00027 
00028 int grammar_string_compare (const byte *str1, const byte *str2)
00029 {
00030     return strcmp ((const char *) str1, (const char *) str2);
00031 }
00032 
00033 int grammar_string_compare_n (const byte *str1, const byte *str2, size_t n)
00034 {
00035     return strncmp ((const char *) str1, (const char *) str2, n);
00036 }
00037 
00038 byte *grammar_string_copy (byte *dst, const byte *src)
00039 {
00040     return (byte *) strcpy ((char *) dst, (const char *) src);
00041 }
00042 
00043 byte *grammar_string_copy_n (byte *dst, const byte *src, size_t n)
00044 {
00045     return (byte *) strncpy ((char *) dst, (const char *) src, n);
00046 }
00047 
00048 unsigned int grammar_string_length (const byte *str)
00049 {
00050     return strlen ((const char *) str);
00051 }
00052 
00053 byte *grammar_string_duplicate (const byte *src)
00054 {
00055     const unsigned int size = grammar_string_length (src);
00056     byte *str = grammar_alloc_malloc (size + 1);
00057     if (str != NULL)
00058     {
00059         grammar_memory_copy (str, src, size);
00060         str[size] = '\0';
00061     }
00062     return str;
00063 }
00064 

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.