void work_thread(int argc, char_type** argv)
      {
         context_.exchange<application::args>(
            csbl::make_shared<application::args>(argc, argv));

         result_code_ = main_();
      }
int main(int argc, char** argv)
{
#ifdef STLSOFT_CF_EXCEPTION_SUPPORT
    try
    {
#endif /* STLSOFT_CF_EXCEPTION_SUPPORT */

        comstl::com_initialiser coinit;

        return main_(argc, argv);

#ifdef STLSOFT_CF_EXCEPTION_SUPPORT
    }
    catch(std::exception &x)
    {
        ::fprintf(stderr, "Unhandled error: %s\n", x.what());
    }
    catch(...)
    {
        ::fprintf(stderr, "Unhandled unknown error\n");
    }

    return EXIT_FAILURE;
#endif /* STLSOFT_CF_EXCEPTION_SUPPORT */
}
int main(int argc, char** argv)
{
#if 0
    { for(size_t i = 0; i < 0xffffffff; ++i){} }
#endif /* 0 */

    try
    {
#if defined(_DEBUG) || \
    defined(__SYNSOFT_DBS_DEBUG)
        puts("test.scratch.winstl.filesystem.link_functions: " __STLSOFT_COMPILER_LABEL_STRING);
#endif /* debug */

        return main_(argc, argv);
    }
    catch(std::bad_alloc&)
    {
        fputs("out of memory\n", stderr);
    }
    catch(std::exception& x)
    {
        fprintf(stderr, "Unhandled error: %s\n", x.what());
    }
    catch(...)
    {
        fputs("Unhandled unknown error\n", stderr);
    }

    return EXIT_FAILURE;
}
Esempio n. 4
0
int main(int argc, char** argv)
{
#if 0
    { for(size_t i = 0; i < 0xffffffff; ++i){} }
#endif /* 0 */

    try
    {
#if defined(_DEBUG) || \
    defined(__SYNSOFT_DBS_DEBUG)
        puts("test.scratch.FILE: " __STLSOFT_COMPILER_LABEL_STRING);
#endif /* debug */

        return main_(argc, argv);
    }
    catch(std::exception& x)
    {
        fprintf(stderr, "Unhandled error: %s\n", x.what());
    }
    catch(...)
    {
        fprintf(stderr, "Unhandled unknown error\n");
    }

    return EXIT_FAILURE;
}
int main(int argc, char *argv[])
{
    int             res;

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemState    memState;
#endif /* _MSC_VER && _MSC_VER */

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemCheckpoint(&memState);
#endif /* _MSC_VER && _MSC_VER */

#if 0
    { for(size_t i = 0; i < 0xffffffff; ++i){} }
#endif /* 0 */

    try
    {
#if defined(_DEBUG) || \
    defined(__SYNSOFT_DBS_DEBUG)
        puts("test.performance.one_pointer: " STLSOFT_COMPILER_LABEL_STRING);
#endif /* debug */

        if(fastformat::init() < 0)
        {
            fprintf(stderr, "Failed to initialise FastFormat\n");

            res = EXIT_FAILURE;
        }
        else
        {
            res = main_(argc, argv);

            fastformat::uninit();
        }
    }
    catch(std::exception& x)
    {
        fprintf(stderr, "Unhandled error: %s\n", x.what());

        res = EXIT_FAILURE;
    }
    catch(...)
    {
        fprintf(stderr, "Unhandled unknown error\n");

        res = EXIT_FAILURE;
    }

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemDumpAllObjectsSince(&memState);
#endif /* _MSC_VER) && _DEBUG */

    return res;
}
Esempio n. 6
0
int main(int argc, char **argv) {
    // We should capture stack top ASAP after start, and it should be
    // captured guaranteedly before any other stack variables are allocated.
    // For this, actual main (renamed main_) should not be inlined into
    // this function. main_() itself may have other functions inlined (with
    // their own stack variables), that's why we need this main/main_ split.
    mp_stack_ctrl_init();
    return main_(argc, argv);
}
Esempio n. 7
0
int main(int argc, char** argv)
{
    main_(argc, argv);
    /*if (argc != 3)
    {
        printf("need two arguments\n");
        return -1;
    }
    FILE* file = fopen(argv[2], "r"); */
    int size;
    /*while ((size = fread(buffer, 1, BUFSIZE, file)))
    {
        int i;
        for (i = 0; i < size; i++)
            freq[buffer[i]]++;
        len += size;
    } */
    int i;
    /* for (i = 0; i < 256; i++)
    {
        parent[i] = -1;
        push_(i, freq[i]);
    } */
    /*while (qsize != 1)
    {
        int v1 = pop();
        int v2 = pop();
        int w1 = weight[v1];
        int w2 = weight[v2];
        parent[v1] = used;
        parent[v2] = used;
        letter[v1] = 1;
        letter[v2] = 0;
        push_(used++, w1 + w2);
    } */
    // parent[pop()] = -1;

    // fclose(file);
    //file = fopen(argv[2], "r");
    //fout = fopen(argv[1], "w");
    //fwrite(parent, 1, sizeof(parent), fout);
    //fwrite(letter, 1, sizeof(letter), fout);
    //fwrite(&len, 1, sizeof(len), fout);
    /*while ((size = fread(buffer, 1, BUFSIZE, file)))
    {
        size_t i;
        for (i = 0; i < size; i++)
            print_encoded(buffer[i]);
    } */
    /*fwrite(outbuffer, 1, buffer_used + 1, fout);
    fclose(file);
    fclose(fout); */
    return 0; 
}
int main__(int argc, char** argv)
{
    _CrtMemState memState;

    _CrtMemCheckpoint(&memState);

    int r = main_(argc, argv);

    _CrtMemDumpAllObjectsSince(&memState);

    return r;
}
int main(int argc, char *argv[])
{
    int             res;

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemState    memState;
#endif /* _MSC_VER && _MSC_VER */

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemCheckpoint(&memState);
#endif /* _MSC_VER && _MSC_VER */

    try
    {
        if(fastformat::init() < 0)
        {
            fprintf(stderr, "Failed to initialise FastFormat\n");

            res = EXIT_FAILURE;
        }
        else
        {
            res = main_(argc, argv);

            fastformat::uninit();
        }
    }
    catch(std::exception& x)
    {
        fprintf(stderr, "Unhandled error: %s\n", x.what());

        res = EXIT_FAILURE;
    }
    catch(...)
    {
        fprintf(stderr, "Unhandled unknown error\n");

        res = EXIT_FAILURE;
    }

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemDumpAllObjectsSince(&memState);
#endif /* _MSC_VER) && _DEBUG */

    return res;
}
int main(int argc, char *argv[])
{
    int             res;

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemState    memState;
#endif /* _MSC_VER && _MSC_VER */

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemCheckpoint(&memState);
#endif /* _MSC_VER && _MSC_VER */

#if 0
    {
        for(size_t i = 0; i < 0xffffffff; ++i) {}
    }
#endif /* 0 */

    try
    {
#if defined(_DEBUG) || \
    defined(__SYNSOFT_DBS_DEBUG)
#endif /* debug */

        res = main_(argc, argv);
    }
    catch(std::exception &x)
    {
        fprintf(stderr, "Unhandled error: %s\n", x.what());

        res = EXIT_FAILURE;
    }
    catch(...)
    {
        fprintf(stderr, "Unhandled unknown error\n");

        res = EXIT_FAILURE;
    }

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemDumpAllObjectsSince(&memState);
#endif /* _MSC_VER) && _DEBUG */

    return res;
}
int main(int argc, char** argv)
{
    int             res;

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemState    memState;
#endif /* _MSC_VER && _MSC_VER */

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemCheckpoint(&memState);
#endif /* _MSC_VER && _MSC_VER */

#if 0
    {
        for(size_t i = 0; i < 0xffffffff; ++i) {}
    }
#endif /* 0 */

    try
    {
#if defined(_DEBUG) || \
    defined(__SYNSOFT_DBS_DEBUG)
#endif /* debug */

        res = main_(argc, argv);
    }
    catch(std::exception& x)
    {
        std::cerr << "Unexpected exception: " << x.what() << std::endl;

        res = EXIT_FAILURE;
    }
    catch(...)
    {

        res = EXIT_FAILURE;
    }

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemDumpAllObjectsSince(&memState);
#endif /* _MSC_VER) && _DEBUG */

    return res;
}
Esempio n. 12
0
int main(int argc, char** argv)
{
    int             res;

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemState    memState;
#endif /* _MSC_VER && _MSC_VER */

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemCheckpoint(&memState);
#endif /* _MSC_VER && _MSC_VER */

#if 0
    { for(size_t i = 0; i < 0xffffffff; ++i){} }
#endif /* 0 */

    try
    {
#if defined(_DEBUG) || \
    defined(__SYNSOFT_DBS_DEBUG)
        puts("test.scratch.tstring: " __STLSOFT_COMPILER_LABEL_STRING);
#endif /* debug */

        res = main_(argc, argv);
    }
    catch(std::exception& x)
    {
        pantheios::log_ALERT("Unexpected general error: ", x, ". Application terminating");

        res = EXIT_FAILURE;
    }
    catch(...)
    {
        pantheios::puts(pantheios::emergency, "Unhandled unknown error");

        res = EXIT_FAILURE;
    }

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemDumpAllObjectsSince(&memState);
#endif /* _MSC_VER) && _DEBUG */

    return res;
}
int main(int argc, char** argv)
{
    int             res;

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemState    memState;
#endif /* _MSC_VER && _MSC_VER */

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemCheckpoint(&memState);
#endif /* _MSC_VER && _MSC_VER */

#if 0
    {
        for(size_t i = 0; i < 0xffffffff; ++i) {}
    }
#endif /* 0 */

    try
    {
        comstl::com_initialiser coinit;

        res = main_(argc, argv);
    }
    catch(std::exception& x)
    {
        std::cerr << "Unexpected general error: " << x.what() << ". Application terminating" << std::endl;

        res = EXIT_FAILURE;
    }
    catch(...)
    {
        std::cerr << "Unhandled unknown error" << std::endl;

        res = EXIT_FAILURE;
    }

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemDumpAllObjectsSince(&memState);
#endif /* _MSC_VER) && _DEBUG */

    return res;
}
int main(int argc, char** argv)
{
    try
    {
        return main_(argc, argv);
    }
    catch(std::exception& x)
    {
        ff::fmtln(std::cerr, "exception: {0}", x);
    }
    catch(...)
    {
        ff::writeln(std::cerr, "unhandled unknown error");
    }

    return EXIT_FAILURE;
}
Esempio n. 15
0
int main(int argc, char** argv)
{
    try
    {
        return main_(argc, argv);
    }
    catch(std::exception& x)
    {
        fprintf(stderr, "exception: %s\n", x.what());
    }
    catch(...)
    {
        fprintf(stderr, "unhandled unknown error");
    }

    return EXIT_FAILURE;
}
int main(int argc, char** argv)
{
    try
    {
        return main_(argc, argv);
    }
    catch(std::exception& x)
    {
        pantheios::log_ALERT("Unexpected general error: ", x, ". Application terminating");
    }
    catch(...)
    {
        pantheios::logputs(pantheios::emergency, "Unhandled unknown error");
    }

    return EXIT_FAILURE;
}
int main(int argc, char *argv[])
{
    int             res;

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemState    memState;
#endif /* _MSC_VER && _MSC_VER */

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemCheckpoint(&memState);
#endif /* _MSC_VER && _MSC_VER */

#ifdef STLSOFT_CF_EXCEPTION_SUPPORT
    try
    {
#endif /* STLSOFT_CF_EXCEPTION_SUPPORT */

        res = main_(argc, argv);

#ifdef STLSOFT_CF_EXCEPTION_SUPPORT
    }
    catch(std::exception &x)
    {
                pantheios::log_ALERT(PSTR("Unexpected general error: "), pantheios::exception(x), PSTR(". Application terminating"));

        res = EXIT_FAILURE;
    }
    catch(...)
    {
        pantheios::logputs(pantheios::emergency, PSTR("Unhandled unknown error"));

        res = EXIT_FAILURE;
    }
#endif /* STLSOFT_CF_EXCEPTION_SUPPORT */

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemDumpAllObjectsSince(&memState);
#endif /* _MSC_VER) && _DEBUG */

    return res;
}
int main(int argc, char** argv)
{
    int             res;

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemState    memState;
#endif /* _MSC_VER && _MSC_VER */

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemCheckpoint(&memState);
#endif /* _MSC_VER && _MSC_VER */

    try
    {
#if defined(_DEBUG) || \
    defined(__SYNSOFT_DBS_DEBUG)
        puts("test.scratch.inserter.real: " __STLSOFT_COMPILER_LABEL_STRING);
#endif /* debug */

        res = main_(argc, argv);
    }
    catch(std::exception& x)
    {
        std::cerr << "Unhandled error: " << x.what() << std::endl;

        res = EXIT_FAILURE;
    }
    catch(...)
    {
        std::cerr << "Unhandled unknown error" << std::endl;

        res = EXIT_FAILURE;
    }

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemDumpAllObjectsSince(&memState);
#endif /* _MSC_VER) && _DEBUG */

    return res;
}
Esempio n. 19
0
int main(int argc, char *argv[])
{
    int res;

#if 0
    { for(size_t i = 0;0 != ++i;) {} }
#endif /* 0 */

    if(pantheios_init() < 0)
    {
        res = EXIT_FAILURE;
    }
    else
    {
        res = main_(argc, argv);

        pantheios_uninit();
    }

    return res;
}
int main(int argc, char** argv)
{
  try
  {
    return main_(argc, argv);
  }
    catch(std::bad_alloc&)
    {
        pantheios::log(pantheios::alert, PSTR("out of memory"));
    }
    catch(std::exception& x)
    {
        pantheios::log_CRITICAL(PSTR("Exception: "), x);
    }
  catch(...)
  {
    pantheios::logputs(pantheios::emergency, PSTR("Unhandled unknown error"));
  }

  return EXIT_FAILURE;
}
Esempio n. 21
0
int main(int argc, char** argv)
{
    int             res;

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemState    memState;
#endif /* _MSC_VER && _MSC_VER */

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemCheckpoint(&memState);
#endif /* _MSC_VER && _MSC_VER */

    try
    {
        res = main_(argc, argv);
    }
    catch(std::exception& x)
    {
        fprintf(stderr, "Unhandled error: %s\n", x.what());

        res = EXIT_FAILURE;
    }
    catch(...)
    {
        fprintf(stderr, "Unhandled unknown error\n");

        res = EXIT_FAILURE;
    }

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemDumpAllObjectsSince(&memState);
#endif /* _MSC_VER) && _DEBUG */

    return res;
}
int main(int argc, char** argv)
{
    int             res;

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemState    memState;
#endif /* _MSC_VER && _MSC_VER */

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemCheckpoint(&memState);
#endif /* _MSC_VER && _MSC_VER */

    try
    {
        res = main_(argc, argv);
    }
    catch(std::exception &x)
    {
        pantheios::log_ALERT("Unexpected general error: ", x, ". Application terminating");

        res = EXIT_FAILURE;
    }
    catch(...)
    {
        pantheios::logputs(pantheios::emergency, "Unhandled unknown error");

        res = EXIT_FAILURE;
    }

#if defined(_MSC_VER) && \
    defined(_DEBUG)
    _CrtMemDumpAllObjectsSince(&memState);
#endif /* _MSC_VER) && _DEBUG */

    return res;
}
Esempio n. 23
0
int main(int argc, char** argv) {
    try { //wrap in a try/catch loop so we can safely clean up (disable IOs)
        return main_(argc, argv);
    } catch (const std::exception *e) {
        LOGE("caught std::exception*: %s. ... Exiting\n", e->what());
        #if CLEAN_EXIT
            return 1; //don't rethrow exceptions; return an error code instead
        #endif
        throw;
    } catch (const std::exception &e) {
        LOGE("caught std::exception&: %s. ... Exiting\n", e.what());
        #if CLEAN_EXIT
            return 1; //don't rethrow exceptions; return an error code instead
        #endif
        throw;
    } catch (...) {
        LOGE("caught unknown exception. Exiting\n");
        #if CLEAN_EXIT
            return 1; //don't rethrow exceptions; return an error code instead
        #endif
        throw;
    }
}
int main(int argc, char **argv)
{
    int             res;
    _CrtMemState    memState;

    _CrtMemCheckpoint(&memState);

    try
    {
        res = main_(argc, argv);
    }
    catch(std::exception& /* x */)
    {
        res = EXIT_FAILURE;
    }
    catch(...)
    {
        res = EXIT_FAILURE;
    }

    _CrtMemDumpAllObjectsSince(&memState);

    return res;
}
int main(int argc, char** argv)
{
    if(2 == argc)
    {
        char const* arg = argv[1];

        if(0 == ::strncmp(arg, "--verbosity=", 12))
        {
            int verbosity = atoi(arg + 12);

            if(verbosity < 0)
            {
                verbosity = 0;
            }

            switch(verbosity)
            {
                case    0:
                case    1:
                    s_showNotices = false;
                    break;
                default:
                    s_showNotices = true;
                    break;
            }
        }
        else
        {
            fprintf(stderr, "unrecognised argument: '%s'\n", arg);

            return EXIT_FAILURE;
        }
    }

#ifdef STLSOFT_CF_EXCEPTION_SUPPORT
    try
    {
#endif /* !STLSOFT_CF_EXCEPTION_SUPPORT */

        int r = main_(argc, argv);

        fs_traits_t::unlink_file(LOG_FILE_NAME);

        return r;

#ifdef STLSOFT_CF_EXCEPTION_SUPPORT
    }
    catch(std::exception& x)
    {
        pan::log_ALERT(PSTR("Unexpected general error: "), pantheios::exception(x), PSTR(". Application terminating"));
    }
    catch(...)
    {
        pan::logputs(pan::emergency, PSTR("Unhandled unknown error"));
    }
#endif /* !STLSOFT_CF_EXCEPTION_SUPPORT */

    fs_traits_t::unlink_file(LOG_FILE_NAME);

    return EXIT_FAILURE;
}
Esempio n. 26
0
int main (int argc, char *argv[]) {
	return main_(sp);
}
Esempio n. 27
0
int main(int argc, char **argv) {
    mp_stack_ctrl_init();
    return main_(argc, argv);
}
Esempio n. 28
0
int main(int argc, char const *argv[])
{
	return main_(argc, argv);
}
 int run()
 {
     return main_();
 }
int main(int argc, char** argv)
{
  return main_(argc, argv);
}