Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
838abf56
Commit
838abf56
authored
Oct 06, 1994
by
Karl Heuer
Browse files
(Fload, load_unwind): Store stream pointer as a cons of two integers,
obviating the need for Lisp_Internal_Stream datatype.
parent
51236710
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
src/lread.c
src/lread.c
+6
-9
No files found.
src/lread.c
View file @
838abf56
...
...
@@ -350,7 +350,6 @@ Return t if file exists.")
register
FILE
*
stream
;
register
int
fd
=
-
1
;
register
Lisp_Object
lispstream
;
register
FILE
**
ptr
;
int
count
=
specpdl_ptr
-
specpdl
;
Lisp_Object
temp
;
struct
gcpro
gcpro1
;
...
...
@@ -429,12 +428,9 @@ Return t if file exists.")
message
(
"Loading %s..."
,
XSTRING
(
str
)
->
data
);
GCPRO1
(
str
);
/* We may not be able to store STREAM itself as a Lisp_Object pointer
since that is guaranteed to work only for data that has been malloc'd.
So malloc a full-size pointer, and record the address of that pointer. */
ptr
=
(
FILE
**
)
xmalloc
(
sizeof
(
FILE
*
));
*
ptr
=
stream
;
XSETINTERNAL_STREAM
(
lispstream
,
(
EMACS_INT
)
ptr
);
lispstream
=
Fcons
(
Qnil
,
Qnil
);
XSETFASTINT
(
XCONS
(
lispstream
)
->
car
,
(
EMACS_UINT
)
stream
>>
16
);
XSETFASTINT
(
XCONS
(
lispstream
)
->
cdr
,
(
EMACS_UINT
)
stream
&
0xffff
);
record_unwind_protect
(
load_unwind
,
lispstream
);
record_unwind_protect
(
load_descriptor_unwind
,
load_descriptor_list
);
load_descriptor_list
...
...
@@ -458,8 +454,8 @@ static Lisp_Object
load_unwind
(
stream
)
/* used as unwind-protect function in load */
Lisp_Object
stream
;
{
fclose
(
*
(
FILE
**
)
XSTRING
(
stream
));
xfree
(
XPNTR
(
stream
));
fclose
(
XFASTINT
(
XCONS
(
stream
)
->
car
)
<<
16
|
XFASTINT
(
XCONS
(
stream
)
->
cdr
)
);
if
(
--
load_in_progress
<
0
)
load_in_progress
=
0
;
return
Qnil
;
}
...
...
@@ -469,6 +465,7 @@ load_descriptor_unwind (oldlist)
Lisp_Object
oldlist
;
{
load_descriptor_list
=
oldlist
;
return
Qnil
;
}
/* Close all descriptors in use for Floads.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment