Don't forget to

1. Add basename.c to source control, and
 2. bump up the version#
This commit is contained in:
David Parsons
2010-01-29 18:10:54 -08:00
parent 0011b23c23
commit b23c1f801b
2 changed files with 43 additions and 1 deletions
+1 -1
View File
@@ -1 +1 @@
1.6.0c
1.6.0
+42
View File
@@ -0,0 +1,42 @@
/*
* mkdio -- markdown front end input functions
*
* Copyright (C) 2007 David L Parsons.
* The redistribution terms are provided in the COPYRIGHT file that must
* be distributed with this source code.
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include "cstring.h"
#include "markdown.h"
#include "amalloc.h"
static char *
e_basename(char *string, int size, char *base)
{
char *ret;
if ( base && string && (*string != '/') && (ret=malloc(strlen(base)+size+2)) ) {
strcpy(ret, base);
strncat(ret, string, size);
return ret;
}
return 0;
}
static void
e_free(char *string, char *base)
{
if ( string ) free(string);
}
void
mkd_basename(Document *document, char *base)
{
mkd_e_url(document, e_basename);
mkd_e_context(document, base);
mkd_e_free(document, e_free);
}