ansilove

ANSI and ASCII art to PNG converter in C
Log | Files | Refs | README | LICENSE

commit f4b2cb579c878bfdfc2b139287078acfbc481ae1
parent 75ab4ad9fe7888eff149e76d1046c4474ac81140
Author: ByteProject <stefan.vogt@byteproject.net>
Date:   Fri, 23 Dec 2011 23:14:37 +0100

proper implementation of the function known from PHP

Diffstat:
Mansilove/strtolower.c | 8++++++--
Mansilove/substr.c | 8++++++--
2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/ansilove/strtolower.c b/ansilove/strtolower.c @@ -10,11 +10,15 @@ // #if defined(__APPLE__) && defined(__MACH__) -#import "strtolower.h" +#import <Foundation/Foundation.h> #else -#include "strtolower.h" +#include <stdio.h> +#include <stdlib.h> +#include <ctype.h> #endif +// In-place modification of a string to be all lower case. + void strtolower(char str[]) { char *p; diff --git a/ansilove/substr.c b/ansilove/substr.c @@ -10,11 +10,15 @@ // #if defined(__APPLE__) && defined(__MACH__) -#import "substr.h" +#import <Foundation/Foundation.h> #else -#include "substr.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> #endif +// Returns the portion of a string specified by start and length parameters. + char *substr(const char *str, size_t begin, size_t len) { if (str == 0 || strlen(str) == 0 || strlen(str) < begin || strlen(str) < (begin+len))