diff --git a/VERSION b/VERSION index 8d61b56..dc1e644 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.0c +1.6.0 diff --git a/basename.c b/basename.c new file mode 100644 index 0000000..e0d2175 --- /dev/null +++ b/basename.c @@ -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 +#include +#include + +#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); +}