SDDS ToolKit Programs and Libraries for C and Python
All Classes Files Functions Variables Macros Pages
is_blank.c File Reference

Detailed Description

Implementation of is_blank function.

License
This file is distributed under the terms of the Software License Agreement found in the file LICENSE included with this distribution.
Author
M. Borland, C. Saunders, R. Soliday

Definition in file is_blank.c.

#include "mdb.h"
#include <ctype.h>

Go to the source code of this file.

Functions

long is_blank (char *s)
 Determine whether a string is composed entirely of whitespace characters.
 

Function Documentation

◆ is_blank()

long is_blank ( char * s)

Determine whether a string is composed entirely of whitespace characters.

This function checks each character in the input string to verify if it is a space character.

Parameters
sThe null-terminated string to be checked.
Returns
Returns 1 if the string is all whitespace, otherwise returns 0.

Definition at line 27 of file is_blank.c.

27 {
28 register char *ptr;
29
30 ptr = s;
31 while (*ptr && isspace(*ptr))
32 ptr++;
33 if (*ptr)
34 return (0);
35 return (1);
36}