{The S-lang C Library Reference}: SLang_pop_string

Next Previous Contents

## 70. SLang_pop_string

Synopsis

  Pop a string from the stack

Usage

  `int SLang_pop_string(char **strptr, int *do_free)`

Description

  The `SLpop_string` function pops a string from the stack and returns it as a malloced pointer via `strptr`. After the function returns, the integer pointed to by the second parameter will be set to a non-zero value if `*strptr` should be freed via `free` or `SLfree`. If successful, `SLpop_string` returns zero. However, if the top stack item is not of type `SLANG_STRING_TYPE`, or the stack is empty, the function will return `-1` and set `SLang_Error` accordingly.

Notes

  This function is considered obsolete and should not be used by applications. If one requires a malloced string for modification, `SLpop_string` should be used. If one requires a constant string that will not be modifed by the application, `SLang_pop_slstring` should be used.

See Also

  `SLang_pop_slstring, SLpop_string`

Next Previous Contents