Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
51 lines (43 loc) · 1.82 KB

File metadata and controls

51 lines (43 loc) · 1.82 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#include "devs_internal.h"
static const devs_service_spec_t *getspec(devs_ctx_t *ctx, value_t self) {
const devs_service_spec_t *s = devs_value_to_service_spec(ctx, self);
if (!s)
devs_throw_expecting_error(ctx, DEVS_BUILTIN_STRING_SERVICESPEC, self);
return s;
}
#define SELF() \
const devs_service_spec_t *spec = getspec(ctx, self); \
if (spec == NULL) \
return devs_undefined
value_t prop_DsServiceSpec_classIdentifier(devs_ctx_t *ctx, value_t self) {
SELF();
return devs_value_from_int(spec->service_class);
}
value_t prop_DsServiceSpec_name(devs_ctx_t *ctx, value_t self) {
SELF();
return devs_value_from_handle(DEVS_HANDLE_TYPE_IMG_BUFFERISH, spec->name_idx);
}
void meth1_DsServiceSpec_lookup(devs_ctx_t *ctx) {
const devs_service_spec_t *spec = getspec(ctx, devs_arg_self(ctx));
if (!spec)
return;
devs_ret(ctx, devs_spec_lookup(ctx, spec, devs_arg(ctx, 0)));
}
void meth1_DsServiceSpec_byCode(devs_ctx_t *ctx) {
const devs_service_spec_t *spec = getspec(ctx, devs_arg_self(ctx));
if (!spec)
return;
const devs_packet_spec_t *pspec = devs_pkt_spec_by_code(ctx, spec, devs_arg_int(ctx, 0));
devs_ret(ctx, devs_value_from_packet_spec(ctx, pspec));
}
void meth1_DsServiceSpec_assign(devs_ctx_t *ctx) {
const devs_service_spec_t *spec = getspec(ctx, devs_arg_self(ctx));
if (!spec)
return;
devs_packet_t *pkt = devs_value_to_packet_or_throw(ctx, devs_arg(ctx, 0));
if (!pkt)
return;
int idx = devs_value_to_service_spec_idx(ctx, devs_arg_self(ctx));
JD_ASSERT(idx >= 0);
pkt->roleidx = DEVS_ROLE_FIRST_SPEC + idx;
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.