Modestus Moon OS  R4
CS 450 project
string.h
Go to the documentation of this file.
1 #ifndef _STRING_H
2 #define _STRING_H
3 
4 #include <system.h>
5 #include <arg_list.h>
6 #include <core/serial.h>
7 
13 int isspace(const char *c);
14 
22 void* memset(void *s, int c, size_t n);
23 
30 char* strcpy(char *s1, const char *s2);
31 
38 char* strcat(char *s1, const char *s2);
39 
45 int strlen(const char *s);
46 
53 int strcmp(const char *s1, const char *s2);
54 
61 char* strtok(char *s1, const char *s2);
62 
68 int atoi(const char *s);
69 
77 int intToS(const int * const i, char *buf, int bufLength);
78 
84 char is_conversion_specifier(char c);
85 
91 int isnum(const char c);
92 
93 
94 
103 int sprintf(char *str, int bufLength, const char *format, ...) __attribute__((format(printf,3,4),cdecl));
104 
105 //int printf(const char *format, ...) __attribute__((format(printf,0,1)));
106 
112 #define printf(format, ...) \
113 { \
114  char buf[500]; \
115  sprintf(buf, 500, format, __VA_ARGS__); \
116  serial_print(buf); \
117 } \
118 
119 #endif
char is_conversion_specifier(char c)
is_conversion_specifier checks to see if the character is one of the standard printf formats ...
Definition: string.c:363
typedef __attribute__
#define printf(format,...)
printf is simply a wrapper macro around sprintf with built in terminal print builtin needs to be a ma...
Definition: string.h:112
char * strcpy(char *s1, const char *s2)
strcpy copies one string to another string
Definition: string.c:26
int cdecl
Definition: string.h:103
char * strcat(char *s1, const char *s2)
strcat concatenates the contents of one string onto another.
Definition: string.c:101
int isspace(const char *c)
isspace Determines if a character is a whitespace.
Definition: string.c:114
char * strtok(char *s1, const char *s2)
strtok Split string into tokens.
Definition: string.c:154
int strlen(const char *s)
strlen returns the length of a string
Definition: string.c:10
int atoi(const char *s)
atoi converts and ASCII string to an integer
Definition: string.c:46
int isnum(const char c)
isnum inline helper function to check if a character is represents an ascii number ...
Definition: string.c:385
int sprintf(char *str, int bufLength, const char *format,...) __attribute__((format(printf
sprintf print with format to specified string buffer
int strcmp(const char *s1, const char *s2)
strcmp compares two strings.
Definition: string.c:77
int intToS(const int *const i, char *buf, int bufLength)
intToS converts a signed integer to string
Definition: string.c:317
void * memset(void *s, int c, size_t n)
memset Set a region of memory.
Definition: string.c:139