Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LSH
lsh
Commits
06a3e5ff
Commit
06a3e5ff
authored
Jul 06, 2001
by
Niels Möller
Browse files
* src/sexp_commands.h (sexp_print_command): Inherit command_2.
Rev: src/sexp_commands.c:1.19 Rev: src/sexp_commands.h:1.8
parent
e598b09c
Changes
2
Show whitespace changes
Inline
Side-by-side
src/sexp_commands.c
View file @
06a3e5ff
...
...
@@ -50,61 +50,41 @@ static struct read_sexp_command read_sexp;
*
* Prints the sexp to tha abstract_write OUT. Returns the sexp. */
/* GABA:
(class
(name sexp_print_to)
(super command)
(vars
(format . int)
(dest object abstract_write)))
*/
static
void
do_sexp_print
(
struct
command
*
s
,
struct
lsh_object
*
a
,
do_sexp_print
(
struct
command_2
*
s
,
struct
lsh_object
*
a1
,
struct
lsh_object
*
a2
,
struct
command_continuation
*
c
,
struct
exception_handler
*
e
UNUSED
)
{
CAST
(
sexp_print_to
,
self
,
s
);
CAST_SUBTYPE
(
sexp
,
o
,
a
);
CAST
(
sexp_print_command
,
self
,
s
);
CAST_SUBTYPE
(
abstract_write
,
dest
,
a1
);
CAST_SUBTYPE
(
sexp
,
o
,
a2
);
A_WRITE
(
self
->
dest
,
sexp_format
(
o
,
self
->
format
,
0
));
A_WRITE
(
dest
,
sexp_format
(
o
,
self
->
format
,
0
));
if
(
self
->
format
!=
SEXP_CANONICAL
)
A_WRITE
(
self
->
dest
,
ssh_format
(
"
\n
"
));
A_WRITE
(
dest
,
ssh_format
(
"
\n
"
));
COMMAND_RETURN
(
c
,
a
);
COMMAND_RETURN
(
c
,
o
);
}
struct
command
*
make_sexp_print_
to
(
int
format
,
struct
abstract_write
*
dest
)
struct
command
_2
*
make_sexp_print_
command
(
int
format
)
{
NEW
(
sexp_print_to
,
self
);
self
->
super
.
call
=
do_sexp_print
;
NEW
(
sexp_print_command
,
self
);
self
->
super
.
super
.
call
=
do_command_2
;
self
->
super
.
invoke
=
do_sexp_print
;
self
->
format
=
format
;
self
->
dest
=
dest
;
return
&
self
->
super
;
}
struct
lsh_object
*
do_sexp_print_simple
(
struct
command_simple
*
s
,
struct
lsh_object
*
a
)
{
CAST
(
sexp_print_command
,
self
,
s
);
CAST_SUBTYPE
(
abstract_write
,
dest
,
a
);
return
&
make_sexp_print_to
(
self
->
format
,
dest
)
->
super
;
}
struct
command_simple
*
make_sexp_print_command
(
int
format
)
struct
command
*
make_sexp_print_to
(
int
format
,
struct
abstract_write
*
dest
)
{
NEW
(
sexp_print_command
,
self
);
self
->
super
.
super
.
call
=
do_call_simple_command
;
self
->
super
.
call_simple
=
do_sexp_print_simple
;
self
->
format
=
format
;
return
&
self
->
super
;
return
make_command_2_invoke
(
make_sexp_print_command
(
format
),
&
dest
->
super
);
}
DEFINE_COMMAND3
(
sexp_print_raw_hash
)
...
...
@@ -280,8 +260,12 @@ static struct read_sexp_command read_sexp
(proc (read_sexp file)))))))
*/
DEFINE_COMMAND_SIMPLE
(
for_sexp_command
,
a
)
DEFINE_COMMAND
(
for_sexp_command
)
(
struct
command
*
s
UNUSED
,
struct
lsh_object
*
a
,
struct
command_continuation
*
c
,
struct
exception_handler
*
e
UNUSED
)
{
CAST_SUBTYPE
(
command
,
handler
,
a
);
return
for_sexp
(
handler
);
COMMAND_RETURN
(
c
,
for_sexp
(
handler
)
)
;
}
src/sexp_commands.h
View file @
06a3e5ff
...
...
@@ -38,19 +38,15 @@
/* GABA:
(class
(name sexp_print_command)
(super command_
simple
)
(super command_
2
)
(vars
(format . int)))
*/
struct
lsh_object
*
do_sexp_print_simple
(
struct
command_simple
*
s
,
struct
lsh_object
*
a
);
#define STATIC_PRINT_SEXP(format) \
{ STATIC_
COMMAND_SIMPLE(do_sexp_print_simple)
, format }
{
{ STATIC_
HEADER, do_command_2}
, format }
struct
command_
simple
*
struct
command_
2
*
make_sexp_print_command
(
int
format
);
struct
command
*
...
...
@@ -85,7 +81,7 @@ do_read_sexp(struct command *s,
struct
command
*
make_read_sexp_command
(
int
format
,
int
goon
,
UINT32
max_size
);
extern
struct
command
_simple
for_sexp_command
;
#define FOR_SEXP (&for_sexp_command.super
.super
)
extern
struct
command
for_sexp_command
;
#define FOR_SEXP (&for_sexp_command.super)
#endif
/* SEXP_COMMANDS_H_INCLUDED */
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