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

📄 com_shift.c

📁 ngspice又一个电子CAD仿真软件代码.功能更全
💻 C
字号:
/************** com_shift.c* $Id: com_shift.c,v 1.2 2005/05/30 20:28:30 sjborley Exp $************/#include <config.h>#include <ngspice.h>#include <bool.h>#include <wordlist.h>#include "com_shift.h"#include "variable.h"#include "streams.h"/* Shift a list variable, by default argv, one to the left (or more if * a second argument is given.  */voidcom_shift(wordlist *wl){    struct variable *v, *vv;    char *n = "argv";    int num = 1;    if (wl) {        n = wl->wl_word;        wl = wl->wl_next;    }    if (wl)        num = scannum(wl->wl_word);        for (v = variables; v; v = v->va_next)        if (eq(v->va_name, n))            break;    if (!v) {        fprintf(cp_err, "Error: %s: no such variable\n", n);        return;    }    if (v->va_type != VT_LIST) {        fprintf(cp_err, "Error: %s not of type list\n", n);        return;    }    for (vv = v->va_vlist; vv && (num > 0); num--)        vv = vv->va_next;    if (num) {        fprintf(cp_err, "Error: variable %s not long enough\n", n);        return;    }    v->va_vlist = vv;    return;}

⌨️ 快捷键说明

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