Mercurial > ecos-v3_0-branch
comparison packages/cygmon/current/misc/ledit.c @ 112:02ea4320376c ecos-sw-2000-07-21
Merge from eCos master repository on 2000-07-21-21:01:39-BST
| author | jlarmour |
|---|---|
| date | Fri, 21 Jul 2000 21:34:11 +0000 |
| parents | 435cced73e2f |
| children | e0c0827131d1 |
comparison
equal
deleted
inserted
replaced
| 111:211b8a635ce9 | 112:02ea4320376c |
|---|---|
| 122 } | 122 } |
| 123 | 123 |
| 124 static void | 124 static void |
| 125 outputParamStr (char *str, int val) | 125 outputParamStr (char *str, int val) |
| 126 { | 126 { |
| 127 char *i = index (str, '%'); | 127 char *i = strchr (str, '%'); |
| 128 char *ptr; | 128 char *ptr; |
| 129 int dist = val; | 129 int dist = val; |
| 130 | 130 |
| 131 if (i == NULL) | 131 if (i == NULL) |
| 132 { | 132 { |
| 207 outputParamStr (bigmove, absdist); | 207 outputParamStr (bigmove, absdist); |
| 208 } | 208 } |
| 209 } | 209 } |
| 210 | 210 |
| 211 static void | 211 static void |
| 212 clrScrToEol () | 212 clrScrToEol (void) |
| 213 { | 213 { |
| 214 int len = linebuf.ebuf - linebuf.buffer; | 214 int len = linebuf.ebuf - linebuf.buffer; |
| 215 | 215 |
| 216 if (len < linebuf.cursor) | 216 if (len < linebuf.cursor) |
| 217 return; | 217 return; |
| 236 absMoveCursor (oldcur); | 236 absMoveCursor (oldcur); |
| 237 } | 237 } |
| 238 } | 238 } |
| 239 | 239 |
| 240 static void | 240 static void |
| 241 redrawCmd () | 241 redrawCmd (void) |
| 242 { | 242 { |
| 243 xprintf (terminal.gobol); | 243 xprintf (terminal.gobol); |
| 244 xprintf (linebuf.prompt); | 244 xprintf (linebuf.prompt); |
| 245 linebuf.buffer[linebuf.cursor] = 0; | 245 linebuf.buffer[linebuf.cursor] = 0; |
| 246 xprintf (linebuf.buffer); | 246 xprintf (linebuf.buffer); |
| 255 redrawCmd (); | 255 redrawCmd (); |
| 256 linebuf.ebuf = linebuf.buffer + linebuf.cursor; | 256 linebuf.ebuf = linebuf.buffer + linebuf.cursor; |
| 257 } | 257 } |
| 258 | 258 |
| 259 static void | 259 static void |
| 260 prevCmd () | 260 prevCmd (void) |
| 261 { | 261 { |
| 262 if (curl == &currLine) | 262 if (curl == &currLine) |
| 263 { | 263 { |
| 264 if (list != NULL) | 264 if (list != NULL) |
| 265 { | 265 { |
| 285 else | 285 else |
| 286 beep (); | 286 beep (); |
| 287 } | 287 } |
| 288 | 288 |
| 289 static void | 289 static void |
| 290 nextCmd () | 290 nextCmd (void) |
| 291 { | 291 { |
| 292 if (curl->next == NULL) | 292 if (curl->next == NULL) |
| 293 { | 293 { |
| 294 beep (); | 294 beep (); |
| 295 } | 295 } |
| 302 } | 302 } |
| 303 | 303 |
| 304 static int initted = 0; | 304 static int initted = 0; |
| 305 | 305 |
| 306 void | 306 void |
| 307 initVt100 () | 307 initVt100 (void) |
| 308 { | 308 { |
| 309 terminal.gobol = "\r"; | 309 terminal.gobol = "\r"; |
| 310 terminal.oneleft = "\010"; | 310 terminal.oneleft = "\010"; |
| 311 terminal.relleft = "\033[%D"; | 311 terminal.relleft = "\033[%D"; |
| 312 terminal.relright = "\033[%C"; | 312 terminal.relright = "\033[%C"; |
| 317 terminal.width = 80; | 317 terminal.width = 80; |
| 318 initted = 1; | 318 initted = 1; |
| 319 } | 319 } |
| 320 | 320 |
| 321 void | 321 void |
| 322 initDumb () | 322 initDumb (void) |
| 323 { | 323 { |
| 324 terminal.gobol = "\r"; | 324 terminal.gobol = "\r"; |
| 325 terminal.oneleft = "\010"; | 325 terminal.oneleft = "\010"; |
| 326 terminal.relleft = NULL; | 326 terminal.relleft = NULL; |
| 327 terminal.relright = NULL; | 327 terminal.relright = NULL; |
| 396 linebuf.ebuf = linebuf.buffer + linebuf.cursor; | 396 linebuf.ebuf = linebuf.buffer + linebuf.cursor; |
| 397 } | 397 } |
| 398 } | 398 } |
| 399 | 399 |
| 400 static void | 400 static void |
| 401 deleteCurrChar () | 401 deleteCurrChar (void) |
| 402 { | 402 { |
| 403 int len = linebuf.ebuf - linebuf.buffer; | 403 int len = linebuf.ebuf - linebuf.buffer; |
| 404 char *ptr; | 404 char *ptr; |
| 405 if (len == linebuf.cursor || len == 0) | 405 if (len == linebuf.cursor || len == 0) |
| 406 return; | 406 return; |
| 421 absMoveCursor (oldcur); | 421 absMoveCursor (oldcur); |
| 422 } | 422 } |
| 423 } | 423 } |
| 424 | 424 |
| 425 static void | 425 static void |
| 426 deleteChar () | 426 deleteChar (void) |
| 427 { | 427 { |
| 428 if (linebuf.cursor == 0) | 428 if (linebuf.cursor == 0) |
| 429 { | 429 { |
| 430 beep (); | 430 beep (); |
| 431 return; | 431 return; |
