Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F20065104
assuan-io.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
1 KB
Subscribers
None
assuan-io.c
View Options
/* assuan-io.c - Wraps the read and write functions.
* Copyright (C) 2002, 2004 Free Software Foundation, Inc.
*
* This file is part of Assuan.
*
* Assuan 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 2.1 of
* the License, or (at your option) any later version.
*
* Assuan 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include
"assuan-defs.h"
#include
<sys/types.h>
#include
<unistd.h>
#ifdef _WIN32
#include
<windows.h>
#endif
extern
ssize_t
pth_read
(
int
fd
,
void
*
buffer
,
size_t
size
);
extern
ssize_t
pth_write
(
int
fd
,
const
void
*
buffer
,
size_t
size
);
#ifndef _WIN32
#pragma weak pth_read
#pragma weak pth_write
#endif
ssize_t
_assuan_simple_read
(
assuan_context_t
ctx
,
void
*
buffer
,
size_t
size
)
{
#ifndef _WIN32
return
(
pth_read
?
pth_read
:
read
)
(
ctx
->
inbound
.
fd
,
buffer
,
size
);
#else
return
pth_read
?
pth_read
(
ctx
->
inbound
.
fd
,
buffer
,
size
)
:
recv
(
ctx
->
inbound
.
fd
,
buffer
,
size
,
0
);
#endif
}
ssize_t
_assuan_simple_write
(
assuan_context_t
ctx
,
const
void
*
buffer
,
size_t
size
)
{
#ifndef _WIN32
return
(
pth_write
?
pth_write
:
write
)
(
ctx
->
outbound
.
fd
,
buffer
,
size
);
#else
return
pth_write
?
pth_write
(
ctx
->
outbound
.
fd
,
buffer
,
size
)
:
send
(
ctx
->
outbound
.
fd
,
buffer
,
size
,
0
);
#endif
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sun, Feb 23, 8:03 PM (55 m, 36 s)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
fa/3f/71071a8466516fcbd37e66668c48
Attached To
rA Assuan
Event Timeline
Log In to Comment