PIPS
file_names.c
Go to the documentation of this file.
1 /*
2 
3  $Id$
4 
5  Copyright 1989-2016 MINES ParisTech
6 
7  This file is part of PIPS.
8 
9  PIPS is free software: you can redistribute it and/or modify it
10  under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  any later version.
13 
14  PIPS is distributed in the hope that it will be useful, but WITHOUT ANY
15  WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  FITNESS FOR A PARTICULAR PURPOSE.
17 
18  See the GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with PIPS. If not, see <http://www.gnu.org/licenses/>.
22 
23 */
24 #ifdef HAVE_CONFIG_H
25  #include "pips_config.h"
26 #endif
27 
28 #include "genC.h"
29 #include "misc.h"
30 #include "constants.h"
31 #include "naming.h"
32 
33 /* Naming of files in the PIPS database.
34  *
35  */
36 
37 string string_codefilename(const char *s)
38 {
40  s, SEQUENTIAL_CODE_EXT, NULL));
41 }
42 
43 string string_par_codefilename(const char *s)
44 {
46  s, PARALLEL_CODE_EXT, NULL));
47 }
48 
49 string string_fortranfilename(const char* s)
50 {
52  s, SEQUENTIAL_FORTRAN_EXT, NULL));
53 }
54 
55 bool string_fortran_filename_p(const char* s)
56 {
57  int fnl = strlen(s);
58  int sl = sizeof(SEQUENTIAL_FORTRAN_EXT)-1;
59  bool is_fortran = false;
60 
61  if(fnl<=sl)
62  is_fortran = false;
63  else
64  is_fortran = strcmp(SEQUENTIAL_FORTRAN_EXT, s+(fnl-sl))==0;
65 
66  return is_fortran;
67 }
68 
69 string string_par_fortranfilename(const char* s)
70 {
72  s, PARALLEL_FORTRAN_EXT, NULL));
73 }
74 
75 string string_pp_fortranfilename(const char* s)
76 {
78  s, PRETTYPRINT_FORTRAN_EXT, NULL));
79 }
80 
81 string string_predicat_fortranfilename(const char* s)
82 {
84  s, PREDICAT_FORTRAN_EXT, NULL));
85 }
86 
87 string string_entitiesfilename(const char* s)
88 {
90  s, ENTITIES_EXT, NULL));
91 }
92 
93 /* Keep track of the script directory. It is used to retrieve
94  information about old properties, mostly in a non-regression
95  setting.
96 
97  In case of "source", the auxiliary directory is ignored.
98 
99  FI: I do not reset nor free this variable since it is set from
100  beginning to end.
101 
102  */
104 
106 {
108 }
109 
111 {
112  return script_directory_name;
113 }
114 
115 /*
116  * that is all
117  */
string string_entitiesfilename(const char *s)
Definition: file_names.c:87
string get_script_directory_name(void)
Definition: file_names.c:110
string string_predicat_fortranfilename(const char *s)
Definition: file_names.c:81
bool string_fortran_filename_p(const char *s)
Definition: file_names.c:55
string string_fortranfilename(const char *s)
Definition: file_names.c:49
string string_pp_fortranfilename(const char *s)
Definition: file_names.c:75
void set_script_directory_name(string dn)
Definition: file_names.c:105
static string script_directory_name
Keep track of the script directory.
Definition: file_names.c:103
string string_par_codefilename(const char *s)
Definition: file_names.c:43
string string_par_fortranfilename(const char *s)
Definition: file_names.c:69
string string_codefilename(const char *s)
Naming of files in the PIPS database.
Definition: file_names.c:37
#define TOP_LEVEL_MODULE_NAME
Module containing the global variables in Fortran and C.
Definition: naming-local.h:101
#define MODULE_SEP_STRING
Definition: naming-local.h:30
string concatenate(const char *,...)
Return the concatenation of the given strings.
Definition: string.c:183
#define string_undefined
Definition: newgen_types.h:40
char * strdup()