NAME

kjb_strdup - Duplicates a string

SYNOPSIS

#include "l/l_string.h"

Example compile flags (system dependent):
  -DLINUX_386 -DLINUX_386_P4  
   -I/home/kobus/include
   -L/home/kobus/load/linux_386_p4 -L/usr/local/lib -L/usr/lib
  -lKJB         -llapack -lblas -lg2c          -lXext -lX11 


char *kjb_strdup(const char *input_string);

DESCRIPTION

This routine allocates enough storage for a copy of the input string, and then copies the input string. The newly alloacted string is returned. If TEST is #defined (unix only) then this routine is #define'd to be debug_kjb_str_dup, which is the version available in the development library. In development code memory is tracked so that memory leaks can be found more easily. Furthermore, all memory freed is checked that it was allocated by an L library routine. The routine kjb_free (accessed via the macro kjb_free) should be used to dispose of the storage once it is no longer needed.

RETURNS

On error, this routine returns NULL, with an error message being set. One success it returns a pointer to the duplicated string.

SEEALSO

kjb_malloc, print_allocated_memory, kjb_free

DISCLAIMER

This software is not adequatedly tested. It is recomended that results are checked independantly where appropriate.

AUTHOR

Kobus Barnard

DOCUMENTOR

Kobus Barnard

SEE ALSO

signed_strlen , trim_beg , const_trim_beg , trim_end , trim_len , extended_uc_lc , extended_lc_uc , extended_n_uc_lc , extended_n_lc_uc , extended_tolower , extended_toupper , void_strcmp , kjb_strcmp , kjb_memcmp , kjb_strncmp , kjb_ic_strcmp , kjb_ic_strncmp , head_cmp , ic_head_cmp , ptr_strcmp , ptr_strncmp , ptr_ic_strcmp , ptr_head_cmp , ptr_ic_head_cmp , rpad , rpad_cpy , str_trunc_cpy , trunc_quote_cpy , kjb_buff_cpy , kjb_strncpy , kjb_memcpy , extended_lc_strncpy , extended_uc_strncpy , kjb_buff_cat , kjb_strncat , cap_first_letter_cpy , str_build , str_n_build , str_char_build , byte_build , increment_byte_copy , fill_with_blanks , find_string , find_char , n_find_char , find_char_pair , count_char , word_in_phrase , char_for_char_translate , remove_duplicate_chars , str_delete , str_insert , sget_line , const_sget_line , sget_line_2 , const_sget_line_2 , get_str_indent , last_char , kjb_reverse , output_str