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

📄 com_display.c

📁 ngspice又一个电子CAD仿真软件代码.功能更全
💻 C
字号:
#include <ngspice.h>#include <bool.h>#include <wordlist.h>#include <fteext.h>#include <cpextern.h>#include "com_display.h"#include "quote.h"#include "variable.h"#include "plotting/plotting.h"#include "plotting/pvec.h"/* For the sort in display. */static intdcomp(const void *d1, const void *d2){    struct dvec **v1 = (struct dvec **) d1;    struct dvec **v2 = (struct dvec **) d2;    return (strcmp((*v1)->v_name, (*v2)->v_name));}/* Display vector status, etc.  Note that this only displays stuff * from the current plot, and you must do a setplot to see the rest of * it.  */voidcom_display(wordlist *wl){    struct dvec *d;    struct dvec **dvs;    int len = 0, i = 0;    bool b;    char *s;    /* Maybe he wants to know about just a few vectors. */    out_init();    while (wl) {        s = cp_unquote(wl->wl_word);        d = vec_get(s);        tfree(s);/*DG to avoid the cp_unquote memory leak */        if (d == NULL)            fprintf(cp_err, "Error: no such vector as %s.\n",                 wl->wl_word);        else            while (d) {                pvec(d);                d = d->v_link2;            }        if (wl->wl_next == NULL)            return;        wl = wl->wl_next;    }    if (plot_cur)        for (d = plot_cur->pl_dvecs; d; d = d->v_next)            len++;    if (len == 0) {        fprintf(cp_out, "There are no vectors currently active.\n");        return;    }    out_printf("Here are the vectors currently active:\n\n");    dvs = (struct dvec **) tmalloc(len * (sizeof (struct dvec *)));    for (d = plot_cur->pl_dvecs, i = 0; d; d = d->v_next, i++)        dvs[i] = d;    if (!cp_getvar("nosort", VT_BOOL, (char *) &b))        qsort((char *) dvs, len, sizeof (struct dvec *), dcomp);    out_printf("Title: %s\n",  plot_cur->pl_title);    out_printf("Name: %s (%s)\nDate: %s\n\n",         plot_cur->pl_typename, plot_cur->pl_name,         plot_cur->pl_date);    for (i = 0; i < len; i++) {        d = dvs[i];        pvec(d);    }    return;}

⌨️ 快捷键说明

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