Server 0.0.1
HTTP/REST server implementation

include/stream/stream.h File Reference

#include <sys/types.h>
#include <openssl/ssl.h>
#include "class.h"
Include dependency graph for stream.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Stream

Typedefs

typedef enum e_StreamHandleType StreamHandleType

Enumerations

enum  e_StreamHandleType { STREAM_FD = 0, STREAM_SSL }

Functions

ssize_t streamRead (Stream, void *, size_t)
ssize_t streamWrite (Stream, void *, size_t)

Detailed Description

Author:
Georg Hopp

Copyright © 2012 Georg Hopp

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Definition in file stream.h.


Typedef Documentation


Enumeration Type Documentation

Enumerator:
STREAM_FD 
STREAM_SSL 

Definition at line 31 of file stream.h.


Function Documentation

ssize_t streamRead ( Stream  ,
void *  ,
size_t   
)

Definition at line 29 of file read.c.

{
        ssize_t done;

        switch(this->type) {
                case STREAM_FD:
                        done = read((this->handle).fd, buf, count);
                        break;

                case STREAM_SSL:
                        done = SSL_read((this->handle).ssl, buf, count);
                        break;

                default:
                        break;
        }

        return done;
}

Here is the caller graph for this function:

ssize_t streamWrite ( Stream  ,
void *  ,
size_t   
)

Definition at line 29 of file write.c.

{
        ssize_t done;

        switch(this->type) {
                case STREAM_FD:
                        done = write((this->handle).fd, buf, count);
                        break;

                case STREAM_SSL:
                        done = SSL_write((this->handle).ssl, buf, count);
                        break;

                default:
                        break;
        }

        return done;
}

Here is the caller graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines