just added stream.c skel - stream implementation;
parent
7bacf72d55
commit
b3f81a786e
@ -0,0 +1,114 @@
|
|||||||
|
/*
|
||||||
|
* Secure X Message Passing Library v2 implementation.
|
||||||
|
* (sxmplv2) it superseed all versions before due to the:
|
||||||
|
* - memory consumption
|
||||||
|
* - new features such as pulse emitting
|
||||||
|
* - performance optimization
|
||||||
|
*
|
||||||
|
* (c) Askele Group 2013-2015 <http://askele.com>
|
||||||
|
* (c) Alexander Vdolainen 2013-2015,2016 <avdolainen@zoho.com>
|
||||||
|
*
|
||||||
|
* libsxmp is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU Lesser General Public License as published
|
||||||
|
* by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* libsxmp 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 Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.";
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/mman.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
|
#include <openssl/ssl.h>
|
||||||
|
#include <openssl/err.h>
|
||||||
|
#include <openssl/engine.h>
|
||||||
|
|
||||||
|
#include <tdata/usrtc.h>
|
||||||
|
#include <tdata/list.h>
|
||||||
|
#include <sexpr/sexp.h>
|
||||||
|
|
||||||
|
#include <sxmp/limits.h>
|
||||||
|
#include <sxmp/sxmp.h>
|
||||||
|
|
||||||
|
#include "internal.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NOTE: sxstream operations (except opening process i.e. few threads
|
||||||
|
* can open different streams) are NOT _thread-safe_, please
|
||||||
|
* care about that in your own application.
|
||||||
|
*/
|
||||||
|
sxstream_t *sxstream_open(sxlink_t *link, const char *opt, int stid, int flags)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
sxstream_t *sxstream_openwch(sxlink_t *link, sxchnl_t *channel, const char *opt,
|
||||||
|
int stid, int flags)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int sxstream_close(sxstream_t *stream)
|
||||||
|
{
|
||||||
|
return SXE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* binary stream operations */
|
||||||
|
/*
|
||||||
|
* NOTE: it will be done with with a copy paste,
|
||||||
|
* there are todo - implement it with oilite style.
|
||||||
|
*/
|
||||||
|
size_t sxstream_bread(sxstream_t *stream, void *buf, size_t buf_len)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t sxstream_breadat(sxstream_t *stream, void *buf, size_t buf_len, off_t off)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t sxstream_bwriteat(sxstream_t *stream, const void *buf,
|
||||||
|
size_t buf_len, off_t off)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t sxstream_bsyncat(sxstream_t *stream, void *buf, size_t buf_len, off_t off)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NOTE: returning value for reading from entry streams
|
||||||
|
* shouldn't be managed, it's done by close operation.
|
||||||
|
* That means you should care about ridden values, since
|
||||||
|
* it might be freed on the next read operation.
|
||||||
|
*/
|
||||||
|
/* entry nonamed stream ops */
|
||||||
|
list_head_t *sxstream_read(sxstream_t *stream)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* entry named stream ops */
|
||||||
|
list_head_t *sxstream_readnamed(sxstream_t *stream)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue