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

📄 main_for_lib.c

📁 matlab实用教程
💻 C
字号:
/* Copyright 2005 The MathWorks, Inc. */

/*
 * This is the main wrapper for all C library functions.
 * This wrapper has conditional code as is necessary for
 * macintosh platform.
 */

#include "main_for_lib.h" /* for the definition of the structure inputs */

#ifdef __APPLE_CC__
#include <CoreFoundation/CoreFoundation.h>
#include <pthread.h>
#endif

void *run_main(void *);

int main(int ac, const char* av[])
{
    inputs in;
    in.ac = ac;
    in.av = av;
    in.err = 0;
#ifdef __APPLE_CC__
    pthread_t id;
    pthread_create(&id, NULL, run_main, &in);

    CFRunLoopSourceContext sourceContext;
    sourceContext.version         = 0;
    sourceContext.info            = NULL;
    sourceContext.retain          = NULL;
    sourceContext.release         = NULL;
    sourceContext.copyDescription = NULL;
    sourceContext.equal           = NULL;
    sourceContext.hash            = NULL;
    sourceContext.schedule        = NULL;
    sourceContext.cancel          = NULL;
    sourceContext.perform         = NULL;

    CFRunLoopSourceRef sourceRef = CFRunLoopSourceCreate(NULL, 0, &sourceContext);
    CFRunLoopAddSource(CFRunLoopGetCurrent(), sourceRef, kCFRunLoopCommonModes);
    CFRunLoopRun();
#else
    run_main(&in);
#endif
    return in.err;
}

⌨️ 快捷键说明

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