view th_file.h @ 432:1b3472ba7b23

Bump copyrights.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 01 Jan 2017 01:59:49 +0200
parents 75dbac8f2f59
children 9148bc3fa838
line wrap: on
line source

/*
 * File, directory etc helper functions
 * Programmed and designed by Matti 'ccr' Hamalainen
 * (C) Copyright 2016-2017 Tecnic Software productions (TNSP)
 *
 * Please read file 'COPYING' for information on license and distribution.
 */
#ifndef TH_FILE_H
#define TH_FILE_H

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "th_util.h"


// Platform specific defines
#if defined(TH_PLAT_WINDOWS)
#    define TH_DIR_SEPARATOR '\\'
#else
#    define TH_DIR_SEPARATOR '/'
#endif


// Flags for th_stat_path()
enum
{
    TH_IS_DIR      = 0x1000,
    TH_IS_SYMLINK  = 0x2000,

    TH_IS_WRITABLE = 0x0002,
    TH_IS_READABLE = 0x0004,
};


char *  th_get_home_dir();
char *  th_get_config_dir(const char *name);

BOOL    th_stat_path(const char *path, int *flags);
BOOL    th_mkdir_path(const char *cpath, int mode);


#ifdef __cplusplus
}
#endif
#endif // TH_FILE_H