morse.c (203932) | morse.c (221907) |
---|---|
1/* 2 * Copyright (c) 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 29 unchanged lines hidden (view full) --- 38 The Regents of the University of California. All rights reserved.\n"; 39#endif /* not lint */ 40 41#ifndef lint 42#if 0 43static char sccsid[] = "@(#)morse.c 8.1 (Berkeley) 5/31/93"; 44#endif 45static const char rcsid[] = | 1/* 2 * Copyright (c) 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 29 unchanged lines hidden (view full) --- 38 The Regents of the University of California. All rights reserved.\n"; 39#endif /* not lint */ 40 41#ifndef lint 42#if 0 43static char sccsid[] = "@(#)morse.c 8.1 (Berkeley) 5/31/93"; 44#endif 45static const char rcsid[] = |
46 "$FreeBSD: head/games/morse/morse.c 203932 2010-02-15 18:46:02Z imp $"; | 46 "$FreeBSD: head/games/morse/morse.c 221907 2011-05-14 19:03:30Z uqs $"; |
47#endif /* not lint */ 48 49#include <sys/time.h> 50 51#include <ctype.h> 52#include <fcntl.h> 53#include <langinfo.h> 54#include <locale.h> --- 101 unchanged lines hidden (view full) --- 156 {'�', "---."}, 157 {'�', "..--"}, 158 159 {'\0', ""} 160}; 161 162static const struct morsetab iso8859_7tab[] = { 163 /* | 47#endif /* not lint */ 48 49#include <sys/time.h> 50 51#include <ctype.h> 52#include <fcntl.h> 53#include <langinfo.h> 54#include <locale.h> --- 101 unchanged lines hidden (view full) --- 156 {'�', "---."}, 157 {'�', "..--"}, 158 159 {'\0', ""} 160}; 161 162static const struct morsetab iso8859_7tab[] = { 163 /* |
164 * The greek alphabet; you'll need an 8859-7 font in order | 164 * The Greek alphabet; you'll need an ISO8859-7 font in order |
165 * to see the actual characters. 166 * This table does not implement: 167 * - the special sequences for the seven diphthongs, 168 * - the punctuation differences. 169 * Implementing these features would introduce too many 170 * special-cases in the program's main loop. | 165 * to see the actual characters. 166 * This table does not implement: 167 * - the special sequences for the seven diphthongs, 168 * - the punctuation differences. 169 * Implementing these features would introduce too many 170 * special-cases in the program's main loop. |
171 * The diphtong sequences are: | 171 * The diphthong sequences are: |
172 * alpha iota .-.- 173 * alpha upsilon ..-- 174 * epsilon upsilon ---. 175 * eta upsilon ...- | 172 * alpha iota .-.- 173 * alpha upsilon ..-- 174 * epsilon upsilon ---. 175 * eta upsilon ...- |
176 * omikron iota ---.. 177 * omikron upsilon ..- | 176 * omicron iota ---.. 177 * omicron upsilon ..- |
178 * upsilon iota .--- 179 * The different punctuation symbols are: 180 * ; ..-.- 181 * ! --..-- 182 */ 183 {'�', ".-"}, /* alpha */ 184 {'�', ".-"}, /* alpha with acute */ 185 {'�', "-..."}, /* beta */ 186 {'�', "--."}, /* gamma */ 187 {'�', "-.."}, /* delta */ 188 {'�', "."}, /* epsilon */ 189 {'�', "."}, /* epsilon with acute */ 190 {'�', "--.."}, /* zeta */ 191 {'�', "...."}, /* eta */ 192 {'�', "...."}, /* eta with acute */ 193 {'�', "-.-."}, /* theta */ 194 {'�', ".."}, /* iota */ 195 {'�', ".."}, /* iota with acute */ | 178 * upsilon iota .--- 179 * The different punctuation symbols are: 180 * ; ..-.- 181 * ! --..-- 182 */ 183 {'�', ".-"}, /* alpha */ 184 {'�', ".-"}, /* alpha with acute */ 185 {'�', "-..."}, /* beta */ 186 {'�', "--."}, /* gamma */ 187 {'�', "-.."}, /* delta */ 188 {'�', "."}, /* epsilon */ 189 {'�', "."}, /* epsilon with acute */ 190 {'�', "--.."}, /* zeta */ 191 {'�', "...."}, /* eta */ 192 {'�', "...."}, /* eta with acute */ 193 {'�', "-.-."}, /* theta */ 194 {'�', ".."}, /* iota */ 195 {'�', ".."}, /* iota with acute */ |
196 {'�', ".."}, /* iota with diairesis */ 197 {'�', ".."}, /* iota with acute and diairesis */ | 196 {'�', ".."}, /* iota with diaeresis */ 197 {'�', ".."}, /* iota with acute and diaeresis */ |
198 {'�', "-.-"}, /* kappa */ | 198 {'�', "-.-"}, /* kappa */ |
199 {'�', ".-.."}, /* lamda */ | 199 {'�', ".-.."}, /* lambda */ |
200 {'�', "--"}, /* mu */ 201 {'�', "-."}, /* nu */ 202 {'�', "-..-"}, /* xi */ 203 {'�', "---"}, /* omicron */ 204 {'�', "---"}, /* omicron with acute */ 205 {'�', ".--."}, /* pi */ 206 {'�', ".-."}, /* rho */ 207 {'�', "..."}, /* sigma */ 208 {'�', "..."}, /* final sigma */ 209 {'�', "-"}, /* tau */ 210 {'�', "-.--"}, /* upsilon */ 211 {'�', "-.--"}, /* upsilon with acute */ | 200 {'�', "--"}, /* mu */ 201 {'�', "-."}, /* nu */ 202 {'�', "-..-"}, /* xi */ 203 {'�', "---"}, /* omicron */ 204 {'�', "---"}, /* omicron with acute */ 205 {'�', ".--."}, /* pi */ 206 {'�', ".-."}, /* rho */ 207 {'�', "..."}, /* sigma */ 208 {'�', "..."}, /* final sigma */ 209 {'�', "-"}, /* tau */ 210 {'�', "-.--"}, /* upsilon */ 211 {'�', "-.--"}, /* upsilon with acute */ |
212 {'�', "-.--"}, /* upsilon and diairesis */ 213 {'�', "-.--"}, /* upsilon with acute and diairesis */ | 212 {'�', "-.--"}, /* upsilon and diaeresis */ 213 {'�', "-.--"}, /* upsilon with acute and diaeresis */ |
214 {'�', "..-."}, /* phi */ 215 {'�', "----"}, /* chi */ 216 {'�', "--.-"}, /* psi */ 217 {'�', ".--"}, /* omega */ 218 {'�', ".--"}, /* omega with acute */ 219 220 {'\0', ""} 221}; 222 223static const struct morsetab koi8rtab[] = { 224 /* | 214 {'�', "..-."}, /* phi */ 215 {'�', "----"}, /* chi */ 216 {'�', "--.-"}, /* psi */ 217 {'�', ".--"}, /* omega */ 218 {'�', ".--"}, /* omega with acute */ 219 220 {'\0', ""} 221}; 222 223static const struct morsetab koi8rtab[] = { 224 /* |
225 * the cyrillic alphabet; you'll need a KOI8R font in order | 225 * The Cyrillic alphabet; you'll need a KOI8-R font in order |
226 * to see the actual characters 227 */ | 226 * to see the actual characters 227 */ |
228 {'�', ".-"}, /* a */ | 228 {'�', ".-"}, /* a */ |
229 {'�', "-..."}, /* be */ 230 {'�', ".--"}, /* ve */ 231 {'�', "--."}, /* ge */ 232 {'�', "-.."}, /* de */ | 229 {'�', "-..."}, /* be */ 230 {'�', ".--"}, /* ve */ 231 {'�', "--."}, /* ge */ 232 {'�', "-.."}, /* de */ |
233 {'�', "."}, /* ye */ 234 {'�', "."}, /* yo, the same as ye */ | 233 {'�', "."}, /* ye */ 234 {'�', "."}, /* yo, the same as ye */ |
235 {'�', "...-"}, /* she */ 236 {'�', "--.."}, /* ze */ | 235 {'�', "...-"}, /* she */ 236 {'�', "--.."}, /* ze */ |
237 {'�', ".."}, /* i */ | 237 {'�', ".."}, /* i */ |
238 {'�', ".---"}, /* i kratkoye */ 239 {'�', "-.-"}, /* ka */ 240 {'�', ".-.."}, /* el */ | 238 {'�', ".---"}, /* i kratkoye */ 239 {'�', "-.-"}, /* ka */ 240 {'�', ".-.."}, /* el */ |
241 {'�', "--"}, /* em */ 242 {'�', "-."}, /* en */ | 241 {'�', "--"}, /* em */ 242 {'�', "-."}, /* en */ |
243 {'�', "---"}, /* o */ 244 {'�', ".--."}, /* pe */ 245 {'�', ".-."}, /* er */ 246 {'�', "..."}, /* es */ | 243 {'�', "---"}, /* o */ 244 {'�', ".--."}, /* pe */ 245 {'�', ".-."}, /* er */ 246 {'�', "..."}, /* es */ |
247 {'�', "-"}, /* te */ | 247 {'�', "-"}, /* te */ |
248 {'�', "..-"}, /* u */ 249 {'�', "..-."}, /* ef */ 250 {'�', "...."}, /* kha */ 251 {'�', "-.-."}, /* ce */ 252 {'�', "---."}, /* che */ 253 {'�', "----"}, /* sha */ 254 {'�', "--.-"}, /* shcha */ 255 {'�', "-.--"}, /* yi */ --- 44 unchanged lines hidden (view full) --- 300int 301main(int argc, char **argv) 302{ 303 int ch, lflags; 304 char *p, *codeset; 305 306 while ((ch = getopt(argc, argv, GETOPTOPTS)) != -1) 307 switch ((char) ch) { | 248 {'�', "..-"}, /* u */ 249 {'�', "..-."}, /* ef */ 250 {'�', "...."}, /* kha */ 251 {'�', "-.-."}, /* ce */ 252 {'�', "---."}, /* che */ 253 {'�', "----"}, /* sha */ 254 {'�', "--.-"}, /* shcha */ 255 {'�', "-.--"}, /* yi */ --- 44 unchanged lines hidden (view full) --- 300int 301main(int argc, char **argv) 302{ 303 int ch, lflags; 304 char *p, *codeset; 305 306 while ((ch = getopt(argc, argv, GETOPTOPTS)) != -1) 307 switch ((char) ch) { |
308 case 'c': 309 cpm = atoi(optarg); 310 break; | 308 case 'c': 309 cpm = atoi(optarg); 310 break; |
311 case 'd': 312 device = optarg; 313 break; 314 case 'e': 315 eflag = 1; 316 setvbuf(stdout, 0, _IONBF, 0); 317 break; 318 case 'f': --- 266 unchanged lines hidden --- | 311 case 'd': 312 device = optarg; 313 break; 314 case 'e': 315 eflag = 1; 316 setvbuf(stdout, 0, _IONBF, 0); 317 break; 318 case 'f': --- 266 unchanged lines hidden --- |