view include/std.h @ 24:45a80ea314ae

The stack now theroretically is a properly working stack! I added the free function I converted the code for the stack so that it uses a linked list to store the stack values. TODO: create a way to destroy stacks.
author Jonathan Pevarnek <pevarnj@gmail.com>
date Wed, 16 Mar 2011 12:00:43 -0400
parents 3fb0ec050ff3
children c1ad124f2aaf
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

struct header{
	struct header *next;
	size_t size;
};
typedef struct header Header;

typedef Header blockUnit;

void malloc_init(size_t memSize);
void* malloc(size_t size);
void free(void *ptr);

#endif