Deleted Added
full compact
ncpl_file.c (52153) ncpl_file.c (52704)
1/*
2 * Copyright (c) 1999, Boris Popov
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 15 unchanged lines hidden (view full) ---

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
1/*
2 * Copyright (c) 1999, Boris Popov
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 15 unchanged lines hidden (view full) ---

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * $FreeBSD: head/lib/libncp/ncpl_file.c 52153 1999-10-12 11:56:41Z bp $
32 * $FreeBSD: head/lib/libncp/ncpl_file.c 52704 1999-10-31 03:39:03Z bp $
33 */
34#include <sys/param.h>
35#include <sys/ioctl.h>
36#include <errno.h>
37#include <stdio.h>
38#include <fcntl.h>
39#include <unistd.h>
40#include <strings.h>
41
42#include <netncp/ncp_lib.h>
43#include <netncp/ncp_file.h>
44#include <nwfs/nwfs.h>
45
46int
33 */
34#include <sys/param.h>
35#include <sys/ioctl.h>
36#include <errno.h>
37#include <stdio.h>
38#include <fcntl.h>
39#include <unistd.h>
40#include <strings.h>
41
42#include <netncp/ncp_lib.h>
43#include <netncp/ncp_file.h>
44#include <nwfs/nwfs.h>
45
46int
47ncp_read(int connid, ncp_fh *fh, off_t offset, size_t count, char *target) {
47ncp_read(NWCONN_HANDLE connid, ncp_fh *fh, off_t offset, size_t count, char *target) {
48 int result;
49 struct ncp_rw rwrq;
50 DECLARE_RQ;
51
52 ncp_init_request(conn);
53 ncp_add_byte(conn, NCP_CONN_READ);
54 rwrq.nrw_fh = *fh;
55 rwrq.nrw_base = target;
56 rwrq.nrw_cnt = count;
57 rwrq.nrw_offset = offset;
58 ncp_add_mem(conn, &rwrq, sizeof(rwrq));
59 if ((result = ncp_conn_request(connid, conn)) < 0)
60 return -1;
61 return result;
62}
63
64int
48 int result;
49 struct ncp_rw rwrq;
50 DECLARE_RQ;
51
52 ncp_init_request(conn);
53 ncp_add_byte(conn, NCP_CONN_READ);
54 rwrq.nrw_fh = *fh;
55 rwrq.nrw_base = target;
56 rwrq.nrw_cnt = count;
57 rwrq.nrw_offset = offset;
58 ncp_add_mem(conn, &rwrq, sizeof(rwrq));
59 if ((result = ncp_conn_request(connid, conn)) < 0)
60 return -1;
61 return result;
62}
63
64int
65ncp_write(int connid, ncp_fh *fh, off_t offset, size_t count, char *source)
65ncp_write(NWCONN_HANDLE connid, ncp_fh *fh, off_t offset, size_t count, char *source)
66{
67 int result;
68 struct ncp_rw rwrq;
69 DECLARE_RQ;
70
71 ncp_init_request(conn);
72 ncp_add_byte(conn, NCP_CONN_WRITE);
73 rwrq.nrw_fh = *fh;

--- 190 unchanged lines hidden ---
66{
67 int result;
68 struct ncp_rw rwrq;
69 DECLARE_RQ;
70
71 ncp_init_request(conn);
72 ncp_add_byte(conn, NCP_CONN_WRITE);
73 rwrq.nrw_fh = *fh;

--- 190 unchanged lines hidden ---