Force a terminating \n on macro file load time
[nedit.git] / util / fileUtils.h
blobdd89bab875bffdcdbcd8644881960de680fd76e3
1 /* $Id: fileUtils.h,v 1.13 2008/08/20 14:57:36 lebert Exp $ */
2 /*******************************************************************************
3 * *
4 * fileUtils.h -- Nirvana Editor File Utilities Header File *
5 * *
6 * Copyright 2003 The NEdit Developers *
7 * *
8 * This is free software; you can redistribute it and/or modify it under the *
9 * terms of the GNU General Public License as published by the Free Software *
10 * Foundation; either version 2 of the License, or (at your option) any later *
11 * version. In addition, you may distribute versions of this program linked to *
12 * Motif or Open Motif. See README for details. *
13 * *
14 * This software is distributed in the hope that it will be useful, but WITHOUT *
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
17 * more details. *
18 * *
19 * You should have received a copy of the GNU General Public License along with *
20 * software; if not, write to the Free Software Foundation, Inc., 59 Temple *
21 * Place, Suite 330, Boston, MA 02111-1307 USA *
22 * *
23 * Nirvana Text Editor *
24 * July 31, 2001 *
25 * *
26 *******************************************************************************/
28 #ifndef NEDIT_FILEUTILS_H_INCLUDED
29 #define NEDIT_FILEUTILS_H_INCLUDED
31 enum fileFormats {UNIX_FILE_FORMAT, DOS_FILE_FORMAT, MAC_FILE_FORMAT};
33 int ParseFilename(const char *fullname, char *filename, char *pathname);
34 int ExpandTilde(char *pathname);
35 const char* GetTrailingPathComponents(const char* path,
36 int noOfComponents);
37 int NormalizePathname(char *pathname);
38 int CompressPathname(char *pathname);
39 int ResolvePath(const char * pathIn, char * pathResolved);
41 int FormatOfFile(const char *fileString);
42 void ConvertFromDosFileString(char *inString, int *length,
43 char* pendingCR);
44 void ConvertFromMacFileString(char *fileString, int length);
45 int ConvertToDosFileString(char **fileString, int *length);
46 void ConvertToMacFileString(char *fileString, int length);
47 char *ReadAnyTextFile(const char *fileName, int forceNL);
49 #endif /* NEDIT_FILEUTILS_H_INCLUDED */