Skip to content

Commit

Permalink
Add seq, more uniq options, and version.h changes.
Browse files Browse the repository at this point in the history
This brings swiss up to date with OS change
9124ccb935d5ba86680f05c0fd6250fb3ef518a9.

It adds the seq utility, adds some additional options to the uniq utility,
and incorporates the new version.h scheme from OS. Currently in this repo
version.h is static, since it really reflects a snapshot from the Minoca
OS repository. This seems more straightforward than diverging version
numbers for different repos.
  • Loading branch information
evangreen committed May 18, 2016
1 parent 6226f3e commit 289a93d
Show file tree
Hide file tree
Showing 81 changed files with 880 additions and 169 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ sources text=auto whitespace=trailing-space,space-before-tab
*.y text=auto whitespace=trailing-space,space-before-tab,tab-in-indent
*.l text=auto whitespace=trailing-space,space-before-tab,tab-in-indent
common text=auto whitespace=trailing-space,space-before-tab
*.bin binary
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ BUILD_STRING ?= "($(USERNAME))"
## Includes directory.
##

INCLUDES += $(SRCROOT)/include;$(SRCROOT)/rtl;
INCLUDES += $(SRCROOT)/include;$(SRCROOT)/rtl;$(SRCROOT)/src;
ifeq ($(OS),Windows_NT)
INCLUDES += $(SRCROOT)/libc/wincsup/include
endif
Expand Down Expand Up @@ -291,6 +291,7 @@ SWISS_COMMON_OBJS := \
$(SWISS)/sed/sedfunc.o \
$(SWISS)/sed/sedparse.o \
$(SWISS)/sed/sedutil.o \
$(SWISS)/seq.o \
$(SWISS)/sh/alias.o \
$(SWISS)/sh/arith.o \
$(SWISS)/sh/builtin.o \
Expand Down
1 change: 1 addition & 0 deletions include/minoca/kernel/arm.inc
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Environment:
#define ARM_MODE_IRQ 0x00000012
#define ARM_MODE_SVC 0x00000013
#define ARM_MODE_ABORT 0x00000017
#define ARM_MODE_HYP 0x0000001A
#define ARM_MODE_UNDEF 0x0000001B
#define ARM_MODE_SYSTEM 0x0000001F
#define ARM_MODE_MASK 0x0000001F
Expand Down
1 change: 1 addition & 0 deletions include/minoca/lib/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ Module Name:
#define STATUS_DOMAIN_NOT_SUPPORTED 0x8000006B
#define STATUS_PROTOCOL_NOT_SUPPORTED 0x8000006C
#define STATUS_DOMAIN_ERROR 0x8000006D
#define STATUS_MEDIA_CHANGED 0x8000006E

//
// ------------------------------------------------------ Data Type Definitions
Expand Down
3 changes: 3 additions & 0 deletions include/minoca/lib/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ Module Name:
#define PACKED __attribute__((__packed__))
#define NO_RETURN __attribute__((__noreturn__))
#define ALIGNED(_Alignment) __attribute__((aligned(_Alignment)))
#define ALIGNED16 ALIGNED(16)
#define ALIGNED32 ALIGNED(32)
#define ALIGNED64 ALIGNED(64)

//
// Error out if the architecture is unknown.
Expand Down
5 changes: 1 addition & 4 deletions src/basename.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,7 @@ Return Value:

switch (Option) {
case 'V':
SwPrintVersion(BASENAME_VERSION_MAJOR,
BASENAME_VERSION_MINOR,
REVISION);

SwPrintVersion(BASENAME_VERSION_MAJOR, BASENAME_VERSION_MINOR);
return 1;

case 'h':
Expand Down
2 changes: 1 addition & 1 deletion src/cat.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(CAT_VERSION_MAJOR, CAT_VERSION_MINOR, REVISION);
SwPrintVersion(CAT_VERSION_MAJOR, CAT_VERSION_MINOR);
return 1;

case 'h':
Expand Down
2 changes: 1 addition & 1 deletion src/chown.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(CHOWN_VERSION_MAJOR, CHOWN_VERSION_MINOR, REVISION);
SwPrintVersion(CHOWN_VERSION_MAJOR, CHOWN_VERSION_MINOR);
return 1;

case 'e':
Expand Down
5 changes: 1 addition & 4 deletions src/chroot.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(CHROOT_VERSION_MAJOR,
CHROOT_VERSION_MINOR,
REVISION);

SwPrintVersion(CHROOT_VERSION_MAJOR, CHROOT_VERSION_MINOR);
return 1;

case 'h':
Expand Down
1 change: 1 addition & 0 deletions src/cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ SWISS_COMMAND_ENTRY SwissCommands[] = {
{TELNETD_COMMAND_NAME, TELNETD_COMMAND_DESCRIPTION, TelnetdMain, 0},
{TELNET_COMMAND_NAME, TELNET_COMMAND_DESCRIPTION, TelnetMain, 0},
{NPROC_COMMAND_NAME, NPROC_COMMAND_DESCRIPTION, NprocMain, 0},
{SEQ_COMMAND_NAME, SEQ_COMMAND_DESCRIPTION, SeqMain, 0},
{NULL, NULL, NULL, 0},
};

Expand Down
2 changes: 1 addition & 1 deletion src/cmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(CMP_VERSION_MAJOR, CMP_VERSION_MINOR, REVISION);
SwPrintVersion(CMP_VERSION_MAJOR, CMP_VERSION_MINOR);
return 2;

case 'h':
Expand Down
2 changes: 1 addition & 1 deletion src/comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(COMM_VERSION_MAJOR, COMM_VERSION_MINOR, REVISION);
SwPrintVersion(COMM_VERSION_MAJOR, COMM_VERSION_MINOR);
return 1;

case 'h':
Expand Down
2 changes: 1 addition & 1 deletion src/cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(CP_VERSION_MAJOR, CP_VERSION_MINOR, REVISION);
SwPrintVersion(CP_VERSION_MAJOR, CP_VERSION_MINOR);
return 1;

case 'h':
Expand Down
2 changes: 1 addition & 1 deletion src/cut.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(CUT_VERSION_MAJOR, CUT_VERSION_MINOR, REVISION);
SwPrintVersion(CUT_VERSION_MAJOR, CUT_VERSION_MINOR);
return 1;

case 'h':
Expand Down
2 changes: 1 addition & 1 deletion src/date.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(DATE_VERSION_MAJOR, DATE_VERSION_MINOR, REVISION);
SwPrintVersion(DATE_VERSION_MAJOR, DATE_VERSION_MINOR);
return 1;

case 'h':
Expand Down
2 changes: 1 addition & 1 deletion src/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ Return Value:

switch (Option) {
case 'V':
SwPrintVersion(DD_VERSION_MAJOR, DD_VERSION_MINOR, REVISION);
SwPrintVersion(DD_VERSION_MAJOR, DD_VERSION_MINOR);
return 1;

case 'h':
Expand Down
2 changes: 1 addition & 1 deletion src/diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(DIFF_VERSION_MAJOR, DIFF_VERSION_MINOR, REVISION);
SwPrintVersion(DIFF_VERSION_MAJOR, DIFF_VERSION_MINOR);
return 1;

case 'h':
Expand Down
5 changes: 1 addition & 4 deletions src/dirname.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ Return Value:
return 1;

} else if (strcmp(Argument, "-version") == 0) {
SwPrintVersion(DIRNAME_VERSION_MAJOR,
DIRNAME_VERSION_MINOR,
REVISION);

SwPrintVersion(DIRNAME_VERSION_MAJOR, DIRNAME_VERSION_MINOR);
return 1;

} else if (strcmp(Argument, "-") == 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/easy.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Return Value:
}

if (strcmp(Arguments[1], "--version") == 0) {
SwPrintVersion(SLEEP_VERSION_MAJOR, SLEEP_VERSION_MINOR, REVISION);
SwPrintVersion(SLEEP_VERSION_MAJOR, SLEEP_VERSION_MINOR);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion src/env.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(ENV_VERSION_MAJOR, ENV_VERSION_MINOR, REVISION);
SwPrintVersion(ENV_VERSION_MAJOR, ENV_VERSION_MINOR);
return 1;

case 'h':
Expand Down
2 changes: 1 addition & 1 deletion src/find.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ Return Value:
INT Result;

if ((ArgumentCount > 1) && (strcmp(Arguments[1], "--version") == 0)) {
SwPrintVersion(FIND_VERSION_MAJOR, FIND_VERSION_MINOR, REVISION);
SwPrintVersion(FIND_VERSION_MAJOR, FIND_VERSION_MINOR);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion src/grep.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(GREP_VERSION_MAJOR, GREP_VERSION_MINOR, REVISION);
SwPrintVersion(GREP_VERSION_MAJOR, GREP_VERSION_MINOR);
return 1;

case 'h':
Expand Down
5 changes: 1 addition & 4 deletions src/head.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(HEAD_VERSION_MAJOR,
HEAD_VERSION_MINOR,
REVISION);

SwPrintVersion(HEAD_VERSION_MAJOR, HEAD_VERSION_MINOR);
return 1;

case 'h':
Expand Down
2 changes: 1 addition & 1 deletion src/id.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(ID_VERSION_MAJOR, ID_VERSION_MINOR, REVISION);
SwPrintVersion(ID_VERSION_MAJOR, ID_VERSION_MINOR);
return 1;

case 'h':
Expand Down
4 changes: 2 additions & 2 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(INIT_VERSION_MAJOR, INIT_VERSION_MINOR, REVISION);
SwPrintVersion(INIT_VERSION_MAJOR, INIT_VERSION_MINOR);
return 1;

case 'h':
Expand Down Expand Up @@ -518,7 +518,7 @@ Return Value:
"Minoca init v%d.%d.%d",
INIT_VERSION_MAJOR,
INIT_VERSION_MINOR,
REVISION);
SwGetSerialVersion());

Status = 0;

Expand Down
5 changes: 1 addition & 4 deletions src/install.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(INSTALL_VERSION_MAJOR,
INSTALL_VERSION_MINOR,
REVISION);

SwPrintVersion(INSTALL_VERSION_MAJOR, INSTALL_VERSION_MINOR);
return 1;

case 'h':
Expand Down
2 changes: 1 addition & 1 deletion src/kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(KILL_VERSION_MAJOR, KILL_VERSION_MINOR, REVISION);
SwPrintVersion(KILL_VERSION_MAJOR, KILL_VERSION_MINOR);
return 1;

case 'h':
Expand Down
2 changes: 1 addition & 1 deletion src/ln.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(LN_VERSION_MAJOR, LN_VERSION_MINOR, REVISION);
SwPrintVersion(LN_VERSION_MAJOR, LN_VERSION_MINOR);
return 1;

case 'h':
Expand Down
5 changes: 1 addition & 4 deletions src/login/chpasswd.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(CHPASSWD_VERSION_MAJOR,
CHPASSWD_VERSION_MINOR,
REVISION);

SwPrintVersion(CHPASSWD_VERSION_MAJOR, CHPASSWD_VERSION_MINOR);
return 1;

case 'H':
Expand Down
2 changes: 1 addition & 1 deletion src/login/getty.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(GETTY_VERSION_MAJOR, GETTY_VERSION_MINOR, REVISION);
SwPrintVersion(GETTY_VERSION_MAJOR, GETTY_VERSION_MINOR);
return 1;

case 'h':
Expand Down
5 changes: 1 addition & 4 deletions src/login/groupadd.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(GROUPADD_VERSION_MAJOR,
GROUPADD_VERSION_MINOR,
REVISION);

SwPrintVersion(GROUPADD_VERSION_MAJOR, GROUPADD_VERSION_MINOR);
return 1;

case 'H':
Expand Down
5 changes: 1 addition & 4 deletions src/login/groupdel.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(GROUPDEL_VERSION_MAJOR,
GROUPDEL_VERSION_MINOR,
REVISION);

SwPrintVersion(GROUPDEL_VERSION_MAJOR, GROUPDEL_VERSION_MINOR);
return 1;

case 'H':
Expand Down
2 changes: 1 addition & 1 deletion src/login/login.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(LOGIN_VERSION_MAJOR, LOGIN_VERSION_MINOR, REVISION);
SwPrintVersion(LOGIN_VERSION_MAJOR, LOGIN_VERSION_MINOR);
return 1;

case 'H':
Expand Down
5 changes: 1 addition & 4 deletions src/login/passwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(PASSWD_VERSION_MAJOR,
PASSWD_VERSION_MINOR,
REVISION);

SwPrintVersion(PASSWD_VERSION_MAJOR, PASSWD_VERSION_MINOR);
return 1;

case 'H':
Expand Down
2 changes: 1 addition & 1 deletion src/login/su.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(SU_VERSION_MAJOR, SU_VERSION_MINOR, REVISION);
SwPrintVersion(SU_VERSION_MAJOR, SU_VERSION_MINOR);
return 1;

case 'H':
Expand Down
5 changes: 1 addition & 4 deletions src/login/sulogin.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(SULOGIN_VERSION_MAJOR,
SULOGIN_VERSION_MINOR,
REVISION);

SwPrintVersion(SULOGIN_VERSION_MAJOR, SULOGIN_VERSION_MINOR);
return 1;

case 'H':
Expand Down
5 changes: 1 addition & 4 deletions src/login/useradd.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(USERADD_VERSION_MAJOR,
USERADD_VERSION_MINOR,
REVISION);

SwPrintVersion(USERADD_VERSION_MAJOR, USERADD_VERSION_MINOR);
return 1;

case 'H':
Expand Down
5 changes: 1 addition & 4 deletions src/login/userdel.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,7 @@ Return Value:
break;

case 'V':
SwPrintVersion(USERDEL_VERSION_MAJOR,
USERDEL_VERSION_MINOR,
REVISION);

SwPrintVersion(USERDEL_VERSION_MAJOR, USERDEL_VERSION_MINOR);
return 1;

case 'H':
Expand Down
Loading

0 comments on commit 289a93d

Please sign in to comment.