cd.c File Reference

#include "shell.h"
#include "var.h"
#include "nodes.h"
#include "jobs.h"
#include "options.h"
#include "output.h"
#include "memalloc.h"
#include "error.h"
#include "mystring.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>

Include dependency graph for cd.c:

Go to the source code of this file.

Defines

#define MAXPWD   256

Functions

STATIC int docd ()
STATIC void updatepwd ()
STATIC void getpwd ()
STATIC char * getcomponent ()
int cdcmd (argc, char **argv)
STATIC int docd (char *dest, print, tohome)
void hashcd ()
STATIC void updatepwd (char *dir)
int pwdcmd (argc, char **argv)

Variables

static char sccsid [] = "@(#)cd.c 5.2 (Berkeley) 3/13/91"
char * curdir
STATIC char * cdcomppath
int didudir


Define Documentation

#define MAXPWD   256
 

Definition at line 327 of file cd.c.

Referenced by getpwd().


Function Documentation

int cdcmd argc  ,
char **  argv
 

Definition at line 81 of file cd.c.

References argptr, bltinlookup(), docd(), error, nextopt(), NULL, nullstr, p, padvance(), path, S_IFDIR, S_IFMT, stat::st_mode, stat, and strcmp.

STATIC int docd char *  dest,
print  ,
tohome 
 

Definition at line 119 of file cd.c.

References chdir, didudir, iflag, INTOFF, INTON, out1fmt(), print, stackblock, and updatepwd().

STATIC int docd  ) 
 

Referenced by cdcmd().

STATIC char * getcomponent  ) 
 

Definition at line 243 of file cd.c.

References cdcomppath, NULL, and start.

Referenced by updatepwd().

STATIC void getpwd  ) 
 

Definition at line 330 of file cd.c.

References close, copyfd(), curdir, EINTR, errno, error, execl, FORK_NOJOB, forkshell(), INTOFF, INTON, makejob(), MAXPWD, NULL, pipe, read, savestr, status, and waitforjob().

Referenced by pwdcmd().

void hashcd  ) 
 

Definition at line 561 of file exec.c.

Referenced by updatepwd().

int pwdcmd argc  ,
char **  argv
 

Definition at line 311 of file cd.c.

References curdir, getpwd(), out1c, and out1str().

STATIC void updatepwd char *  dir  ) 
 

Definition at line 272 of file cd.c.

References cdcomppath, ckfree, curdir, equal, getcomponent(), hashcd(), NULL, savestr, scopy, stackblock, STACKSTRNUL, stalloc(), STARTSTACKSTR, STPUTC, strlen(), and STUNPUTC.

STATIC void updatepwd  ) 
 

Referenced by docd().


Variable Documentation

STATIC char* cdcomppath
 

Definition at line 73 of file cd.c.

Referenced by getcomponent(), and updatepwd().

char* curdir
 

Definition at line 72 of file cd.c.

Referenced by getpwd(), main(), pwdcmd(), quit(), and updatepwd().

int didudir
 

Definition at line 92 of file expand.c.

Referenced by docd(), expandarg(), and expudir().

char sccsid[] = "@(#)cd.c 5.2 (Berkeley) 3/13/91" [static]
 

Definition at line 38 of file cd.c.


Generated on Fri Apr 14 22:58:29 2006 for minix by  doxygen 1.4.6