File: funcref-private.h

package info (click to toggle)
libi8x 0.0.5-1
  • links: PTS
  • area: main
  • in suites: sid
  • size: 7,192 kB
  • ctags: 1,365
  • sloc: ansic: 6,874; python: 1,339; makefile: 146; sh: 102
file content (61 lines) | stat: -rw-r--r-- 2,171 bytes parent folder | download | duplicates (3)
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
/* Copyright (C) 2016 Red Hat, Inc.
   This file is part of the Infinity Note Execution Library.

   The Infinity Note Execution Library is free software; you can
   redistribute it and/or modify it under the terms of the GNU Lesser
   General Public License as published by the Free Software
   Foundation; either version 2.1 of the License, or (at your option)
   any later version.

   The Infinity Note Execution Library 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 Lesser General Public License for more
   details.

   You should have received a copy of the GNU Lesser General Public
   License along with the Infinity Note Execution Library; if not, see
   <http://www.gnu.org/licenses/>.  */

#ifndef _FUNCREF_PRIVATE_H_
#define _FUNCREF_PRIVATE_H_

#include "libi8x-private.h"

/* Function references.  */

struct i8x_funcref
{
  I8X_OBJECT_FIELDS;

  char *fullname;	/* Fully qualified name.  */
  bool is_private;	/* Is this function API-private?  */

  struct i8x_type *type;	/* The function's type.  */
  size_t num_args;		/* Number of arguments.  */
  size_t num_rets;		/* Number of returns.  */

  int regcount;		/* Number of functions registered in this
			   context with this signature.  */

  /* Pointer to the exactly one function registered in the
     context with this signature, or NULL if there is not
     exactly one function registered with this signature.  */
  struct i8x_func *unique;

  /* Pointer to the function this reference resolves to, or
     NULL if this reference is not resolved.  For a reference
     to be resolved there needs to be exactly one function
     registered in the context with this signature, and every
     function that function references in its externals table
     must also be resolved.  */
  struct i8x_func *resolved;

  /* Interpreted and native implementations of the function
     this reference resolves to, or NULL if this reference
     is not resolved.  */
  struct i8x_code *interp_impl;
  i8x_nat_fn_t *native_impl;
};

#endif /* _FUNCREF_PRIVATE_H_ */