nfs-ganesha 1.4
Classes | Defines | Typedefs | Functions

shell_vars.c File Reference

variables management for the shell. More...

#include <HashTable.h>
#include <strings.h>
#include <stdlib.h>
#include <string.h>
#include "shell_vars.h"
#include "abstract_mem.h"

Go to the source code of this file.

Classes

struct  shell_variable__

Defines

#define IS_LETTER(_c_)   (((_c_) >= 'a') && ((_c_) <= 'z'))
#define IS_LETTER_CAP(_c_)   (((_c_) >= 'A') && ((_c_) <= 'Z'))
#define IS_NUMERIC(_c_)   (((_c_) >= '0') && ((_c_) <= '9'))

Typedefs

typedef struct shell_variable__ shell_variable_t

Functions

void SetVarTable (shell_variable_t *var_table)
void print_varlist (FILE *output, int is_dlen)
int is_authorized_varname (char *str)
char * get_var_value (char *varname)
int set_var_value (char *varname, char *var_value)
int free_var (char *varname)

Detailed Description

variables management for the shell.

Author:
Author:
leibovic
Date:
Date:
2006/01/24 13:49:33
Version:
Revision:
1.8
Log:
shell_vars.c,v

Revision 1.8 2006/01/24 13:49:33 leibovic Adding missing includes.

Revision 1.6 2005/07/26 12:54:47 leibovic Multi-thread shell with synchronisation routines.

Revision 1.4 2005/05/09 12:23:55 leibovic Version 2 of ganeshell.

Revision 1.3 2005/05/03 08:06:23 leibovic Adding meminfo command.

Revision 1.1 2004/12/14 09:56:00 leibovic Variables management.

Definition in file shell_vars.c.


Define Documentation

#define IS_LETTER (   _c_)    (((_c_) >= 'a') && ((_c_) <= 'z'))

Definition at line 212 of file shell_vars.c.

#define IS_LETTER_CAP (   _c_)    (((_c_) >= 'A') && ((_c_) <= 'Z'))

Definition at line 213 of file shell_vars.c.

#define IS_NUMERIC (   _c_)    (((_c_) >= '0') && ((_c_) <= '9'))

Definition at line 214 of file shell_vars.c.


Typedef Documentation


Function Documentation

int free_var ( char *  varname)

free the resources used by a variable.

Definition at line 283 of file shell_vars.c.

char* get_var_value ( char *  varname)

returns the value for a variable, NULL if the variable doesn't exist.

Definition at line 249 of file shell_vars.c.

int is_authorized_varname ( char *  str)

indicates whether a name is authorized for a variable. A variable name must be in [a-zA-Z0-9._:]*

Definition at line 219 of file shell_vars.c.

void print_varlist ( FILE *  output,
int  is_dlen 
)

print var list.

Definition at line 115 of file shell_vars.c.

int set_var_value ( char *  varname,
char *  var_value 
)

set the value for a variable, and create it if necessary.

Definition at line 265 of file shell_vars.c.

void SetVarTable ( shell_variable_t var_table)

Definition at line 105 of file shell_vars.c.