|
Revision 2, 0.8 KB
(checked in by cmucam, 5 years ago)
|
|
Lets start doing some CMUcam code!
|
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | #ifndef __LIBC__ |
|---|
| 2 | #define __LIBC__ |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | #define MIN(a,b) ( ((a)<(b)) ? (a) : (b)) |
|---|
| 7 | #define MAX(a,b) ( ((a)>(b)) ? (a) : (b)) |
|---|
| 8 | #define ABS(a) ( (a<0) ? -(a):(a)) |
|---|
| 9 | #define SWAP(a,b) tmp = a; a = b; b = tmp; |
|---|
| 10 | |
|---|
| 11 | #define NULL ((void*)0) |
|---|
| 12 | |
|---|
| 13 | // returns the value of sine(x) |
|---|
| 14 | // for x: 0..2pi -> 0..1023 |
|---|
| 15 | // return value is between -1024 and 1024 |
|---|
| 16 | |
|---|
| 17 | //int sin(int x); |
|---|
| 18 | |
|---|
| 19 | //#define cos(x) (sin((x)+255)) |
|---|
| 20 | |
|---|
| 21 | unsigned int rand (); |
|---|
| 22 | extern unsigned int random; |
|---|
| 23 | |
|---|
| 24 | char *itoa (char *str, int num); |
|---|
| 25 | char *itoa_hex (char *str, unsigned int num, int lcase); |
|---|
| 26 | char *sprintf_args (char *str, const char *format, void *args); |
|---|
| 27 | char *sprintf (char *str, const char *format, ...); |
|---|
| 28 | void printf (const char *format, ...); |
|---|
| 29 | |
|---|
| 30 | int strlen (const char *str); |
|---|
| 31 | char *strcpy (char *dest, const char *str); |
|---|
| 32 | int strcmp (const char *str0, const char *str1); |
|---|
| 33 | int atoi (const char *str); |
|---|
| 34 | |
|---|
| 35 | #endif |
|---|