Next: 3.10.9 nxa Up: 3.10 Classes Previous: 3.10.7 mtx Contents Index
Subsections

- 3.10.8.1 API

##
3.10.8 nx

The nx class encapsulates an Onyx interpreter instance. It contains a number of interpreter-global objects, as well as the garbage collector. Reclamation all objects associated with an nx instance is managed by a garbage collector, so when an nx is destroyed, all associated objects are deallocated.

### 3.10.8.1 API

cw_nx_t * nx_new(cw_nx_t *a_nx, cw_op_t *a_thread_init, int a_argc, char **a_argv, char **a_envp):

  Input(s):
    a_nx:
      Pointer to space for an nx, or NULL.
    a_thread_init:
      Pointer to an initialization function to be called during thread initialization, or NULL.
    a_argc:
      Number of command line arguments.
    a_argv:
      Pointer to an array of command line argument strings.
    a_envp:
      Pointer to an array of environment variable strings.
  Output(s):
    retval:
      Pointer to an nx.
  Exception(s):
    CW_ONYXX_OOM.
  Description:
    Constructor.

void nx_delete(cw_nx_t *a_nx):

  Input(s):
      Pointer to an nx.
  Output(s):
    None.
  Exception(s):
    None.
  Description:
    Destructor.

cw_nxa_t * nx_nxa_get(cw_nx_t *a_nx):

  Input(s):
      Pointer to an nx.
  Output(s):
    retval:
      Pointer to an nxa.
  Exception(s):
    None.
  Description:
    Return a pointer to the garbage collector.

cw_nxo_t * nx_systemdict_get(cw_nx_t *a_nx):

  Input(s):
    a_nx:
      Pointer to an nx.
  Output(s):
    retval:
      Pointer to the nxo corresponding to systemdict .
  Exception(s):
    None.
  Description:
    Return a pointer to the nxo corresponding to systemdict .

cw_nxo_t * nx_globaldict_get(cw_nx_t *a_nx):

  Input(s):
    a_nx:
      Pointer to an nx.
  Output(s):
    retval:
      Pointer to the nxo corresponding to globaldict .
  Exception(s):
    None.
  Description:
    Return a pointer to the nxo corresponding to globaldict .

cw_nxo_t * nx_envdict_get(cw_nx_t *a_nx):

  Input(s):
    a_nx:
      Pointer to an nx.
  Output(s):
    retval:
      Pointer to the nxo corresponding to envdict .
  Exception(s):
    None.
  Description:
    Return a pointer to the nxo corresponding to envdict .

cw_nxo_t * nx_stdin_get(cw_nx_t *a_nx):

  Input(s):
    a_nx:
      Pointer to an nx.
  Output(s):
    retval:
      Pointer to the nxo corresponding to stdin .
  Exception(s):
    None.
  Description:
    Return a pointer to the nxo corresponding to stdin .

cw_nxo_t * nx_stdout_get(cw_nx_t *a_nx):

  Input(s):
    a_nx:
      Pointer to an nx.
  Output(s):
    retval:
      Pointer to the nxo corresponding to stdout .
  Exception(s):
    None.
  Description:
    Return a pointer to the nxo corresponding to stdout .

cw_nxo_t * nx_stderr_get(cw_nx_t *a_nx):

  Input(s):
    a_nx:
      Pointer to an nx.
  Output(s):
    retval:
      Pointer to the nxo corresponding to stderr .
  Exception(s):
    None.
  Description:
    Return a pointer to the nxo corresponding to stderr .

Next: 3.10.9 nxa Up: 3.10 Classes Previous: 3.10.7 mtx Contents Index