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
217a000d
Commit
217a000d
authored
26 years ago
by
Fredrik Hübinette (Hubbe)
Browse files
Options
Downloads
Patches
Plain Diff
inlined a bunch of code
Rev: lib/modules/Stdio.pmod:1.22
parent
62e87b47
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/modules/Stdio.pmod
+35
-56
35 additions, 56 deletions
lib/modules/Stdio.pmod
with
35 additions
and
56 deletions
lib/modules/Stdio.pmod
+
35
−
56
View file @
217a000d
...
...
@@ -15,21 +15,13 @@ class File
#endif
mixed ___id;
// This function is needed so that create() doesn't call an overloaded
// variant by mistake.
static private nomask int __open(string file, string mode,void|int bits)
int open(string file, string mode, void|int bits)
{
_fd=Fd();
if(query_num_arg()<3) bits=0666;
return ::open(file,mode,bits);
}
int open(string file, string mode, void|int bits)
{
if(query_num_arg()<3) bits=0666;
return __open(file, mode, bits);
}
int open_socket(int|void port, string|void address)
{
_fd=Fd();
...
...
@@ -64,27 +56,27 @@ class File
}
}
void create(
mixed ... arg
s)
void create(
string|void file,void|string mode,void|int bit
s)
{
if(sizeof(args)
)
switch(file
)
{
switch(args[0])
{
case "stdin"
:
_fd=_stdin
;
break;
case "stdout":
_fd=_stdin
;
break;
case "
stderr
":
_fd=_stderr
;
break;
default:
__open(@args)
;
}
case "stdin":
_fd=_stdin;
case 0
:
break
;
case "stdout":
_fd=_stdin;
break
;
case "stderr":
_fd=_
stderr
;
break
;
default:
_fd=Fd();
if(query_num_arg()<3) bits=0666
;
::open(file,mode,bits);
}
}
...
...
@@ -167,16 +159,12 @@ class File
static void my_write_oob_callback() { ___write_oob_callback(___id); }
#endif
#define SET(X,Y) ::set_##X ((___##X = (Y)) && my_##X)
#define CBFUNC(X) \
static private nomask void __set_##X (mixed l##X) \
{ \
___##X=l##X; \
::set_##X(l##X && my_##X); \
} \
\
void set_##X (mixed l##X) \
{ \
__set_##X(
l##X); \
SET( X ,
l##X
); \
} \
\
mixed query_##X () \
...
...
@@ -192,11 +180,7 @@ class File
#endif
mixed query_close_callback() { return ___close_callback; }
static private nomask void __set_close_callback(mixed c)
{
___close_callback=c;
}
mixed set_close_callback(mixed c) { __set_close_callback(c); }
mixed set_close_callback(mixed c) { ___close_callback=c; }
void set_id(mixed i) { ___id=i; }
mixed query_id() { return ___id; }
...
...
@@ -209,30 +193,25 @@ class File
#endif
)
{
// Use the __set_xxxx_callback() functions here, so that we
// don't call overloaded versions by mistake.
// /grubba 1998-04-10
__set_read_callback(rcb);
__set_write_callback(wcb);
__set_close_callback(ccb);
SET(read_callback,rcb);
SET(write_callback,wcb);
___close_callback=ccb;
#if constant(__HAVE_OOB__)_
__set_
read_oob_callback
(
roobcb);
__set_
write_oob_callback
(
woobcb);
SET(
read_oob_callback
,
roobcb);
SET(
write_oob_callback
,
woobcb);
#endif
::set_nonblocking();
}
void set_blocking()
{
// Use the __set_xxxx_callback() functions here, so that we
// don't call overloaded versions by mistake.
// /grubba 1998-04-10
__set_read_callback(0);
__set_write_callback(0);
__set_close_callback(0);
SET(read_callback,0);
SET(write_callback,0);
___close_callback=0;
#if constant(__HAVE_OOB__)_
__set_
read_oob_callback
(
0);
__set_
write_oob_callback
(
0);
SET(
read_oob_callback
,
0);
SET(
write_oob_callback
,
0);
#endif
::set_blocking();
}
...
...
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