mktemp.c
来自「linux平台下类似著名的电路板作图软件 Spice的源代码」· C语言 代码 · 共 40 行
C
40 行
/**********Copyright 1990 Regents of the University of California. All rights reserved.**********//* * A more portable version of the standard "mktemp( )" function */#include "spice.h"#include "stdio.h"#include "misc.h"#ifndef TEMPFORMAT#define TEMPFORMAT "temp%s%d"#endifchar *smktemp(id) char *id;{ char rbuf[513]; char *nbuf; int num;#ifdef HAS_GETPID num = getpid( );#else num = 0;#endif if (!id) id = "sp"; sprintf(rbuf, TEMPFORMAT, id, num); nbuf = (char *) malloc(strlen(rbuf) + 1); strcpy(nbuf, rbuf); return nbuf;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?