wcalc  2.5
About: Wcalc is a natural-expression command-line calculator.
  Fossies Dox: wcalc-2.5.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

variables.c File Reference
#include <ctype.h>
#include <string.h>
#include "number.h"
#include "calculator.h"
#include "list.h"
#include "variables.h"
#include "output.h"
Include dependency graph for variables.c:

Go to the source code of this file.


#define THE_VALUE   0
#define THE_STRUCTURE   2
#define THE_EXPRESSION   4
#define HASH_LENGTH   = 101


static void * getvar_core (const char *key, const int all_or_nothing)
void initvar (void)
void cleanupvar (void)
size_t numvars ()
void printvariables (void)
char ** listvarnames (void)
void delnvar (const size_t i)
variable_tgetrealnvar (const size_t i)
answer_t getvar (const char *key)
void getvarval (Number out, const char *key)
answer_t getvar_full (const char *key)
int varexists (const char *key)
int putexp (const char *key, const char *value, const char *desc)
int putval (const char *key, const Number value, const char *desc)


List them = NULL

Macro Definition Documentation


#define HASH_LENGTH   = 101

Definition at line 21 of file variables.c.


#define THE_EXPRESSION   4

Definition at line 20 of file variables.c.


#define THE_STRUCTURE   2

Definition at line 19 of file variables.c.


#define THE_VALUE   0

Definition at line 18 of file variables.c.

Function Documentation

◆ cleanupvar()

void cleanupvar ( void  )

◆ delnvar()

void delnvar ( const size_t  i)

◆ getrealnvar()

◆ getvar()

answer_t getvar ( const char *  key)

Definition at line 132 of file variables.c.

References answer::err, answer::exp, getvar_core(), num_init_set(), Number, THE_VALUE, and answer::val.

◆ getvar_core()

static void * getvar_core ( const char *  key,
const int  all_or_nothing 

◆ getvar_full()

◆ getvarval()

void getvarval ( Number  out,
const char *  key 

Definition at line 150 of file variables.c.

References getvar_core(), num_set(), Number, and THE_VALUE.

◆ initvar()

void initvar ( void  )

Definition at line 29 of file variables.c.

Referenced by main().

◆ listvarnames()

char** listvarnames ( void  )

◆ numvars()

size_t numvars ( void  )

Definition at line 53 of file variables.c.

References listLen(), and them.

Referenced by VariableList::clearVariables:, VariableList::numberOfRowsInTableView:, and saveState().

◆ printvariables()

void printvariables ( void  )

Definition at line 59 of file variables.c.

References display_var(), freeListIterator(), getListIterator(), listLen(), nextListElement(), and them.

Referenced by yyparse().

◆ putexp()

int putexp ( const char *  key,
const char *  value,
const char *  desc 

◆ putval()

int putval ( const char *  key,
const Number  value,
const char *  desc 

◆ varexists()

int varexists ( const char *  key)

Variable Documentation

◆ them