1 /* do not edit automatically generated by mc from mcFileName. */
2 /* mcFileName.def Provides a procedure to calculate a system file name.
4 Copyright (C) 2015-2024 Free Software Foundation, Inc.
5 Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
7 This file is part of GNU Modula-2.
9 GNU Modula-2 is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
14 GNU Modula-2 is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with GNU Modula-2; see the file COPYING3. If not see
21 <http://www.gnu.org/licenses/>. */
24 #if !defined (_mcFileName_H)
25 # define _mcFileName_H
33 # if !defined (PROC_D)
35 typedef void (*PROC_t
) (void);
36 typedef struct { PROC_t proc
; } PROC
;
39 # include "GDynamicStrings.h"
41 # if defined (_mcFileName_C)
44 # define EXTERN extern
49 calculateFileName - calculates and returns a new string filename
50 given a module and an extension. This file name
51 length will be operating system specific.
52 String, Extension, is concatenated onto
53 Module and thus it is safe to `Mark' the extension
54 for garbage collection.
57 EXTERN DynamicStrings_String
mcFileName_calculateFileName (DynamicStrings_String module
, DynamicStrings_String extension
);
60 calculateStemName - calculates the stem name for given a module.
61 This name length will be operating system and
65 EXTERN DynamicStrings_String
mcFileName_calculateStemName (DynamicStrings_String module
);
68 extractExtension - given a, filename, return the filename without
72 EXTERN DynamicStrings_String
mcFileName_extractExtension (DynamicStrings_String filename
, DynamicStrings_String ext
);
75 extractModule - given a, filename, return the module name including any
76 extension. A new string is returned.
79 EXTERN DynamicStrings_String
mcFileName_extractModule (DynamicStrings_String filename
);