Permalink
Browse files

Run entire source base through GNU indent to tidy up the varying

coding styles of the various contributors! Woohoo!


git-svn-id: svn://svn.tartarus.org/sgt/putty@1098 cda61777-01e9-0310-a592-d414129be87e
  • Loading branch information...
1 parent 01c034a commit 32874aeac8dacbca26663777b39a79efc5d8dc4b simon committed May 6, 2001
Showing with 15,245 additions and 12,559 deletions.
  1. +8 −4 be_nossh.c
  2. +12 −7 int64.c
  3. +133 −127 ldisc.c
  4. +114 −95 misc.c
  5. +1 −1 misc.h
  6. +120 −95 mscrypto.c
  7. +30 −31 network.h
  8. +31 −18 noise.c
  9. +692 −624 pageant.c
  10. +22 −19 pageantc.c
  11. +377 −346 plink.c
  12. +275 −246 psftp.c
  13. +59 −59 putty.h
  14. +486 −456 puttygen.c
  15. +2 −2 puttymem.h
  16. +31 −16 raw.c
  17. +72 −54 rlogin.c
  18. +272 −261 scp.c
  19. +263 −250 settings.c
  20. +88 −54 sftp.c
  21. +29 −27 sftp.h
  22. +103 −98 sizetip.c
  23. +2,074 −1,823 ssh.c
  24. +56 −50 ssh.h
  25. +230 −101 sshaes.c
  26. +111 −88 sshblowf.c
  27. +359 −273 sshbn.c
  28. +25 −22 sshcrc.c
  29. +288 −245 sshdes.c
  30. +14 −7 sshdh.c
  31. +132 −88 sshdss.c
  32. +81 −65 sshmd5.c
  33. +1,165 −625 sshprime.c
  34. +179 −127 sshpubk.c
  35. +40 −33 sshrand.c
  36. +191 −140 sshrsa.c
  37. +24 −17 sshrsag.c
  38. +112 −78 sshsha.c
  39. +526 −491 sshzlib.c
  40. +1 −1 storage.h
  41. +347 −209 telnet.c
  42. +1,373 −1,216 terminal.c
  43. +380 −280 tree234.c
  44. +13 −13 tree234.h
  45. +360 −294 winctrls.c
  46. +1,726 −1,609 windlg.c
  47. +1,400 −1,120 window.c
  48. +325 −259 winnet.c
  49. +197 −165 winstore.c
  50. +15 −19 winstuff.h
  51. +86 −78 x11fwd.c
  52. +195 −133 xlat.c
View
@@ -17,14 +17,18 @@ struct backend_list backends[] = {
/*
* Stub implementations of functions not used in non-ssh versions.
*/
-void random_save_seed(void) {
+void random_save_seed(void)
+{
}
-void random_destroy_seed(void) {
+void random_destroy_seed(void)
+{
}
-void noise_ultralight(DWORD data) {
+void noise_ultralight(DWORD data)
+{
}
-void noise_regular(void) {
+void noise_regular(void)
+{
}
View
19 int64.c
@@ -10,7 +10,8 @@ typedef struct {
unsigned long hi, lo;
} uint64, int64;
-uint64 uint64_div10(uint64 x, int *remainder) {
+uint64 uint64_div10(uint64 x, int *remainder)
+{
uint64 y;
int rem, r2;
y.hi = x.hi / 10;
@@ -30,7 +31,8 @@ uint64 uint64_div10(uint64 x, int *remainder) {
return y;
}
-void uint64_decimal(uint64 x, char *buffer) {
+void uint64_decimal(uint64 x, char *buffer)
+{
char buf[20];
int start = 20;
int d;
@@ -41,24 +43,27 @@ void uint64_decimal(uint64 x, char *buffer) {
buf[--start] = d + '0';
}
- memcpy(buffer, buf+start, sizeof(buf)-start);
- buffer[sizeof(buf)-start] = '\0';
+ memcpy(buffer, buf + start, sizeof(buf) - start);
+ buffer[sizeof(buf) - start] = '\0';
}
-uint64 uint64_make(unsigned long hi, unsigned long lo) {
+uint64 uint64_make(unsigned long hi, unsigned long lo)
+{
uint64 y;
y.hi = hi;
y.lo = lo;
return y;
}
-uint64 uint64_add(uint64 x, uint64 y) {
+uint64 uint64_add(uint64 x, uint64 y)
+{
x.lo += y.lo;
x.hi += y.hi + (x.lo < y.lo ? 1 : 0);
return x;
}
-uint64 uint64_add32(uint64 x, unsigned long y) {
+uint64 uint64_add32(uint64 x, unsigned long y)
+{
uint64 yy;
yy.hi = 0;
yy.lo = y;
View
260 ldisc.c
@@ -18,164 +18,170 @@
(cfg.localedit == LD_BACKEND && \
(back->ldisc(LD_EDIT) || term_ldisc(LD_EDIT))))
-static void c_write (char *buf, int len) {
+static void c_write(char *buf, int len)
+{
from_backend(0, buf, len);
}
static char *term_buf = NULL;
static int term_buflen = 0, term_bufsiz = 0, term_quotenext = 0;
-static int plen(unsigned char c) {
- if ((c >= 32 && c <= 126) ||
- (c >= 160))
- return 1;
+static int plen(unsigned char c)
+{
+ if ((c >= 32 && c <= 126) || (c >= 160))
+ return 1;
else if (c < 128)
- return 2; /* ^x for some x */
+ return 2; /* ^x for some x */
else
- return 4; /* <XY> for hex XY */
+ return 4; /* <XY> for hex XY */
}
-static void pwrite(unsigned char c) {
- if ((c >= 32 && c <= 126) ||
- (c >= 160)) {
- c_write(&c, 1);
+static void pwrite(unsigned char c)
+{
+ if ((c >= 32 && c <= 126) || (c >= 160)) {
+ c_write(&c, 1);
} else if (c < 128) {
- char cc[2];
- cc[1] = (c == 127 ? '?' : c + 0x40);
- cc[0] = '^';
- c_write(cc, 2);
+ char cc[2];
+ cc[1] = (c == 127 ? '?' : c + 0x40);
+ cc[0] = '^';
+ c_write(cc, 2);
} else {
- char cc[5];
- sprintf(cc, "<%02X>", c);
- c_write(cc, 4);
+ char cc[5];
+ sprintf(cc, "<%02X>", c);
+ c_write(cc, 4);
}
}
-static void bsb(int n) {
+static void bsb(int n)
+{
while (n--)
c_write("\010 \010", 3);
}
#define CTRL(x) (x^'@')
-void ldisc_send(char *buf, int len) {
+void ldisc_send(char *buf, int len)
+{
/*
* Called with len=0 when the options change. We must inform
* the front end in case it needs to know.
*/
if (len == 0) {
- void ldisc_update(int echo, int edit);
- ldisc_update(ECHOING, EDITING);
+ void ldisc_update(int echo, int edit);
+ ldisc_update(ECHOING, EDITING);
}
/*
* Either perform local editing, or just send characters.
*/
if (EDITING) {
- while (len--) {
- char c;
- c = *buf++;
- switch (term_quotenext ? ' ' : c) {
- /*
- * ^h/^?: delete one char and output one BSB
- * ^w: delete, and output BSBs, to return to last
- * space/nonspace boundary
- * ^u: delete, and output BSBs, to return to BOL
- * ^c: Do a ^u then send a telnet IP
- * ^z: Do a ^u then send a telnet SUSP
- * ^\: Do a ^u then send a telnet ABORT
- * ^r: echo "^R\n" and redraw line
- * ^v: quote next char
- * ^d: if at BOL, end of file and close connection,
- * else send line and reset to BOL
- * ^m: send line-plus-\r\n and reset to BOL
- */
- case CTRL('H'): case CTRL('?'): /* backspace/delete */
- if (term_buflen > 0) {
- if (ECHOING)
- bsb(plen(term_buf[term_buflen-1]));
- term_buflen--;
- }
- break;
- case CTRL('W'): /* delete word */
- while (term_buflen > 0) {
- if (ECHOING)
- bsb(plen(term_buf[term_buflen-1]));
- term_buflen--;
- if (term_buflen > 0 &&
- isspace(term_buf[term_buflen-1]) &&
- !isspace(term_buf[term_buflen]))
- break;
- }
- break;
- case CTRL('U'): /* delete line */
- case CTRL('C'): /* Send IP */
- case CTRL('\\'): /* Quit */
- case CTRL('Z'): /* Suspend */
- while (term_buflen > 0) {
- if (ECHOING)
- bsb(plen(term_buf[term_buflen-1]));
- term_buflen--;
- }
- back->special (TS_EL);
- if( c == CTRL('C') ) back->special (TS_IP);
- if( c == CTRL('Z') ) back->special (TS_SUSP);
- if( c == CTRL('\\') ) back->special (TS_ABORT);
- break;
- case CTRL('R'): /* redraw line */
- if (ECHOING) {
- int i;
- c_write("^R\r\n", 4);
- for (i = 0; i < term_buflen; i++)
- pwrite(term_buf[i]);
- }
- break;
- case CTRL('V'): /* quote next char */
- term_quotenext = TRUE;
- break;
- case CTRL('D'): /* logout or send */
- if (term_buflen == 0) {
- back->special (TS_EOF);
- } else {
- back->send(term_buf, term_buflen);
- term_buflen = 0;
- }
- break;
- case CTRL('M'): /* send with newline */
- if (term_buflen > 0)
- back->send(term_buf, term_buflen);
- if (cfg.protocol == PROT_RAW)
- back->send("\r\n", 2);
- else
- back->send("\r", 1);
- if (ECHOING)
- c_write("\r\n", 2);
- term_buflen = 0;
- break;
- default: /* get to this label from ^V handler */
- if (term_buflen >= term_bufsiz) {
- term_bufsiz = term_buflen + 256;
- term_buf = saferealloc(term_buf, term_bufsiz);
- }
- term_buf[term_buflen++] = c;
- if (ECHOING)
- pwrite(c);
- term_quotenext = FALSE;
- break;
- }
- }
+ while (len--) {
+ char c;
+ c = *buf++;
+ switch (term_quotenext ? ' ' : c) {
+ /*
+ * ^h/^?: delete one char and output one BSB
+ * ^w: delete, and output BSBs, to return to last
+ * space/nonspace boundary
+ * ^u: delete, and output BSBs, to return to BOL
+ * ^c: Do a ^u then send a telnet IP
+ * ^z: Do a ^u then send a telnet SUSP
+ * ^\: Do a ^u then send a telnet ABORT
+ * ^r: echo "^R\n" and redraw line
+ * ^v: quote next char
+ * ^d: if at BOL, end of file and close connection,
+ * else send line and reset to BOL
+ * ^m: send line-plus-\r\n and reset to BOL
+ */
+ case CTRL('H'):
+ case CTRL('?'): /* backspace/delete */
+ if (term_buflen > 0) {
+ if (ECHOING)
+ bsb(plen(term_buf[term_buflen - 1]));
+ term_buflen--;
+ }
+ break;
+ case CTRL('W'): /* delete word */
+ while (term_buflen > 0) {
+ if (ECHOING)
+ bsb(plen(term_buf[term_buflen - 1]));
+ term_buflen--;
+ if (term_buflen > 0 &&
+ isspace(term_buf[term_buflen - 1]) &&
+ !isspace(term_buf[term_buflen]))
+ break;
+ }
+ break;
+ case CTRL('U'): /* delete line */
+ case CTRL('C'): /* Send IP */
+ case CTRL('\\'): /* Quit */
+ case CTRL('Z'): /* Suspend */
+ while (term_buflen > 0) {
+ if (ECHOING)
+ bsb(plen(term_buf[term_buflen - 1]));
+ term_buflen--;
+ }
+ back->special(TS_EL);
+ if (c == CTRL('C'))
+ back->special(TS_IP);
+ if (c == CTRL('Z'))
+ back->special(TS_SUSP);
+ if (c == CTRL('\\'))
+ back->special(TS_ABORT);
+ break;
+ case CTRL('R'): /* redraw line */
+ if (ECHOING) {
+ int i;
+ c_write("^R\r\n", 4);
+ for (i = 0; i < term_buflen; i++)
+ pwrite(term_buf[i]);
+ }
+ break;
+ case CTRL('V'): /* quote next char */
+ term_quotenext = TRUE;
+ break;
+ case CTRL('D'): /* logout or send */
+ if (term_buflen == 0) {
+ back->special(TS_EOF);
+ } else {
+ back->send(term_buf, term_buflen);
+ term_buflen = 0;
+ }
+ break;
+ case CTRL('M'): /* send with newline */
+ if (term_buflen > 0)
+ back->send(term_buf, term_buflen);
+ if (cfg.protocol == PROT_RAW)
+ back->send("\r\n", 2);
+ else
+ back->send("\r", 1);
+ if (ECHOING)
+ c_write("\r\n", 2);
+ term_buflen = 0;
+ break;
+ default: /* get to this label from ^V handler */
+ if (term_buflen >= term_bufsiz) {
+ term_bufsiz = term_buflen + 256;
+ term_buf = saferealloc(term_buf, term_bufsiz);
+ }
+ term_buf[term_buflen++] = c;
+ if (ECHOING)
+ pwrite(c);
+ term_quotenext = FALSE;
+ break;
+ }
+ }
} else {
- if( term_buflen != 0 )
- {
- back->send(term_buf, term_buflen);
- while (term_buflen > 0) {
- bsb(plen(term_buf[term_buflen-1]));
- term_buflen--;
- }
- }
- if (len > 0) {
- if (ECHOING)
- c_write(buf, len);
- back->send(buf, len);
- }
+ if (term_buflen != 0) {
+ back->send(term_buf, term_buflen);
+ while (term_buflen > 0) {
+ bsb(plen(term_buf[term_buflen - 1]));
+ term_buflen--;
+ }
+ }
+ if (len > 0) {
+ if (ECHOING)
+ c_write(buf, len);
+ back->send(buf, len);
+ }
}
}
Oops, something went wrong.

0 comments on commit 32874ae

Please sign in to comment.