sli.h

Go to the documentation of this file.
00001 /*
00002 # This file is Copyright 2003, 2006, 2007, 2009 Dean Hall.
00003 #
00004 # This file is part of the PyMite VM.
00005 # The PyMite VM is free software: you can redistribute it and/or modify
00006 # it under the terms of the GNU GENERAL PUBLIC LICENSE Version 2.
00007 #
00008 # The PyMite VM is distributed in the hope that it will be useful,
00009 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00011 # A copy of the GNU GENERAL PUBLIC LICENSE Version 2
00012 # is seen in the file COPYING in this directory.
00013 */
00014 
00015 
00016 #ifndef __SLI_H__
00017 #define __SLI_H__
00018 
00019 
00041 #define HAVE_STRING_H 0
00042 
00043 
00044 /*
00045  * This section creates a macro or a function prototype
00046  * for each library based on the corresponding constant.
00047  * For example, if HAVE_STRING_H is defined to non-zero,
00048  * the system <string.h> file will be included,
00049  * and a macro "sli_strcmp" will be created to wrap the strcmp()
00050  * function.  But if HAVE_STRING is zero, the sli_strcmp()
00051  * prototype will be declared and sli_strcmp() must be
00052  * implemented in sli.c
00053  */
00054 
00055 #if HAVE_STRING_H
00056 
00057 #include <string.h>
00058 
00059 #define sli_memcpy(to, from, n) memcpy((to), (from), (n))
00060 #define sli_strcmp(s1, s2)      strcmp((s1),(s2))
00061 #define sli_strlen(s)           strlen(s)
00062 #define sli_strncmp(s1, s2, n)  strncmp((s1),(s2),(n))
00063 
00064 #else
00065 
00075 void *sli_memcpy(unsigned char *, unsigned char const *, unsigned int);
00076 
00086 int sli_strcmp(char const *, char const *);
00087 
00094 int sli_strlen(char const *s);
00095 
00106 int sli_strncmp(char const *s1, char const *s2, unsigned int n);
00107 
00108 #endif /* HAVE_STRING_H */
00109 
00119 void sli_memset(unsigned char *dest, const char val, unsigned int n);
00120 
00121 #endif /* __SLI_H__ */

Generated on Wed Feb 24 13:37:02 2010 for Python-on-a-chip by  doxygen 1.5.9