summaryrefslogtreecommitdiff
path: root/package/sash/src/sash.h
blob: eb2321fa06ee44a88e809ccffd5d2a5df455b778 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 * Copyright (c) 1993 by David I. Bell
 * Permission is granted to use, distribute, or modify this source,
 * provided that this copyright notice remains intact.
 *
 * Definitions for stand-alone shell for system maintainance for Linux.
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <ctype.h>

#define	PATHLEN		256	
#define	CMDLEN		1024
#define	MAXARGS		50	
#define	ALIASALLOC	20
#define	STDIN		0
#define	STDOUT		1
#define	MAXSOURCE	10
#ifdef COMMAND_HISTORY
#define HISTORY_SIZE	20	/* Number of entries in command history */
#endif

#ifndef	isblank
#define	isblank(ch)	(((ch) == ' ') || ((ch) == '\t'))
#endif

#define	isquote(ch)	(((ch) == '"') || ((ch) == '\''))
#define	isdecimal(ch)	(((ch) >= '0') && ((ch) <= '9'))
#define	isoctal(ch)	(((ch) >= '0') && ((ch) <= '7'))


typedef	int	BOOL;

#define	FALSE	((BOOL) 0)
#define	TRUE	((BOOL) 1)


extern	void	do_alias(), do_cd(), do_exec(), do_exit(), do_prompt();
extern	void	do_source(), do_umask(), do_unalias(), do_help(), do_ln();
extern	void	do_cp(), do_mv(), do_rm(), do_chmod(), do_mkdir(), do_rmdir();
extern	void	do_mknod(), do_chown(), do_chgrp(), do_sync(), do_printenv();
extern	void	do_more(), do_cmp(), do_touch(), do_ls(), do_dd(), do_tar();
extern	void	do_mount(), do_umount(), do_setenv(), do_pwd(), do_echo();
extern	void	do_kill(), do_grep(), do_ed(), do_hexdump(), do_pid();
extern	void	do_df(), do_ps(), do_reboot(), do_cat(), do_time(), do_free();
extern	void	do_hostname(), do_sleep();
extern	void	do_date();


extern	char	*buildname();
extern	char	*modestring();
extern	char	*timestring();
extern	BOOL	isadir();
extern	BOOL	copyfile();
extern	BOOL	match();
extern	BOOL	makestring();
extern	BOOL	makeargs();
extern	int	expandwildcards();
extern	int	namesort();
extern	char	*getchunk();
extern	void	freechunks();
extern	char	*expandenvvar();

extern	BOOL	intflag;
extern	int	exit_code;

/* END CODE */