Skip to content

Commit

Permalink
Fix control char values for freebsd and linux, #111
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Apr 12, 2017
1 parent 70f1c96 commit 3424a8a
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,25 @@ public FreeBsdNativePty(int master, FileDescriptor masterFD, int slave, FileDesc

// CONSTANTS

private static final int VINTR = 0;
private static final int VQUIT = 1;
private static final int VERASE = 2;
private static final int VKILL = 3;
private static final int VEOF = 4;
private static final int VTIME = 5;
private static final int VMIN = 6;
private static final int VSWTC = 7;
private static final int VSTART = 8;
private static final int VSTOP = 9;
private static final int VEOF = 0;
private static final int VEOL = 1;
private static final int VEOL2 = 2;
private static final int VERASE = 3;
private static final int VWERASE = 4;
private static final int VKILL = 5;
private static final int VREPRINT = 6;
private static final int VERASE2 = 7;
private static final int VINTR = 8;
private static final int VQUIT = 9;
private static final int VSUSP = 10;
private static final int VEOL = 11;
private static final int VREPRINT = 12;
private static final int VDISCARD = 13;
private static final int VWERASE = 14;
private static final int VLNEXT = 15;
private static final int VEOL2 = 16;
private static final int VDSUSP = 11;
private static final int VSTART = 12;
private static final int VSTOP = 13;
private static final int VLNEXT = 14;
private static final int VDISCARD = 15;
private static final int VMIN = 16;
private static final int VTIME = 17;
private static final int VSTATUS = 18;

private static final int IGNBRK = 0x0000001;
private static final int BRKINT = 0x0000002;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,18 @@ public LinuxNativePty(int master, FileDescriptor masterFD, int slave, FileDescri
private static final int VERASE = 2;
private static final int VKILL = 3;
private static final int VEOF = 4;
private static final int VEOL = 5;
private static final int VEOL2 = 6;
private static final int VTIME = 5;
private static final int VMIN = 6;
private static final int VSWTC = 7;
private static final int VSTART = 8;
private static final int VSTOP = 9;
private static final int VSUSP = 10;
private static final int VDSUSP = 11;
private static final int VEOL = 11;
private static final int VREPRINT = 12;
private static final int VDISCARD = 13;
private static final int VWERASE = 14;
private static final int VLNEXT = 15;
private static final int VMIN = VEOF;
private static final int VMAX = VEOL;
private static final int VEOL2 = 16;

private static final int IGNBRK = 0x0000001;
private static final int BRKINT = 0x0000002;
Expand Down Expand Up @@ -230,7 +228,6 @@ protected CLibrary.Termios toTermios(Attributes t) {
tio.c_cc[VINTR] = (byte) t.getControlChar(Attributes.ControlChar.VINTR);
tio.c_cc[VQUIT] = (byte) t.getControlChar(Attributes.ControlChar.VQUIT);
tio.c_cc[VSUSP] = (byte) t.getControlChar(Attributes.ControlChar.VSUSP);
tio.c_cc[VDSUSP] = (byte) t.getControlChar(Attributes.ControlChar.VDSUSP);
tio.c_cc[VSTART] = (byte) t.getControlChar(Attributes.ControlChar.VSTART);
tio.c_cc[VSTOP] = (byte) t.getControlChar(Attributes.ControlChar.VSTOP);
tio.c_cc[VLNEXT] = (byte) t.getControlChar(Attributes.ControlChar.VLNEXT);
Expand Down Expand Up @@ -325,7 +322,6 @@ protected Attributes toAttributes(CLibrary.Termios tio) {
cc.put(Attributes.ControlChar.VINTR, (int) tio.c_cc[VINTR]);
cc.put(Attributes.ControlChar.VQUIT, (int) tio.c_cc[VQUIT]);
cc.put(Attributes.ControlChar.VSUSP, (int) tio.c_cc[VSUSP]);
cc.put(Attributes.ControlChar.VDSUSP, (int) tio.c_cc[VDSUSP]);
cc.put(Attributes.ControlChar.VSTART, (int) tio.c_cc[VSTART]);
cc.put(Attributes.ControlChar.VSTOP, (int) tio.c_cc[VSTOP]);
cc.put(Attributes.ControlChar.VLNEXT, (int) tio.c_cc[VLNEXT]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,23 +252,25 @@ private <T extends Enum<T>> void addFlag(int value, EnumSet<T> flags, T flag, in
int TIOCGWINSZ = 0x40087468;
int TIOCSWINSZ = 0x80087467;

int VINTR = 0;
int VQUIT = 1;
int VERASE = 2;
int VKILL = 3;
int VEOF = 4;
int VTIME = 5;
int VMIN = 6;
int VSWTC = 7;
int VSTART = 8;
int VSTOP = 9;
int VEOF = 0;
int VEOL = 1;
int VEOL2 = 2;
int VERASE = 3;
int VWERASE = 4;
int VKILL = 5;
int VREPRINT = 6;
int VERASE2 = 7;
int VINTR = 8;
int VQUIT = 9;
int VSUSP = 10;
int VEOL = 11;
int VREPRINT = 12;
int VDISCARD = 13;
int VWERASE = 14;
int VLNEXT = 15;
int VEOL2 = 16;
int VDSUSP = 11;
int VSTART = 12;
int VSTOP = 13;
int VLNEXT = 14;
int VDISCARD = 15;
int VMIN = 16;
int VTIME = 17;
int VSTATUS = 18;

int IGNBRK = 0x0000001;
int BRKINT = 0x0000002;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,20 +273,18 @@ private <T extends Enum<T>> void addFlag(int value, EnumSet<T> flags, T flag, in
int VERASE = 2;
int VKILL = 3;
int VEOF = 4;
int VEOL = 5;
int VEOL2 = 6;
int VTIME = 5;
int VMIN = 6;
int VSWTC = 7;
int VSTART = 8;
int VSTOP = 9;
int VSUSP = 10;
int VDSUSP = 11;
int VEOL = 11;
int VREPRINT = 12;
int VDISCARD = 13;
int VWERASE = 14;
int VLNEXT = 15;
int VMIN = VEOF;
int VMAX = VEOL;
int VEOL2 = 16;

int IGNBRK = 0x0000001;
int BRKINT = 0x0000002;
Expand Down

0 comments on commit 3424a8a

Please sign in to comment.