sli.h File Reference
Standard Library Interface.
More...
Go to the source code of this file.
|
Defines |
#define | HAVE_STRING_H 0 |
Functions |
void * | sli_memcpy (unsigned char *to, unsigned char const *from, unsigned int n) |
int | sli_strcmp (char const *s1, char const *s2) |
int | sli_strlen (char const *s) |
int | sli_strncmp (char const *s1, char const *s2, unsigned int n) |
void | sli_memset (unsigned char *dest, const char val, unsigned int n) |
Detailed Description
Standard Library Interface.
PyMite requires a few functions from a few different standard C libraries (memory, string, etc). If your microcontroller has these libraries, set the constant to 1 for each library available. This will cause a macro to be defined which wraps the function for use by PyMite. Otherwise, leave the constant as 0, and PyMite will use the function defined in sli.c Some of the functions in sli.c will need to be ported to the target system.
Definition in file sli.h.
Define Documentation
If the compiler has string.h, set HAVE_STRING to 1; otherwise, leave it 0 and the sli functions will be used.
Definition at line 41 of file sli.h.
Function Documentation
void* sli_memcpy |
( |
unsigned char * |
to, |
|
|
unsigned char const * |
from, |
|
|
unsigned int |
n | |
|
) |
| | |
Copies a block of memory in RAM.
- Parameters:
-
| to | The destination address. |
| from | The source address. |
| n | The number of bytes to copy. |
- Returns:
- The initial pointer value of the destination
- See also:
- mem_copy
Definition at line 39 of file sli.c.
void sli_memset |
( |
unsigned char * |
dest, |
|
|
const char |
val, |
|
|
unsigned int |
n | |
|
) |
| | |
Copy a value repeatedly into a block of memory
- Parameters:
-
| dest | the destination address. |
| val | the value. |
| n | the number of bytes to copy. |
- Returns:
- Nothing
- See also:
- memset
Definition at line 142 of file sli.c.
int sli_strcmp |
( |
char const * |
s1, |
|
|
char const * |
s2 | |
|
) |
| | |
Compares two strings.
- Parameters:
-
- Returns:
- value that is less then, equal to or greater than 0 depending on whether s1's encoding is less than, equal to, or greater than s2's.
Definition at line 98 of file sli.c.
int sli_strlen |
( |
char const * |
s |
) |
|
Obtain string length.
- Parameters:
-
- Returns:
- number of bytes in string.
Definition at line 84 of file sli.c.
int sli_strncmp |
( |
char const * |
s1, |
|
|
char const * |
s2, |
|
|
unsigned int |
n | |
|
) |
| | |
Compare strings for a specific length.
- Parameters:
-
| s1 | ptr to string 1. |
| s2 | ptr to string 2. |
| n | number of chars to compare |
- Returns:
- value that is less then, equal to or greater than 0 depending on whether s1's encoding is less than, equal to, or greater than s2's.
Definition at line 113 of file sli.c.