| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

fixed_extension

#include "sflfile.h"
char *
fixed_extension (
    char *dest,
    const char *src,
    const char *ext)

Synopsis

Copies src to dest and enforces ext extension. Returns dest. Dest must be large enough for a fully-formatted filename; define it as char [FILE_NAME_MAX + 1]. The ext argument can start with or without a dot. If ext is null or empty, does nothing.

Source Code - (sflfile.c)

{
    ASSERT (dest);
    ASSERT (src);

    if (dest != src)                    /*  Copy src to dest if not same     */
        strcpy (dest, src);

    strip extension (dest);
    return (default extension (dest, dest, ext));
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation