view include/std.h @ 21:7c2adb65ceac

Started working on dynamic memory I have a slightly adapted version of dynamic memory allocation from the H&R book in the program now, I will soon be adding the free function. I fixed sPrint so it will work with large buffers.
author Jonathan Pevarnek <pevarnj@gmail.com>
date Tue, 15 Mar 2011 22:55:36 -0400
parents 90cd3d9a6ca3
children 3fb0ec050ff3
line wrap: on
line source

#ifndef __STD_H
#define __STD_H

typedef unsigned int size_t;

char* ftoa(double x, char *a, unsigned int prec);
char* itoa(int n, char *a);
int atoi(char *a);
double atof(char *a);

void sPrint(char *a);
char* sGet(char *a, unsigned int n);

int strcmp(const char *a, const char *b);

int arrayLookup(char *text, const char array[][10], int last);

char* append(char *dest, char *src);

//MALLOC CODE

union block {
	struct {
		union block *next;
		unsigned int size;
	} s;
	double foo;
};
typedef union block Block;

void* malloc(size_t size);
//void free(void *ptr);

#endif