diff --git a/src/include/ngspice/cmproto.h b/src/include/ngspice/cmproto.h index 9138abe25..2164379e6 100644 --- a/src/include/ngspice/cmproto.h +++ b/src/include/ngspice/cmproto.h @@ -47,6 +47,7 @@ NON-STANDARD FEATURES #include +#include "ngspice/alloc.h" #include "ngspice/cmtypes.h" #include "ngspice/cktdefs.h" @@ -103,15 +104,10 @@ void *malloc_pj(size_t s); void *calloc_pj(size_t s1, size_t s2); void *realloc_pj(void *ptr, size_t s); void free_pj(void *ptr); -void *tmalloc(size_t s); -void *trealloc(void *ptr, size_t s); -void txfree(void *ptr); -const char *ngspice_version(void); -void *tmalloc_raw(size_t s); -void *tcalloc_raw(size_t n, size_t s); -void *trealloc_raw(void *ptr, size_t s); + char *tstrdup(const char *str_in); char *tstrdup_raw(const char *str_in); +const char *ngspice_version(void); FILE *fopen_with_path(const char *path, const char *mode); diff --git a/src/misc/dstring.c b/src/misc/dstring.c index 7e4323bba..45111a71f 100644 --- a/src/misc/dstring.c +++ b/src/misc/dstring.c @@ -17,16 +17,16 @@ static int ds_reserve_internal(DSTRING *p_ds, size_t n_byte_alloc_opt, size_t n_byte_alloc_min); /* Instantiations of dstring functions in case inlining is not performed */ -int ds_cat_str(DSTRING *p_ds, const char *sz); -int ds_cat_char(DSTRING *p_ds, char c); -int ds_cat_ds(DSTRING *p_ds_dst, const DSTRING *p_ds_src); -int ds_cat_mem(DSTRING *p_ds, const char *p_src, size_t n_char); -int ds_set_length(DSTRING *p_ds, size_t length); -void ds_clear(DSTRING *p_ds); -char *ds_free_move(DSTRING *p_ds, unsigned int opt); -char *ds_get_buf(DSTRING *p_ds); -size_t ds_get_length(const DSTRING *p_ds); -size_t ds_get_buf_size(const DSTRING *p_ds); +extern inline int ds_cat_str(DSTRING *p_ds, const char *sz); +extern inline int ds_cat_char(DSTRING *p_ds, char c); +extern inline int ds_cat_ds(DSTRING *p_ds_dst, const DSTRING *p_ds_src); +extern inline int ds_cat_mem(DSTRING *p_ds, const char *p_src, size_t n_char); +extern inline int ds_set_length(DSTRING *p_ds, size_t length); +extern inline void ds_clear(DSTRING *p_ds); +extern inline char *ds_free_move(DSTRING *p_ds, unsigned int opt); +extern inline char *ds_get_buf(DSTRING *p_ds); +extern inline size_t ds_get_length(const DSTRING *p_ds); +extern inline size_t ds_get_buf_size(const DSTRING *p_ds); /* This function initalizes a dstring using *p_buf as the initial backing diff --git a/src/misc/string.c b/src/misc/string.c index 7aaf87c03..4a5e1ec4e 100644 --- a/src/misc/string.c +++ b/src/misc/string.c @@ -15,10 +15,10 @@ Copyright 1990 Regents of the University of California. All rights reserved. /* Instantiations of string functions in case inlining is not performed */ -char *copy(const char *str); -char *copy_substring(const char *str, const char *end); -int scannum(const char *str); -int substring(const char *sub, const char *str); +extern inline char *copy(const char *str); +extern inline char *copy_substring(const char *str, const char *end); +extern inline int scannum(const char *str); +extern inline int substring(const char *sub, const char *str);