ms_strncpclean man page

ms_strncpclean — Non-standard string copying

Synopsis

#include <libmseed.h>

int  ms_strncpclean ( char *dest, const char *source, int length );

int  ms_strncpopen ( char *dest, const char *source, int length );

Description

ms_strncpclean copies up to length characters from source to dest while removing all spaces.  The result is left justified and always NULL terminated.  The destination string must have enough room for the non-space characters within length and the NULL terminator, a maximum of length + 1.

ms_strncpopen copies length characters from source to dest padding the right side with spaces if needed and leaves the string open-ended (unterminated).  The result will always be length characters and will never be NULL terminated.

These routines are useful for converting to and from known length SEED string fields.

Return Values

ms_strncpclean returns the number of characters (not including the terminating NULL) in the destination string.

ms_strncpopen returns the number of characters copied from the source string.

Author

Chad Trabant
IRIS Data Management Center

Info

2004/11/22 Libmseed API