mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-11 09:34:09 +03:00
df0d0be7d4
Added examples for working with coff-libraries and "libmsgbox" to ktcc. Modified binutils to work normally via console.obj. git-svn-id: svn://kolibrios.org@8098 a494cfbc-eb01-0410-851d-a64ba20cac60
22 lines
556 B
C
22 lines
556 B
C
#include <dlfcn.h>
|
|
|
|
/*Using the "coff" library in ktcc using "inputbox.obj" as an example*/
|
|
|
|
unsigned (*InputBox)(void* Buffer, char* Caption, char* Prompt, char* Default, unsigned long Flags, unsigned long BufferSize, void* RedrawProc);
|
|
|
|
void *InputBoxLib;
|
|
|
|
void load_coff()
|
|
{
|
|
InputBoxLib = dlopen("/sys/lib/inputbox.obj", RTLD_GLOBAL);
|
|
InputBox = dlsym(InputBoxLib,"InputBox");
|
|
}
|
|
|
|
int main()
|
|
{
|
|
load_coff();
|
|
char buffer[256];
|
|
InputBox(buffer, "Hay!", "How do you do?", "Hmm?", 10, 256, 0);
|
|
dlclose(InputBoxLib);
|
|
}
|