[go: up one dir, main page]

File: context.h

package info (click to toggle)
cook 2.19-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 7,316 kB
  • ctags: 3,969
  • sloc: ansic: 50,331; sh: 13,190; makefile: 4,542; yacc: 3,174; perl: 224; awk: 154
file content (110 lines) | stat: -rw-r--r-- 3,964 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
 *	cook - file construction tool
 *	Copyright (C) 1997, 2001 Peter Miller;
 *	All rights reserved.
 *
 *	This program is free software; you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License as published by
 *	the Free Software Foundation; either version 2 of the License, or
 *	(at your option) any later version.
 *
 *	This program is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU General Public License for more details.
 *
 *	You should have received a copy of the GNU General Public License
 *	along with this program; if not, write to the Free Software
 *	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
 *
 * MANIFEST: interface definition for cook/opcode/context.c
 */

#ifndef COOK_OPCODE_CONTEXT_H
#define COOK_OPCODE_CONTEXT_H

#include <ac/stddef.h>
#include <opcode/status.h>

struct string_ty; /* existence */
struct symtab_ty; /* existence */

typedef struct opcode_frame_ty opcode_frame_ty;
struct opcode_frame_ty
{
	struct opcode_list_ty *olp;
	size_t		pc;
	struct symtab_ty *stp;
};

typedef struct opcode_context_ty opcode_context_ty;
struct opcode_context_ty
{
	size_t		call_stack_length;
	size_t		call_stack_maximum;
	opcode_frame_ty	*call_stack;
	size_t		value_stack_length;
	size_t		value_stack_maximum;
	struct string_list_ty **value_stack;
	long		thread_id;

	struct symtab_ty *thread_stp;
	struct match_stack_ty *msp;

	int		pid;		/* used by opcode_command */
	int		exit_status;	/* used by opcode_command */
	struct rusage	*rup;		/* used by opcode_command */
	void		*wlp;		/* used by opcode_command */
	int		need_age;	/* used by graph_run */

	/* for suspend/resume */
	void		*flags;
	struct match_ty	*mp;
	struct string_ty *host_binding;

	/* for information about the graph */
	struct graph_ty *gp;
};

opcode_context_ty *opcode_context_new _((struct opcode_list_ty *,
	const struct match_ty *));
void opcode_context_delete _((opcode_context_ty *));
void opcode_context_call _((opcode_context_ty *, struct opcode_list_ty *));
void opcode_context_string_list_push _((opcode_context_ty *));
void opcode_context_string_push _((opcode_context_ty *, struct string_ty *));
void opcode_context_string_push_list _((opcode_context_ty *,
	const struct string_list_ty *));
struct string_list_ty *opcode_context_string_list_pop _((opcode_context_ty *));
struct string_list_ty *opcode_context_string_list_peek _((
	const opcode_context_ty *));
opcode_status_ty opcode_context_execute _((opcode_context_ty *));
opcode_status_ty opcode_context_execute_nowait _((opcode_context_ty *));
opcode_status_ty opcode_context_script _((opcode_context_ty *));
void opcode_context_goto _((opcode_context_ty *, size_t));

int opcode_context_getpid _((opcode_context_ty *));
void opcode_context_waited _((opcode_context_ty *, int));
void opcode_context_suspend _((opcode_context_ty *));
void opcode_context_resume _((opcode_context_ty *));

void opcode_context_host_binding_set _((opcode_context_ty *,
	struct string_ty *));

const struct match_ty *opcode_context_match_top _((const opcode_context_ty *));
const struct match_ty *opcode_context_match_pop _((opcode_context_ty *));
void opcode_context_match_push _((opcode_context_ty *,
	const struct match_ty *));

struct id_ty *opcode_context_id_search _((const opcode_context_ty *,
	struct string_ty *));
struct id_ty *opcode_context_id_search_fuzzy _((const opcode_context_ty *,
	struct string_ty *, struct string_ty **));
void opcode_context_id_assign _((opcode_context_ty *, struct string_ty *,
	struct id_ty *, int));
void opcode_context_id_unassign _((opcode_context_ty *, struct string_ty *));

struct string_list_ty *opcode_context_run _((opcode_context_ty *,
	struct opcode_list_ty *));
int opcode_context_run_bool _((opcode_context_ty *, struct opcode_list_ty *));

#endif /* COOK_OPCODE_CONTEXT_H */