xAWK as library under C program ? 
Author Message
 xAWK as library under C program ?

Can awk be used (as with TCL) as a library running inside your program ?

Does it allow add on commands to be coded ? e.g.

main
{
        init awk & add call back functions for new commands

        call Awk_processor(args);

        /* never get here */

Quote:
}

(the reality is this will be a thread in a program doing other work,
this back end is to stress test and test the main program)

If so, where can i find the library ?

Thanks in advance



Wed, 10 Dec 2003 10:10:56 GMT  
 xAWK as library under C program ?

Quote:

> Can awk be used (as with TCL) as a library running inside your program ?

> Does it allow add on commands to be coded ? e.g.

> main
> {
>         init awk & add call back functions for new commands

>         call Awk_processor(args);

>         /* never get here */
> }

> (the reality is this will be a thread in a program doing other work,
> this back end is to stress test and test the main program)

> If so, where can i find the library ?

Awka may help you (http://awka.sourceforge.net).

It will allow you to embed an AWK program inside C or C++, or conversely
embed C functions inside AWK.  

It isn't implemented as well as TCL is in this respect though.  TCL allows
you to open an interpreter and then, in successive function calls, provide
it with things to interpret.

Embedding AWK in C via Awka will allow you to call the entire script as
a single function call, not call specific elements of it as per TCL.  Unless,
of course, you're willing to adopt Awka's API and data types in which case
you can call the library functions directly.

cheers,
Andrew



Fri, 12 Dec 2003 07:46:28 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. New Zealand Digital Library: full-text index to 30,000 C.S. reports

2. New Zealand Digital Library: full-text index to 30,000 C.S. reports

3. New Zealand Digital Library: full-text index to 30,000 C.S. reports

4. Xawk

5. to CS: or not to CS: in F-PC assembler

6. SoftEng or CS Graduate Program Search

7. Programs needed for CS investigation

8. Call for programs (CS investigation)

9. ST-Programs wanted (CS investigation)

10. SoftEng or CS Graduate Program Search

11. SoftEng or CS Graduate Program Search

12. SoftEng or CS Graduate Program Search

 

 
Powered by phpBB® Forum Software