BRL-CAD

Routine(s) to allow TCL calling libbu code. More...

#include "common.h"
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include "tcl.h"
#include "bu/cmd.h"
#include "bu/color.h"
#include "bu/debug.h"
#include "bu/file.h"
#include "bu/malloc.h"
#include "bu/str.h"
#include "bu/units.h"
#include "bu/bu_tcl.h"
#include "vmath.h"
Include dependency graph for tcl.c:

Go to the source code of this file.

Macros

#define TINYBUFSIZ   32
 
#define SMALLBUFSIZ   256
 

Functions

HIDDEN int tcl_bu_mem_barriercheck (void *clientData, int argc, const char **argv)
 
HIDDEN int tcl_bu_prmem (void *clientData, int argc, const char **argv)
 
HIDDEN int tcl_bu_get_value_by_keyword (void *clientData, int argc, const char **argv)
 
HIDDEN int tcl_bu_rgb_to_hsv (void *clientData, int argc, const char **argv)
 
HIDDEN int tcl_bu_hsv_to_rgb (void *clientData, int argc, const char **argv)
 
HIDDEN int tcl_bu_brlcad_dir (void *clientData, int argc, const char **argv)
 
HIDDEN int tcl_bu_brlcad_root (void *clientData, int argc, const char **argv)
 
HIDDEN int tcl_bu_brlcad_data (void *clientData, int argc, const char **argv)
 
HIDDEN int tcl_bu_units_conversion (void *clientData, int argc, const char **argv)
 
int Bu_Init (void *p)
 

Variables

Tcl_Interp * brlcad_interp = (Tcl_Interp *)0
 

Detailed Description

Routine(s) to allow TCL calling libbu code.

Definition in file tcl.c.

Macro Definition Documentation

#define TINYBUFSIZ   32

Definition at line 43 of file tcl.c.

Referenced by tcl_bu_get_value_by_keyword().

#define SMALLBUFSIZ   256

Definition at line 44 of file tcl.c.

Function Documentation

HIDDEN int tcl_bu_mem_barriercheck ( void *  clientData,
int  argc,
const char **  argv 
)

A wrapper for bu_mem_barriercheck.

Parameters
clientData- associated data/state
argc- number of elements in argv
argv- command name and arguments
Returns
BRLCAD_OK if successful, otherwise, BRLCAD_ERROR.

Definition at line 57 of file tcl.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_log(), bu_mem_barriercheck(), and UNLIKELY.

Referenced by Bu_Init().

Here is the call graph for this function:

HIDDEN int tcl_bu_prmem ( void *  clientData,
int  argc,
const char **  argv 
)

A wrapper for bu_prmem. Prints map of memory currently in use, to stderr.

Parameters
clientData- associated data/state
argc- number of elements in argv
argv- command name and arguments
Returns
BRLCAD_OK if successful, otherwise, BRLCAD_ERROR.

Definition at line 88 of file tcl.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_log(), and bu_prmem().

Referenced by Bu_Init().

Here is the call graph for this function:

HIDDEN int tcl_bu_get_value_by_keyword ( void *  clientData,
int  argc,
const char **  argv 
)

Given arguments of alternating keywords and values and a specific keyword ("Iwant"), return the value associated with that keyword.

example: bu_get_value_by_keyword Iwant az 35 elev 25 temp 9.6

If only one argument is given after the search keyword, it is interpreted as a list in the same format.

example: bu_get_value_by_keyword Iwant {az 35 elev 25 temp 9.6}

Search order is left-to-right, only first match is returned.

Sample use: bu_get_value_by_keyword V8 [concat type [.inmem get box.s]]

Parameters
clientData- associated data/state
argc- number of elements in argv
argv- command name and arguments
Returns
BRLCAD_OK if successful, otherwise, BRLCAD_ERROR.

Definition at line 125 of file tcl.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_log(), BU_STR_EQUAL, bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_strcat(), bu_vls_trunc(), OSL::Strings::interp, and TINYBUFSIZ.

Referenced by Bu_Init().

Here is the call graph for this function:

HIDDEN int tcl_bu_rgb_to_hsv ( void *  clientData,
int  argc,
const char **  argv 
)

A wrapper for bu_rgb_to_hsv.

Parameters
clientData- associated data/state
argc- number of elements in argv
argv- command name and arguments
Returns
BRLCAD_OK if successful, otherwise, BRLCAD_ERROR.

Definition at line 209 of file tcl.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_log(), bu_rgb_to_hsv(), bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_printf(), OSL::Strings::hsv, OSL::Strings::interp, and OSL::Strings::rgb.

Referenced by Bu_Init().

Here is the call graph for this function:

HIDDEN int tcl_bu_hsv_to_rgb ( void *  clientData,
int  argc,
const char **  argv 
)

A wrapper for bu_hsv_to_rgb.

Parameters
clientData- associated data/state
argc- number of elements in argv
argv- command name and arguments
Returns
BRLCAD_OK if successful, otherwise, BRLCAD_ERROR.

Definition at line 258 of file tcl.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_hsv_to_rgb(), bu_log(), bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_printf(), OSL::Strings::hsv, OSL::Strings::interp, and OSL::Strings::rgb.

Referenced by Bu_Init().

Here is the call graph for this function:

HIDDEN int tcl_bu_brlcad_dir ( void *  clientData,
int  argc,
const char **  argv 
)

A wrapper for bu_brlcad_dir.

Parameters
clientData- associated data/state
argc- number of elements in argv
argv- command name and arguments
Returns
BRLCAD_OK if successful, otherwise, BRLCAD_ERROR.

Definition at line 304 of file tcl.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_brlcad_dir(), bu_log(), and OSL::Strings::interp.

Referenced by Bu_Init().

Here is the call graph for this function:

HIDDEN int tcl_bu_brlcad_root ( void *  clientData,
int  argc,
const char **  argv 
)

A wrapper for bu_brlcad_root.

Parameters
clientData- associated data/state
argc- number of elements in argv
argv- command name and arguments
Returns
BRLCAD_OK if successful, otherwise, BRLCAD_ERROR.

Definition at line 327 of file tcl.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_brlcad_root(), bu_log(), and OSL::Strings::interp.

Referenced by Bu_Init().

Here is the call graph for this function:

HIDDEN int tcl_bu_brlcad_data ( void *  clientData,
int  argc,
const char **  argv 
)

A wrapper for bu_brlcad_data.

Parameters
clientData- associated data/state
argc- number of elements in argv
argv- command name and arguments
Returns
BRLCAD_OK if successful, otherwise, BRLCAD_ERROR.

Definition at line 351 of file tcl.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_brlcad_data(), bu_log(), and OSL::Strings::interp.

Referenced by Bu_Init().

Here is the call graph for this function:

HIDDEN int tcl_bu_units_conversion ( void *  clientData,
int  argc,
const char **  argv 
)

A wrapper for bu_units_conversion.

Parameters
clientData- associated data/state
argc- number of elements in argv
argv- command name and arguments
Returns
BRLCAD_OK if successful, otherwise, BRLCAD_ERROR.

Definition at line 375 of file tcl.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_log(), bu_units_conversion(), bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_printf(), and OSL::Strings::interp.

Referenced by Bu_Init().

Here is the call graph for this function: