Ejemplo n.º 1
0
void PreviewResult(PLUBEHEADER pLube)
{
    CLSModule *pModule;

    if (LoadCLSFromDll(NULL, &pModule) >= 0) {
        LubeContext lubeCtx(pLube, pModule, LubeOpt_Redirect);
        lubeCtx.ExecTemplate(0);
    }
    else {
        fprintf(stderr, "[ERROR] lubc (0x1002) : Can't load sample CLS resource.\n");
        fprintf(stderr, "[ERROR] lubc (0x1003) : %s\n", CLSLastErrorMessage());
    }
}
Ejemplo n.º 2
0
void __cdecl ErrorReport(CARErrorNo err, ...)
{
    int n;
    va_list vl;

    if (err < CAR_ErrorStart) {
        if (s_bSuppressWarning) return;

        for (n = 0; n < s_cSuppressed; n++)
            if (err == s_suppressedWarnings[n]) return;
    }

    for (n = 0; n < c_nErrorNumber; n++) {
        if (err == s_errorMessages[n].err) {
            if (s_pszPrefix) fputs(s_pszPrefix, stderr);

            if (err > CAR_ErrorStart || s_bWarn2Error) {
                fprintf(stderr, "[ERROR] carc (0x%04x) %s %d : ",
                        err, s_szSourceFile, g_nLineNumber);
                if (s_bErrorCounting) g_nErrorNumber++;
            }
            else {
                fprintf(stderr, "[WARN] carc (0x%04x) %s %d : ",
                        err, s_szSourceFile, g_nLineNumber);
                if (s_bErrorCounting) g_nWarningNumber++;
            }
            va_start(vl, err);
            vfprintf(stderr, s_errorMessages[n].pszMessage, vl);
            va_end(vl);

            if (s_pszSuffix) fputs(s_pszSuffix, stderr);
            fputs("\n", stderr);
            break;
        }
    }

    if (CLSLastError() != CLS_NoError) {
        fprintf(stderr, "[ERROR] carc (0x7FFF) %s %d : Scrap - %s\n",
                s_szSourceFile, g_nLineNumber, CLSLastErrorMessage());
    }
}