Tag: wrapper

有没有librtmp c#.net包装器?

有没有librtmp c#.net包装器?

编译时的C函数装饰器(包装器)

我试图在预处理器的帮助下改变C中某些函数的行为; 并添加可以打开或关闭的可选参数… 可选参数的基本模式很简单: #ifdef OPT_PARAM #define my_func(a, b, opt) _my_func(a, b, opt) #else #define my_func(a, b, opt) _my_func(a, b) #endif /*the rest of the code always calls “my_func” with all the params and not the underscored version…*/ #ifdef OPT_PARAM void _my_func(int a, int b, int opt) #else void _my_func(int a, int b) #endif { /*… […]

如何将win32 WndProc包装到C ++类中?

这有可能吗? 例如,假设我有以下内容: class Window { private: WNDCLASSEX wc; public: inline WNDCLASSEX getWindowClass() { return wc; } Window(); LRESULT CALLBACK WndProc(HWND hwnd, UINT message, LPARAM lParam, WPARAM wParam); } void RegisterWindow(Window win) { WNDCLASSEX* wc = win.getWindowClass(); RegisterClassEx(wc); } 现在,某处会有一个部分(可能在Window类的构造函数中,需要为WNDCLASSEX分配一个WndProc ,这在Window类中有说明。唯一的问题是,因为它是一个部分class,会出现错误。这样,它是如何实现的?它是静态的吗?即便如此,如果类包装它仍然是某种程度的类的一部分。如果我在类之外创建它,那么简单地抹掉了这一点。

在Swift中使用C函数,将函数作为参数

我正在写一个C数学库的包装器。 每个函数都将一个或两个函数作为参数。 但是,这些子函数(以及父函数)的参数不是Swifty -hence包装器。 我已经清理了示例代码,只显示了三个主要部分:c-library函数,将传递给包装器的所需Swift函数(未显示主体,但环绕c-library函数),以及必需的C函数forms。 //C library function, that calls the passed function dozens, hundreds or thousands of times, each time it changes the data provided in p, and uses the output from x //The Swift arrays are passed as pointers, and the length of the and x array are m and n respectively returnValue […]

使用SWIG的C ++到C包装器(用于FLTK)

我需要为FLTK C ++类生成包装器以在纯C中使用它。我知道,SWIG可以做到这一点,我知道如何为C#,Python等生成包装器。但我不知道如何使用C ++包装C ++痛饮。 这是一项简单的任务,但我找不到答案:)请帮忙。

用于C ++的C包装器

我想将Pure Data用作我自己库的原型工具。 我发现Pure Data补丁是用C语言编写的,但我的库是用C ++编写的。 那么如何在纯数据中使用此代码呢? 由于我没有使用普通的C,我想知道如何编写C ++类的C包装器以及如何实例化我的类呢? 或者我必须重写C中的所有内容?