diff options
author | B. Watson <yalhcru@gmail.com> | 2019-03-13 02:50:42 -0400 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2019-03-13 02:50:42 -0400 |
commit | 2973d0c78e9b8eed3c5af239927c6bd36af64604 (patch) | |
tree | a0fdfe7201303edd11c6d86015ef4f79796fcf0f /src/col80_modified/icet_to_col80.c | |
download | fujichat-2973d0c78e9b8eed3c5af239927c6bd36af64604.tar.gz |
initial commit
Diffstat (limited to 'src/col80_modified/icet_to_col80.c')
-rw-r--r-- | src/col80_modified/icet_to_col80.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/col80_modified/icet_to_col80.c b/src/col80_modified/icet_to_col80.c new file mode 100644 index 0000000..aa07223 --- /dev/null +++ b/src/col80_modified/icet_to_col80.c @@ -0,0 +1,26 @@ +#include <stdio.h> + +int main(int argc, char **argv) { + int c, d, byte = 0; + char out[8]; + + do { + c = getchar(); + if(byte == 16) { + for(byte = 0; byte < 8; ++byte) + putchar(out[byte]); + + byte = 0; + } + + if(c != EOF) { + if(byte < 8) { + out[byte] = (c & 0xf0); + ++byte; + } else if(byte < 16) { + out[byte - 8] |= (c & 0x0f); + ++byte; + } + } + } while(c != EOF); +} |