资源简介
最新的C库函数的源代码,适用于想进一步研究C库函数的童鞋。下载后直接解压即可查看、改编、编译源代码。
代码片段和文件信息
/* Skeleton for test programs.
Copyright (C) 19982000-2004 2005 Free Software Foundation Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper 1998.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not write to the Free
Software Foundation Inc. 59 Temple Place Suite 330 Boston MA
02111-1307 USA. */
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
/* The test function is normally called ‘do_test‘ and it is called
with argc and argv as the arguments. We nevertheless provide the
possibility to overwrite this name. */
#ifndef TEST_FUNCTION
# define TEST_FUNCTION do_test (argc argv)
#endif
#ifndef TEST_DATA_LIMIT
# define TEST_DATA_LIMIT (64 << 20) /* Data limit (bytes) to run with. */
#endif
#define OPT_DIRECT 1000
#define OPT_TESTDIR 1001
static struct option options[] =
{
#ifdef CMDLINE_OPTIONS
CMDLINE_OPTIONS
#endif
{ “direct“ no_argument NULL OPT_DIRECT }
{ “test-dir“ required_argument NULL OPT_TESTDIR }
{ NULL 0 NULL 0 }
};
/* PID of the test itself. */
static pid_t pid;
/* Directory to place temporary files in. */
static const char *test_dir;
/* List of temporary files. */
struct temp_name_list
{
struct qelem q;
const char *name;
} *temp_name_list;
/* Add temporary files in list. */
static void
__attribute__ ((unused))
add_temp_file (const char *name)
{
struct temp_name_list *newp
= (struct temp_name_list *) calloc (sizeof (*newp) 1);
if (newp != NULL)
{
newp->name = name;
if (temp_name_list == NULL)
temp_name_list = (struct temp_name_list *) &newp->q;
else
insque (newp temp_name_list);
}
}
/* Delete all temporary files. */
static void
delete_temp_files (void)
{
while (temp_name_list != NULL)
{
remove (temp_name_list->name);
temp_name_list = (struct temp_name_list *) temp_name_list->q.q_forw;
}
}
/* Create a temporary file. */
static int
__attribute__ ((unused))
create_temp_file (const char *base char **filename)
{
char *fname;
int fd;
fname = (char *) malloc (strlen (test_dir) + 1 + strlen (base)
+ sizeof (“XXXXXX“));
if (fname == NULL)
{
puts (“out o
相关资源
- flash喜洋洋与灰太狼动画源文件
- SPSS课件以及原始数据
- flash作品的源文件
- minidump_stackwalk 执行档
- Authorware源文件
- MinGW 5.1.3
- ANSYS LS-dyna显示动力学讲义源文件
- 简单版商城原型 电商APP 后台 Axure
- 江湖外卖4.0/4.1内核开源文件支持破解
- 多学科多目标优化软件Isight入门与提
- Vivado入门与提高Demo一含源文件
- libcurl.a(with zlib openssl libssh2) 含r
- Qt Creator中的3D绘图及动画教程(参照
- 北京科技大学新校徽AI源文件、字体源
- Authorware 课程设计 源文件 埃及文明
- 挥着翅膀的女孩MTV-flash源文件
- authorware个人简历源文件
- flash小游戏源文件
- 20个Flash源文件. flash源文件。swf源文件
- 室内设计3D模型(含源文件.
- 3D MAX 动画作品源文件,渲染文件和实
- 3d室内设计的源文件
- (BlogYi)v1.7.5项目源文件.rar
- STM32F1战舰原理图+PCB源文件
- Lionsgate狮门的片头 AE源文件 3D logo文
- Spine_2D骨骼新手动画教程PDF+源文件
- Flash AS3 扫雷游戏源文件
- mini_stm32开发板原理图及PCB图源文件
- Flash大作业,可以使用,源文件可修改
- Sigrity 2017 EMI仿真教程(附源文件)
评论
共有 条评论