Original date:2020-05-21 22:00:24 Edited by: Icy_Viking Subject: Re: Basic Statistics with OpenEuphoria

rneu said...

Thanks for very useful suggestions.

This link is not working:

The easiest way to wrap a C library in Euphoria is to use a DLL.

--load sigil.dll 
atom sl 
--do platform check and load library for the correct platform 
ifdef WIN32 then 
	sl = open_dll("sigil.dll") 
	if sl = -1 then 
		puts(1,"Failed to open sigil.dll!\n") 
	end if 
	elsifdef LINUX or FREEBSD then 
	 sl = open_dll("") 
	 if sl = -1 then 
	 	puts(1,"Failed to load!\n") 
	 end if 
end ifdef 
ublic constant xslWindow = define_c_proc(sl,"+slWindow",{C_INT,C_INT,C_POINTER,C_INT}) 
public procedure slWindow(atom width,atom height,sequence title,integer fullScr) 
 atom str = allocate_string(title,1) 
end procedure 

The above is a snippet from a wrapper I wrote for the Sigil library. The process is virtually the same for most C libraries you would want to wrap.

Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu