main.c

来自「seismic software,very useful」· C语言 代码 · 共 135 行

C
135
字号
#include "main.h"#include "axis.h"#include "data.h"#include "map.h"#include "render.h"#include "plane.h"#include "view.h"#include "pick.h"#include <stdio.h>#ifdef SEPLIB#define SOURCE "/dev/null"#include <sep.main>#endif/* current dataset, render */Data     data = 0;Render   render = 0;View     view = 0;int      _core = 16 * 1024 * 1024;int      _alloc = 0;int      memwatch = 0;#ifdef SEPLIBMAIN(){#elseint      xargc;char   **xargv;int      infd = 0;int      outfd = 1;FILE    *instream = stdin;FILE    *outstream = stdout;string   in = "stdin";string   out = "stdout";main(argc, argv)int      argc;char   **argv;{    extern int xargc;    extern char **xargv, *help;    extern int infd, outfd;    extern FILE *instream, *outstream;    extern string in, out;    xargc = argc;    xargv = argv;    /* selfdoc */    if (argc == 1 && lseek(infd, 0, 2) == 0) {    HelpMore("cmovie", "END");    exit();    }    GetparInit(argc, argv);    if (GETPARSTRING("in", "s", in)) {    if ((infd = open(in, 0)) < 0)        err("cant open in= file");    if ((instream = fdopen(infd, "r")) == NULL)        err("can't open in= file");    }    if (GETPARSTRING("out", "s", out)) {    if ((outfd = open(out, 2)) < 0)        if ((outfd = creat(out, 0664)) < 0)        err("cant open out= file");    if ((outstream = fdopen(outfd, "a")) == NULL)        err("can't open out= file");    }#endif/*  _core = core();*/    GETPARINT("memwatch", "d", &memwatch);    /* initialize objects */    data = DataInit();    MovieInit();    render = RenderInit();    PlaneInit();    view = ViewInit(data);    PickInit();    PikInit();    RegionInit();#ifdef XM    UIInit(argc, argv);#endif#ifdef XAW    UIInit();#endif#ifdef SEPLIB    hclose();#endif    /* interactive loop */    UIMain();}MainFirst(){    DrawInit();    ColorbarInit();    ColorInit();    RenderMap(render);    DataLoad();#ifdef XAW    ViewSize0();#endif    if (MovieRun())    MovieOn();}#ifdef SUGETPARSTRING(name, type, var)char    *name, *type, *var;{    char    *str;    int      status;    status = getparstring(name, &str);    if (status)    strcpy(var, str);    return (status);}#endifcore(){    FILE    *fd;    string   line;    fgets(line, sizeof(line), fd = popen("/vol/admin/bin/physmem", "r"));    pclose(fd);    return (atoi(line) * 1024);}

⌨️ 快捷键说明

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