1 /* do not edit automatically generated by mc from mcSearch. */
2 /* mcSearch.def mcSearch provides a mechanism to search selected directories.
4 Copyright (C) 2015-2025 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 (_mcSearch_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 (_mcSearch_C)
44 # define EXTERN extern
49 initSearchPath - initialise the compiler search, path.
50 The string path may take the form:
52 Path ::= IndividualPath { ":" IndividualPath }
53 IndividualPath ::= "." | DirectoryPath
54 DirectoryPath ::= [ "/" ] Name { "/" Name }
55 Name ::= Letter { (Letter | Number) }
56 Letter ::= A..Z | a..z
60 EXTERN
void mcSearch_initSearchPath (DynamicStrings_String path
);
63 prependSearchPath - prepends a new path to the initial search path.
66 EXTERN
void mcSearch_prependSearchPath (DynamicStrings_String path
);
69 findSourceFile - attempts to locate the source file FileName.
70 If a file is found then TRUE is returned otherwise
72 The parameter FullPath is set indicating the
73 absolute location of source FileName.
74 FullPath will be totally overwritten and should
75 not be initialized by InitString before this function
77 FindSourceFile sets FullPath to a new string if successful.
80 EXTERN
bool mcSearch_findSourceFile (DynamicStrings_String FileName
, DynamicStrings_String
*fullPath
);
83 findSourceDefFile - attempts to find the definition module for
84 a module, Stem. If successful it returns
85 the full path and returns TRUE. If unsuccessful
86 then FALSE is returned and FullPath is set to NIL.
89 EXTERN
bool mcSearch_findSourceDefFile (DynamicStrings_String stem
, DynamicStrings_String
*fullPath
);
92 findSourceModFile - attempts to find the implementation module for
93 a module, Stem. If successful it returns
94 the full path and returns TRUE. If unsuccessful
95 then FALSE is returned and FullPath is set to NIL.
98 EXTERN
bool mcSearch_findSourceModFile (DynamicStrings_String stem
, DynamicStrings_String
*fullPath
);
101 setDefExtension - sets the default extension for definition modules to, ext.
102 The string, ext, should be deallocated by the caller at
106 EXTERN
void mcSearch_setDefExtension (DynamicStrings_String ext
);
109 setModExtension - sets the default extension for implementation and program
110 modules to, ext. The string, ext, should be deallocated
111 by the caller at an appropriate time.
114 EXTERN
void mcSearch_setModExtension (DynamicStrings_String ext
);