| 1 |
(* M2Search.def provides a mechanism to search selected directories. |
| 2 |
|
| 3 |
Copyright (C) 2001-2025 Free Software Foundation, Inc. |
| 4 |
Contributed by Gaius Mulley <[email protected]>. |
| 5 |
|
| 6 |
This file is part of GNU Modula-2. |
| 7 |
|
| 8 |
GNU Modula-2 is free software; you can redistribute it and/or modify |
| 9 |
it under the terms of the GNU General Public License as published by |
| 10 |
the Free Software Foundation; either version 3, or (at your option) |
| 11 |
any later version. |
| 12 |
|
| 13 |
GNU Modula-2 is distributed in the hope that it will be useful, but |
| 14 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 |
General Public License for more details. |
| 17 |
|
| 18 |
You should have received a copy of the GNU General Public License |
| 19 |
along with GNU Modula-2; see the file COPYING3. If not see |
| 20 |
<http://www.gnu.org/licenses/>. *) |
| 21 |
|
| 22 |
DEFINITION MODULE M2Search ; |
| 23 |
|
| 24 |
(* |
| 25 |
Author : Gaius Mulley |
| 26 |
Title : M2Search |
| 27 |
Date : Tue Jan 30 11:59:41 GMT 1990 |
| 28 |
Last update: Tue Aug 7 19:45:46 BST 2001 |
| 29 |
Description: M2Search provides a mechanism to search selected directories |
| 30 |
in an attempt to locate a given source file. |
| 31 |
*) |
| 32 |
|
| 33 |
FROM DynamicStrings IMPORT String ; |
| 34 |
|
| 35 |
|
| 36 |
(* |
| 37 |
FindSourceFile - attempts to locate the source file FileName. |
| 38 |
If a file is found then TRUE is returned otherwise |
| 39 |
FALSE is returned. |
| 40 |
The parameter FullPath is set indicating the |
| 41 |
absolute location of source FileName. |
| 42 |
FullPath will be totally overwritten and should |
| 43 |
not be initialized by InitString before this function |
| 44 |
is called. |
| 45 |
FullPath is set to NIL if this function returns FALSE. |
| 46 |
FindSourceFile sets FullPath to a new string if successful. |
| 47 |
The string FileName is not altered. |
| 48 |
*) |
| 49 |
|
| 50 |
PROCEDURE FindSourceFile (FileName: String; |
| 51 |
VAR FullPath, named: String) : BOOLEAN ; |
| 52 |
|
| 53 |
|
| 54 |
(* |
| 55 |
FindSourceDefFile - attempts to find the definition module for |
| 56 |
a module, Stem. If successful it returns |
| 57 |
the full path and returns TRUE. If unsuccessful |
| 58 |
then FALSE is returned and FullPath is set to NIL. |
| 59 |
*) |
| 60 |
|
| 61 |
PROCEDURE FindSourceDefFile (Stem: String; VAR FullPath, named: String) : BOOLEAN ; |
| 62 |
|
| 63 |
|
| 64 |
(* |
| 65 |
FindSourceModFile - attempts to find the implementation module for |
| 66 |
a module, Stem. If successful it returns |
| 67 |
the full path and returns TRUE. If unsuccessful |
| 68 |
then FALSE is returned and FullPath is set to NIL. |
| 69 |
*) |
| 70 |
|
| 71 |
PROCEDURE FindSourceModFile (Stem: String; VAR FullPath, named: String) : BOOLEAN ; |
| 72 |
|
| 73 |
|
| 74 |
(* |
| 75 |
SetDefExtension - sets the default extension for definition modules to, ext. |
| 76 |
The string, ext, should be deallocated by the caller at |
| 77 |
an appropriate time. |
| 78 |
*) |
| 79 |
|
| 80 |
PROCEDURE SetDefExtension (ext: String) ; |
| 81 |
|
| 82 |
|
| 83 |
(* |
| 84 |
SetModExtension - sets the default extension for implementation and program |
| 85 |
modules to, ext. The string, ext, should be deallocated |
| 86 |
by the caller at an appropriate time. |
| 87 |
*) |
| 88 |
|
| 89 |
PROCEDURE SetModExtension (ext: String) ; |
| 90 |
|
| 91 |
|
| 92 |
END M2Search. |