slang-users mailing list

[2004 Date Index] [2004 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

[slang-users] slc2c - made an includer, want feedback


Greetings.

I am curious of what you think of my idea. I have created (converted) an
optional utility that is used with Lua which takes a compiled SLang
file, reads it in binary mode, creates a function sorta like:

void hello() {
  const unsigned char B1[] = { 12, 20, 10, ... ... };
  SLang_load_string(B1);
}

Now, in your C application where you want to provide both C intrinsics
and also some code written in S-Lang, you can do something like:

#include "hello.c"

void main() {
  SLang_init_all();
  hello();
  SLang_load_file("whatsup.sl");
}

... all defines in your original hello.sl are now available in
whatsup.sl w/o additional coding, or distribution of the original
hello.sl file.

Please critique the idea, comparing it to other ways of accomplishing
the same task (providing slang code to SLang_load_file()).

Oh, the file is very small (2,162 bytes) and is available at: 

http://cowgar.com/slc2c.c

To compile, simply issue:

gcc -o slc2c slc2c.c

To use, look at the C comment at the top of the slc2c.c file.

Thanks,

Jeremy



_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html


[2004 date index] [2004 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]