FreeTDS API

Loading...
Searching...
No Matches
path.h
1/* FreeTDS - Library of routines accessing Sybase and Microsoft databases
2 * Copyright (C) 2023 Frediano Ziglio
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
18 */
19
20#ifndef _tdsguard_eI8iNo9FExd6aRlc3im79S_
21#define _tdsguard_eI8iNo9FExd6aRlc3im79S_
22
23#ifdef _WIN32
24#include <wchar.h>
25#endif
26
27#include <freetds/pushvis.h>
28
29#ifdef _WIN32
30#define TDS_SDIR_SEPARATOR L"\\"
31 typedef wchar_t tds_dir_char;
32#define tds_dir_open _wfopen
33#define tds_dir_getenv _wgetenv
34#define tds_dir_dup _wcsdup
35#define tds_dir_len wcslen
36#define tds_dir_cmp wcscmp
37#define tds_dir_snprintf _snwprintf
38#define TDS_DIR(s) L ## s
39#define tdsPRIdir "ls"
40tds_dir_char *tds_dir_from_cstr(const char *path);
41#else
42#define TDS_SDIR_SEPARATOR "/"
43 typedef char tds_dir_char;
44#define tds_dir_open fopen
45#define tds_dir_getenv getenv
46#define tds_dir_dup strdup
47#define tds_dir_len strlen
48#define tds_dir_cmp strcmp
49#define tds_dir_snprintf snprintf
50#define TDS_DIR(s) s
51#define tdsPRIdir "s"
52#define tds_dir_from_cstr(s) strdup(s)
53#endif
54
55tds_dir_char *tds_get_homedir(void);
56tds_dir_char* tds_join_path(const tds_dir_char *dir, const tds_dir_char *file);
57tds_dir_char *tds_get_home_file(const tds_dir_char *file);
58
59#include <freetds/popvis.h>
60
61#endif /* _tdsguard_eI8iNo9FExd6aRlc3im79S_ */