home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
me34src.zip
/
me3
/
ed
/
main.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-01-14
|
1KB
|
53 lines
/* Craig Durland Public Domain
* Distributed "as is", without warranties of any kind, but comments,
* suggestions and bug reports are welcome.
*/
#include <const.h>
#include "ed.h"
#include "led.h"
extern char *Ltext; /* the text the user input */
extern int Lerrorno; /* LEDs error number */
extern Lmacs();
/* ******************************************************************** */
/* ************************* TEST ************************************* */
/* ******************************************************************** */
callback(kc,fcn) EKeyCode kc; int fcn;
{
switch (fcn)
{
case 1: return Ldo_fcn(LF_INSERT_KEYCODE,'a',LF_STOP);
case 2: return Ldo_fcn(LF_INSERT_STRING,"<Callback 2>",LF_STOP);
case 3:
Led("(Recursing) ","",(pfi)NULL);
break;
}
return LF_NOOP;
}
extern int Lncol, t_ncol;
main(argc,argv) int argc; char **argv;
{
char buf[80], *spoof();
int n;
t_open();
init_Led(); Lmacskeys();
Ldo_fcn(LF_BINDKEY,
LF_CALLBACK,1,'A', LF_CALLBACK,2,'~', LF_CALLBACK,3,META|'R',
LF_STOP,LF_STOP);
for (n = 1; 1; n++)
{
sprintf(buf,"Led[%d]: ",n);
if (LF_ABORT == Led(buf,"",callback)) break;
printf("\nYou typed: \"%s\"\n",Ltext);
}
t_close();
printf("\nAll done.\n");
}