w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

sh10.c File Reference
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <signal.h>
#include <errno.h>
#include <setjmp.h>
#include <ctype.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <limits.h>
#include <dirent.h>
#include "sh.h"
Include dependency graph for sh10.c:

Go to the source code of this file.

Macros

#define DuplicateMemoryArea(area, type)
 

Functions

static void near PrintCommand (C_Op *, int)
 
static void near PrintIOInformation (IO_Actions *)
 
static void near PrintCaseCommand (C_Op *)
 
static void near PrintIndentedString (char *, int, int)
 
static void near PrintVarArg (unsigned char *)
 
static void near fputMagicChar (unsigned int)
 
static void near PrintMode (int)
 
static void near SaveReleaseExecuteTree (C_Op *, void(*)(void *))
 
static void near SaveReleaseWordList (char **, void(*)(void *))
 
static void near SaveReleaseIOActions (IO_Actions **, void(*)(void *))
 
static void SaveTreeEntry (void *)
 
static C_Op *near DuplicateFunctionTree (C_Op *)
 
static char **near DuplicateWordList (char **list)
 
static IO_Actions **near DuplicateIOActions (IO_Actions **)
 
static int FindFunction (const void *, const void *)
 
static int SearchFunction (const void *, const void *)
 
static void DisplayFunction (const void *, VISIT, int)
 
static void DeleteAFunction (const void *, VISIT, int)
 
static int FindAlias (const void *, const void *)
 
static int SearchAlias (const void *, const void *)
 
static void UntrackAlias (const void *, VISIT, int)
 
static void DisplayAlias (const void *, VISIT, int)
 
int PrintAllFunctions (void)
 
void PrintFunction (register C_Op *t, int mode)
 
static void near PrintCommand (register C_Op *t, int mode)
 
static void near PrintIOInformation (register IO_Actions *iop)
 
FunctionListLookUpFunction (char *name, bool AllowDot)
 
bool SaveFunction (C_Op *t)
 
void DeleteAllFunctions (void)
 
void DeleteFunction (C_Op *t)
 
C_OpCopyFunction (C_Op *Old_t)
 
void PrintAlias (char *name)
 
int PrintAllAlias (bool tracked)
 
bool SaveAlias (char *name, char *arguments, bool tracked)
 
void DeleteAlias (char *name)
 
AliasListLookUpAlias (char *name, bool CreateTracked)
 
bool IsValidAliasName (char *s, bool alias)
 
void UnTrackAllAliases (void)
 

Variables

static bool DisplayListMode = ((bool)0)
 
static int Print_indent
 
static char * IOTypes [] = { "<", ">", "<>", "<<", ">>", ">&" }
 

Macro Definition Documentation

◆ DuplicateMemoryArea

#define DuplicateMemoryArea (   area,
  type 
)
Value:
(type)((area == (void *)NULL) \
? (void *)NULL \
#define type(a)
Definition: aptex-macros.h:171
#define NULL
Definition: ftobjs.h:61
void * DuplicateMemoryCell(void *)
Definition: sh1.c:1280

Definition at line 324 of file sh10.c.

Function Documentation

◆ CopyFunction()

C_Op* CopyFunction ( C_Op Old_t)

Definition at line 1251 of file sh10.c.

References DuplicateFunctionTree(), e, ErrorPoint, env::ErrorReturnPoint, NULL, and SetErrorPoint.

Referenced by ExecuteFunction().

◆ DeleteAFunction()

static void DeleteAFunction ( const void key,
VISIT  visit,
int  level 
)
static

Definition at line 1022 of file sh10.c.

References key, leaf, postorder, ReleaseMemoryCell(), SaveReleaseExecuteTree(), and mpark::visit().

Referenced by DeleteAllFunctions().

◆ DeleteAlias()

void DeleteAlias ( char *  name)

◆ DeleteAllFunctions()

void DeleteAllFunctions ( void  )

Definition at line 1009 of file sh10.c.

References DeleteAFunction(), FunctionTree, int(), signal(), twalk(), and void.

Referenced by ExitTheShell().

◆ DeleteFunction()

void DeleteFunction ( C_Op t)

◆ DisplayAlias()

static void DisplayAlias ( const void key,
VISIT  visit,
int  level 
)
static

Definition at line 378 of file sh10.c.

References ALIAS_TRACKED, DisplayListMode, key, leaf, name, postorder, PrintAlias(), and mpark::visit().

Referenced by PrintAllAlias().

◆ DisplayFunction()

static void DisplayFunction ( const void key,
VISIT  visit,
int  level 
)
static

Definition at line 371 of file sh10.c.

References key, leaf, PF_MODE_NORMAL, postorder, PrintFunction(), and mpark::visit().

Referenced by PrintAllFunctions().

◆ DuplicateFunctionTree()

static C_Op *near DuplicateFunctionTree ( C_Op Old_t)
static

◆ DuplicateIOActions()

static IO_Actions **near DuplicateIOActions ( IO_Actions **  list)
static

Definition at line 1223 of file sh10.c.

References DuplicateMemoryArea, DuplicateMemoryCell(), Np, and NULL.

Referenced by DuplicateFunctionTree().

◆ DuplicateWordList()

static char **near DuplicateWordList ( char **  list)
static

Definition at line 1198 of file sh10.c.

References DuplicateMemoryArea, NOWORD, NOWORDS, Np, and NULL.

Referenced by DuplicateFunctionTree().

◆ FindAlias()

static int FindAlias ( const void key1,
const void key2 
)
static

Definition at line 867 of file sh10.c.

References name, and strcmp().

Referenced by DeleteAlias(), and LookUpAlias().

◆ FindFunction()

static int FindFunction ( const void key1,
const void key2 
)
static

Definition at line 862 of file sh10.c.

References strcmp().

Referenced by DeleteFunction(), and LookUpFunction().

◆ fputMagicChar()

static void near fputMagicChar ( unsigned int  c)
static

Definition at line 715 of file sh10.c.

References c, CHAR_MAGIC, and CHAR_VARIABLE.

Referenced by PrintVarArg().

◆ IsValidAliasName()

bool IsValidAliasName ( char *  s,
bool  alias 
)

Definition at line 1418 of file sh10.c.

References C2bool, FALSE, IS_VariableFC, IS_VariableSC, LookUpSymbol(), and s.

Referenced by doalias(), and SaveFunction().

◆ LookUpAlias()

◆ LookUpFunction()

FunctionList* LookUpFunction ( char *  name,
bool  AllowDot 
)

◆ PrintAlias()

void PrintAlias ( char *  name)

Definition at line 1272 of file sh10.c.

References FALSE, ListVarFormat, LookUpAlias(), name, NULL, printf(), and AliasList::value.

Referenced by DisplayAlias(), and doalias().

◆ PrintAllAlias()

int PrintAllAlias ( bool  tracked)

Definition at line 1286 of file sh10.c.

References AliasTree, DisplayAlias(), DisplayListMode, and twalk().

Referenced by doalias().

◆ PrintAllFunctions()

int PrintAllFunctions ( void  )

Definition at line 333 of file sh10.c.

References DisplayFunction(), FunctionTree, and twalk().

Referenced by dofunctions().

◆ PrintCaseCommand()

static void near PrintCaseCommand ( C_Op t)
static

Definition at line 780 of file sh10.c.

References foputs(), NOWORD, NULL, PF_MODE_NORMAL, Print_indent, PrintFunction(), PrintIndentedString(), and PrintVarArg().

Referenced by PrintFunction().

◆ PrintCommand() [1/2]

static void near PrintCommand ( C_Op ,
int   
)
static

Referenced by PrintFunction().

◆ PrintCommand() [2/2]

static void near PrintCommand ( register C_Op t,
int  mode 
)
static

◆ PrintFunction()

◆ PrintIndentedString()

static void near PrintIndentedString ( char *  cp,
int  indent,
int  mode 
)
static

Definition at line 814 of file sh10.c.

References CHAR_TAB, cp, foputs(), i, indent, mode, PF_MODE_NORMAL, Print_indent, and PrintMode().

Referenced by PrintCaseCommand(), PrintCommand(), and PrintFunction().

◆ PrintIOInformation() [1/2]

static void near PrintIOInformation ( IO_Actions )
static

Referenced by PrintCommand().

◆ PrintIOInformation() [2/2]

◆ PrintMode()

static void near PrintMode ( int  mode)
static

Definition at line 842 of file sh10.c.

References CHAR_NEW_LINE, foputs(), mode, PF_MODE_ASYNC, PF_MODE_COPROC, and PF_MODE_NORMAL.

Referenced by PrintCommand(), and PrintIndentedString().

◆ PrintVarArg()

◆ SaveAlias()

bool SaveAlias ( char *  name,
char *  arguments,
bool  tracked 
)

◆ SaveFunction()

◆ SaveReleaseExecuteTree()

static void near SaveReleaseExecuteTree ( C_Op t,
void(*)(void *)  func 
)
static

Definition at line 1071 of file sh10.c.

References func, NULL, SaveReleaseIOActions(), and SaveReleaseWordList().

Referenced by DeleteAFunction(), DeleteFunction(), and SaveFunction().

◆ SaveReleaseIOActions()

static void near SaveReleaseIOActions ( IO_Actions **  list,
void(*)(void *)  func 
)
static

Definition at line 1119 of file sh10.c.

References func, IOFUNCTION, IOHERE, IOTYPE, NULL, ReleaseMemoryCell(), and unlink.

Referenced by SaveReleaseExecuteTree().

◆ SaveReleaseWordList()

static void near SaveReleaseWordList ( char **  list,
void(*)(void *)  func 
)
static

Definition at line 1097 of file sh10.c.

References NOWORD, and NOWORDS.

Referenced by SaveReleaseExecuteTree().

◆ SaveTreeEntry()

static void SaveTreeEntry ( void s)
static

Definition at line 1062 of file sh10.c.

References s, and SetMemoryAreaNumber().

Referenced by SaveFunction().

◆ SearchAlias()

static int SearchAlias ( const void key1,
const void key2 
)
static

Definition at line 936 of file sh10.c.

References name, and strcmp().

Referenced by SaveAlias().

◆ SearchFunction()

static int SearchFunction ( const void key1,
const void key2 
)
static

Definition at line 930 of file sh10.c.

References strcmp().

Referenced by SaveFunction().

◆ UntrackAlias()

static void UntrackAlias ( const void key,
VISIT  visit,
int  level 
)
static

◆ UnTrackAllAliases()

void UnTrackAllAliases ( void  )

Definition at line 1433 of file sh10.c.

References AliasTree, twalk(), and UntrackAlias().

Referenced by SetVariableArrayFromString().

Variable Documentation

◆ DisplayListMode

bool DisplayListMode = ((bool)0)
static

Definition at line 314 of file sh10.c.

Referenced by DisplayAlias(), and PrintAllAlias().

◆ IOTypes

char* IOTypes[] = { "<", ">", "<>", "<<", ">>", ">&" }
static

Definition at line 318 of file sh10.c.

Referenced by PrintIOInformation().

◆ Print_indent

int Print_indent
static

Definition at line 315 of file sh10.c.

Referenced by PrintCaseCommand(), PrintFunction(), and PrintIndentedString().