Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
cf02bc96
Commit
cf02bc96
authored
27 years ago
by
Fredrik Hübinette (Hubbe)
Browse files
Options
Downloads
Patches
Plain Diff
bugfix (tm)
Rev: lib/master.pike:1.47
parent
4d289b5b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/master.pike
+30
-20
30 additions, 20 deletions
lib/master.pike
with
30 additions
and
20 deletions
lib/master.pike
+
30
−
20
View file @
cf02bc96
/* $Id: master.pike,v 1.4
6
1997/07/19 2
0:59:02
hubbe Exp $
/* $Id: master.pike,v 1.4
7
1997/07/19 2
1:33:47
hubbe Exp $
*
* Master-file for Pike.
*/
...
...
@@ -14,8 +14,14 @@ string *pike_include_path=({});
string *pike_module_path=({});
string *pike_program_path=({});
string combine_path_with_cwd(string path)
{
return combine_path(path[0]=='/'?"/":getcwd(),path);
}
mapping (string:string) environment=([]);
varargs mixed getenv(string s)
{
if(!s) return environment;
...
...
@@ -30,20 +36,20 @@ void putenv(string var, string val)
void add_include_path(string tmp)
{
tmp=combine_path
(get
cwd(
),
tmp);
tmp=combine_path
_with_
cwd(tmp);
pike_include_path-=({tmp});
pike_include_path=({tmp})+pike_include_path;
}
void remove_include_path(string tmp)
{
tmp=combine_path
(get
cwd(
),
tmp);
tmp=combine_path
_with_
cwd(tmp);
pike_include_path-=({tmp});
}
void add_module_path(string tmp)
{
tmp=combine_path
(get
cwd(
),
tmp);
tmp=combine_path
_with_
cwd(tmp);
pike_module_path-=({tmp});
pike_module_path=({tmp})+pike_module_path;
}
...
...
@@ -51,14 +57,14 @@ void add_module_path(string tmp)
void remove_module_path(string tmp)
{
tmp=combine_path
(get
cwd(
),
tmp);
tmp=combine_path
_with_
cwd(tmp);
pike_module_path-=({tmp});
}
void add_program_path(string tmp)
{
tmp=combine_path
(get
cwd(
),
tmp);
tmp=combine_path
_with_
cwd(tmp);
pike_program_path-=({tmp});
pike_program_path=({tmp})+pike_module_path;
}
...
...
@@ -66,7 +72,7 @@ void add_program_path(string tmp)
void remove_program_path(string tmp)
{
tmp=combine_path
(get
cwd(
),
tmp);
tmp=combine_path
_with_
cwd(tmp);
pike_program_path-=({tmp});
}
...
...
@@ -249,28 +255,32 @@ class dirnode
string dirname;
mapping cache=([]);
void create(string name) { dirname=name; }
object|program
`[]
(string index)
object|program
ind
(string index)
{
mixed ret;
if(zero_type(ret=cache[index]))
{
if(ret) return ret;
return UNDEFINED;
}
object m=((object)"/master");
if(mixed o=m->findmodule(dirname+"/module"))
{
if(mixed tmp=o->_module_value) o=tmp;
if(o=o[index]) return
cache[index]=
o;
if(o=o[index]) return o;
}
index = dirname+"/"+index;
if(object o=((object)"/master")->findmodule(index))
{
if(mixed tmp=o->_module_value) o=tmp;
return cache[index]=o;
return o;
}
return (program) index;
}
object|program `[](string index)
{
mixed ret;
if(!zero_type(ret=cache[index]))
{
if(ret) return ret;
return UNDEFINED;
}
return cache[index]=
(program)
index;
return cache[index]=
ind(
index
)
;
}
};
...
...
@@ -311,7 +321,7 @@ varargs mixed resolv(string identifier, string current_file)
{
tmp=current_file/"/";
tmp[-1]=identifier;
path=combine_path
(get
cwd(
),
tmp*"/");
path=combine_path
_with_
cwd( tmp*"/");
ret=findmodule(path);
}
...
...
@@ -536,7 +546,7 @@ string handle_include(string f,
{
tmp=current_file/"/";
tmp[-1]=f;
path=combine_path
(get
cwd(
),
tmp*"/");
path=combine_path
_with_
cwd(tmp*"/");
if(!file_stat(path)) return 0;
}
else
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment