182SN/A/*-
21357SN/A * Copyright (c) 2004 Michael Bushkov <bushman@rsu.ru>
382SN/A * All rights reserved.
482SN/A *
582SN/A * Redistribution and use in source and binary forms, with or without
682SN/A * modification, are permitted provided that the following conditions
7553SN/A * are met:
882SN/A * 1. Redistributions of source code must retain the above copyright
9553SN/A *    notice, this list of conditions and the following disclaimer.
1082SN/A * 2. Redistributions in binary form must reproduce the above copyright
1182SN/A *    notice, this list of conditions and the following disclaimer in the
1282SN/A *    documentation and/or other materials provided with the distribution.
1382SN/A *
1482SN/A * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1582SN/A * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1682SN/A * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1782SN/A * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1882SN/A * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1982SN/A * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2082SN/A * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21553SN/A * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22553SN/A * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23553SN/A * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2482SN/A * SUCH DAMAGE.
253170Svasya */
2682SN/A
2782SN/A#ifndef __NSCD_NSCDCLI_H__
2882SN/A#define __NSCD_NSCDCLI_H__
29220SN/A
3082SN/Astruct nscd_connection_params {
31220SN/A	char *socket_path;
3282SN/A	struct timeval timeout;
3382SN/A};
34220SN/A
3582SN/Astruct nscd_connection_ {
36332SN/A	int sockfd;
37580SN/A	int read_queue;
38332SN/A	int write_queue;
39332SN/A};
40332SN/A
4182SN/A/* simple abstractions for not to write "struct" every time */
4282SN/Atypedef struct nscd_connection_ *nscd_connection;
4382SN/Atypedef struct nscd_connection_ *nscd_mp_write_session;
4482SN/Atypedef struct nscd_connection_ *nscd_mp_read_session;
45220SN/A
4682SN/A#define	INVALID_NSCD_CONNECTION	(NULL)
4782SN/A
4882SN/A/* initialization/destruction routines */
4982SN/Anscd_connection	open_nscd_connection__(struct nscd_connection_params const *);
5082SN/Avoid close_nscd_connection__(nscd_connection);
5182SN/Aint nscd_transform__(nscd_connection, const char *, int);
5282SN/A
53220SN/A#endif
5482SN/A