?? tmpnam.c
字號(hào):
/* * tmpnam.c - create a unique filename *//* $Header: /cvsup/minix/src/lib/stdio/tmpnam.c,v 1.1.1.1 2005/04/21 14:56:36 beng Exp $ */#if defined(_POSIX_SOURCE)#include <sys/types.h>#endif#include <stdio.h>#include <string.h>#include "loc_incl.h"pid_t _getpid(void);char *tmpnam(char *s) { static char name_buffer[L_tmpnam] = "/tmp/tmp."; static unsigned long count = 0; static char *name = NULL; if (!name) { name = name_buffer + strlen(name_buffer); name = _i_compute((unsigned long)_getpid(), 10, name, 5); *name++ = '.'; *name = '\0'; } if (++count > TMP_MAX) count = 1; /* wrap-around */ *_i_compute(count, 10, name, 3) = '\0'; if (s) return strcpy(s, name_buffer); else return name_buffer;}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -