Logo Search packages:      
Sourcecode: nbsmtp version File versions  Download package

int buffer_mail ( string_t buffer  ) 

Reads stdin into buffer (partially). more_data means message not fully read.

Parameters:
[out] buffer A pointer to store what we read
Returns:
0 if we read the hole message 1 in other case (more data needs to be read)

Definition at line 254 of file original.c.

References string::len, and string::str.

{
      int i, more_data, c;

      memset(buffer->str, 0, buffer->len);

      for ( i=0; i < buffer->len-1; i++ )
      {
            c = fgetc(stdin);
            buffer->str[i] = c;
            if ( c == EOF )
            {
                  buffer->str[i] = '\0'; /* End of stdin */
                  return 0;
            }
      }

      more_data = (buffer->len && buffer->str[0] == '\0' ? 0 : 1); /* Empty string? */

      return more_data;
}


Generated by  Doxygen 1.6.0   Back to index