git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@128 626c5289-ae23-0410-ae9c-e8d60b6d4f22
35 lines
892 B
C
35 lines
892 B
C
/* -----------------------------------------------------------------------------
|
|
* misc.c
|
|
*
|
|
* Miscellaneous functions that don't really fit anywhere else.
|
|
*
|
|
* Author(s) : David Beazley (beazley@cs.uchicago.edu)
|
|
*
|
|
* Copyright (C) 1999-2000. The University of Chicago
|
|
* See the file LICENSE for information on usage and redistribution.
|
|
* ----------------------------------------------------------------------------- */
|
|
|
|
static char cvsroot[] = "$Header$";
|
|
|
|
#include "swig.h"
|
|
|
|
|
|
/* -----------------------------------------------------------------------------
|
|
* Swig_copy_string()
|
|
*
|
|
* Duplicate a NULL-terminate string given as a char *.
|
|
* ----------------------------------------------------------------------------- */
|
|
|
|
char *
|
|
Swig_copy_string(const char *s) {
|
|
char *c = 0;
|
|
if (s) {
|
|
c = (char *) malloc(strlen(s)+1);
|
|
strcpy(c,s);
|
|
}
|
|
return c;
|
|
}
|
|
|
|
|
|
|
|
|