util.c
来自「支持数字元件仿真的SPICE插件」· C语言 代码 · 共 88 行
C
88 行
/*============================================================================FILE util.cMEMBER OF process cmppCopyright 1991Georgia Tech Research CorporationAtlanta, Georgia 30332All Rights ReservedPROJECT A-8503AUTHORS 9/12/91 Bill Kuhn and Steve TynorMODIFICATIONS <date> <person name> <nature of modifications>SUMMARY This file contains miscellaneous utility functions used in cmpp.INTERFACES init_error() print_error() str_to_lower()REFERENCED FILES None.NON-STANDARD FEATURES None.============================================================================*/#include "cmpp.h"#include <stdio.h>#include <ctype.h>#include <string.h>/* *********************************************************************** */char *prog_name;/* Initialize print_error() with the name of the program */void init_error (char *program_name){ prog_name = program_name;}/* Print an error message to stderr */void print_error( char *msg) /* The message to write */{ fprintf(stderr, "%s: %s\n", prog_name, msg);}/* Convert a string to all lower case */str_to_lower(s)char *s; /* The string to convert */{ int i; char c; for(i = 0; (c = s[i]) != '\0'; i++) if(isalpha(c)) if(isupper(c)) s[i] = tolower(c);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?