naev 0.12.5
cond.c File Reference

Handles lua conditionals. More...

#include "cond.h"
#include "log.h"
#include "nlua.h"
Include dependency graph for cond.c:

Go to the source code of this file.

Functions

int cond_init (void)
 Initializes the conditional subsystem.
void cond_exit (void)
 Destroys the conditional subsystem.
int cond_compile (const char *cond)
 Compiles a conditional statement that can then be used as a reference.
int cond_check (const char *cond)
 Checks to see if a condition is true.
int cond_checkChunk (int chunk, const char *cond)

Variables

static nlua_env cond_env = LUA_NOREF

Detailed Description

Handles lua conditionals.

Definition in file cond.c.

Function Documentation

◆ cond_check()

int cond_check ( const char * cond)

Checks to see if a condition is true.

Parameters
condCondition to check.
Returns
0 if is false, 1 if is true, -1 on error.

Definition at line 100 of file cond.c.

◆ cond_checkChunk()

int cond_checkChunk ( int chunk,
const char * cond )

Definition at line 163 of file cond.c.

◆ cond_compile()

int cond_compile ( const char * cond)

Compiles a conditional statement that can then be used as a reference.

Parameters
condConditional string to compile.
Returns
LUA_NOREF on failure, a valid reference otherwise.

Definition at line 52 of file cond.c.

◆ cond_exit()

void cond_exit ( void )

Destroys the conditional subsystem.

Definition at line 40 of file cond.c.

◆ cond_init()

int cond_init ( void )

Initializes the conditional subsystem.

Conditional Lua env.

Definition at line 23 of file cond.c.

Variable Documentation

◆ cond_env

nlua_env cond_env = LUA_NOREF
static

Definition at line 18 of file cond.c.