sli.c File Reference

Standard Library Interface. More...

#include "pm.h"

Defines

#define __FILE_ID__   0x11
#define USE_DUFFS_DEVICE   0

Functions

void * sli_memcpy (unsigned char *to, unsigned char const *from, unsigned int n)
int sli_strlen (char const *s)
int sli_strcmp (char const *s1, char const *s2)
int sli_strncmp (char const *s1, char const *s2, unsigned int n)
void sli_memset (unsigned char *dest, char const val, unsigned int n)


Detailed Description

Standard Library Interface.

PyMite requires a few functions from a few different standard C libraries (memory, string, etc).


Define Documentation

#define USE_DUFFS_DEVICE   0

use Duff's Device or simple for-loop for memcpy.


Function Documentation

void* sli_memcpy ( unsigned char *  ,
unsigned char const *  ,
unsigned  int 
)

Copy 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

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

int sli_strcmp ( char const *  ,
char const *   
)

Compare strings.

Parameters:
s1 ptr to string 1.
s2 ptr to string 2.
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.

int sli_strlen ( char const *  s  ) 

Obtain string length.

Parameters:
s ptr to string.
Returns:
number of bytes in string.

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.


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