strdup.c

来自「wm PNE 3.3 source code, running at more 」· C语言 代码 · 共 80 行

C
80
字号
/* $Header: /usr/cvsroot/target/src/wrn/wm/demo/lib/strdup.c,v 1.3 2003/01/15 14:04:36 josh Exp $ *//* * Copyright (C) 1999-2005 Wind River Systems, Inc. * All rights reserved.  Provided under license only. * Distribution or other use of this software is only * permitted pursuant to the terms of a license agreement * from Wind River Systems (and is otherwise prohibited). * Refer to that license agreement for terms of use. *//**************************************************************************** *  Copyright 1993-1997 Epilogue Technology Corporation. *  Copyright 1998 Integrated Systems, Inc. *  All rights reserved. ****************************************************************************//* * $Log: strdup.c,v $ * Revision 1.3  2003/01/15 14:04:36  josh * directory structure shifting * * Revision 1.2  2001/11/08 15:56:28  tneale * Updated for newest file layout * * Revision 1.1.1.1  2001/11/05 17:48:43  tneale * Tornado shuffle * * Revision 1.3  2001/01/19 22:23:54  paul * Update copyright. * * Revision 1.2  2000/03/17 00:12:47  meister * Update copyright message * * Revision 1.1  1998/06/03 21:16:35  sar * A local version of the strdup function so that the demo code * can use it without worring about its existence * *//* [clearcase]modification history-------------------01a,19apr05,job  update copyright notices*//* This used to be part of snmptalk/stdf.h it has been moved to   the snark library so other demo code can use it.  The other   stdf functions were moved to the common library. */#include <wrn/wm/common/install.h>#include <wrn/wm/common/config.h>#include <snark.h>#include <wrn/wm/demo/strdup.h>#include <string.h>#include <ctype.h>#include <wrn/wm/common/glue.h>char *  etc_strdup(char *str){  char *ans;  ans = (char *)GLUE_ALLOC(STRLEN(str) + 1);  if (ans)    STRCPY(ans, str);  return ans;}void  etc_strdup_free(char *str){  GLUE_FREE(str);}

⌨️ 快捷键说明

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