⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xmlregisteroutputcallbacks_chdl.c

📁 图片显示,电脑光于望技术湖连望键往,网络
💻 C
字号:
#include <libxml/xmlIO.h>
#include <ch.h>

static ChInterp_t interp;
static int matchFunc_chdl_funarg(char const *filename);
static void *matchFunc_chdl_funptr;

static void * openFunc_chdl_funarg(char const *filename);
static void *openFunc_chdl_funptr;

static int writeFunc_chdl_funarg(void * context, char * buffer, int len);
static void *writeFunc_chdl_funptr;

static int closeFunc_chdl_funarg(void * context);
static void *closeFunc_chdl_funptr;

EXPORTCH int xmlRegisterOutputCallbacks_chdl(void *varg) {
    va_list ap;
    xmlOutputMatchCallback matchFunc, matchFunc_ch=NULL;
    xmlOutputOpenCallback openFunc, openFunc_ch=NULL;
    xmlOutputWriteCallback writeFunc, writeFunc_ch=NULL;
    xmlOutputCloseCallback closeFunc, closeFunc_ch=NULL;
    int retval;

    Ch_VaStart(interp, ap, varg);
    matchFunc = Ch_VaArg(interp, ap, xmlOutputMatchCallback);
    if(matchFunc){
        matchFunc_chdl_funptr = matchFunc;
        matchFunc_ch = matchFunc_chdl_funarg;
    }
    openFunc = Ch_VaArg(interp, ap, xmlOutputOpenCallback);
    if(openFunc){
        openFunc_chdl_funptr = openFunc;
        openFunc_ch = openFunc_chdl_funarg;
    }
    writeFunc = Ch_VaArg(interp, ap, xmlOutputWriteCallback);
    if(writeFunc){
        writeFunc_chdl_funptr = writeFunc;
        writeFunc_ch = writeFunc_chdl_funarg;
    }
    closeFunc = Ch_VaArg(interp, ap, xmlOutputCloseCallback);
    if(closeFunc){
        closeFunc_chdl_funptr = closeFunc;
        closeFunc_ch = closeFunc_chdl_funarg;
    }
    retval = xmlRegisterOutputCallbacks(matchFunc_ch, openFunc_ch, writeFunc_ch, closeFunc_ch);
    Ch_VaEnd(interp, ap);
    return retval;
}
static int matchFunc_chdl_funarg(char const *filename){
    int retval;

    Ch_CallFuncByAddr(interp, matchFunc_chdl_funptr, &retval, filename);
    return retval;

}

static void * openFunc_chdl_funarg(char const *filename){
    void * retval;

    Ch_CallFuncByAddr(interp, openFunc_chdl_funptr, &retval, filename);
    return retval;
}

static int writeFunc_chdl_funarg(void * context, char * buffer, int len){
    int retval;

    Ch_CallFuncByAddr(interp, writeFunc_chdl_funptr, &retval, context, buffer, len);
    return retval;
}

static int closeFunc_chdl_funarg(void * context){
    int retval;

    Ch_CallFuncByAddr(interp, closeFunc_chdl_funptr, &retval, context);
    return retval;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -