BRL-CAD
exists.c File Reference
#include "common.h"
#include <stdlib.h>
#include <string.h>
#include "bu/cmd.h"
#include "./ged_private.h"
Include dependency graph for exists.c:

Go to the source code of this file.

Data Structures

struct  t_op
 
struct  exists_data
 

Macros

#define __arraycount(__x)   (sizeof(__x) / sizeof(__x[0]))
 
#define EXISTS_DATA_INIT_ZERO   {NULL, NULL, NULL, NULL, 0}
 
#define VTOC(x)   (const unsigned char *)((const struct t_op *)x)->op_text
 

Enumerations

enum  token {
  EOI, OEXIST, OCOMB, ONULL,
  ONNULL, OPRIM, OBVOL, EXTEQ,
  EXTNE, EXTGT, EXTLT, BVOLEQ,
  BVOLNE, BVOLGE, BVOLGT, BVOLLE,
  BVOLLT, UNOT, BAND, BOR,
  LPAREN, RPAREN, OPERAND
}
 
enum  token_types {
  UNOP, BINOP, BUNOP, BBINOP,
  PAREN
}
 

Functions

int db_object_exists (struct exists_data *)
 
int db_object_exists_and_non_null (struct exists_data *)
 
int ged_exists (struct ged *gedp, int argc, const char *argv_orig[])
 

Detailed Description

The exist command.

Based on public domein code from: NetBSD: test.c, v 1.38 2011/08/29 14:51:19 joerg

test(1); version 7-like – author Erik Baalbergen modified by Eric Gisin to be used as built-in. modified by Arnold Robbins to add SVR3 compatibility (-x -c -b -p -u -g -k) plus Korn's -L -nt -ot -ef and new -S (socket). modified by J.T. Conklin for NetBSD.

Definition in file exists.c.

Macro Definition Documentation

#define __arraycount (   __x)    (sizeof(__x) / sizeof(__x[0]))

Definition at line 60 of file exists.c.

#define EXISTS_DATA_INIT_ZERO   {NULL, NULL, NULL, NULL, 0}

Definition at line 156 of file exists.c.

Referenced by ged_exists().

#define VTOC (   x)    (const unsigned char *)((const struct t_op *)x)->op_text

Definition at line 168 of file exists.c.

Enumeration Type Documentation

enum token
Enumerator
EOI 
OEXIST 
OCOMB 
ONULL 
ONNULL 
OPRIM 
OBVOL 
EXTEQ 
EXTNE 
EXTGT 
EXTLT 
BVOLEQ 
BVOLNE 
BVOLGE 
BVOLGT 
BVOLLE 
BVOLLT 
UNOT 
BAND 
BOR 
LPAREN 
RPAREN 
OPERAND 

Definition at line 65 of file exists.c.

Enumerator
UNOP 
BINOP 
BUNOP 
BBINOP 
PAREN 

Definition at line 92 of file exists.c.

Function Documentation

int db_object_exists ( struct exists_data ed)

Definition at line 417 of file exists.c.

References db_lookup(), rt_wdb::dbip, ged::ged_wdbp, exists_data::gedp, LOOKUP_QUIET, and exists_data::t_wp.

Referenced by db_object_exists_and_non_null().

Here is the call graph for this function:

int db_object_exists_and_non_null ( struct exists_data ed)

Definition at line 426 of file exists.c.

References db_object_exists().

Here is the call graph for this function:

int ged_exists ( struct ged gedp,
int  argc,
const char *  argv_orig[] 
)

Checks for the existence of a specified object.

Definition at line 444 of file exists.c.

References bu_dup_argv(), bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_printf(), bu_vls_strlen(), bu_vls_trunc(), EXISTS_DATA_INIT_ZERO, GED_CHECK_ARGC_GT_0, GED_CHECK_DATABASE_OPEN, GED_ERROR, GED_HELP, GED_OK, ged::ged_result_str, exists_data::gedp, exists_data::message, exists_data::t_wp, exists_data::t_wp_op, and usage().

Here is the call graph for this function: