/*
* Copyright (c) 1999, 2000 Motoyuki Kasahara.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification, immediately at the beginning of the file.
* 2. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef PCCARD_LOW_H
#define PCCARD_LOW_H
#include <pccard_error.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Maximum length of a request sent to pccardd.
*/
#define PCCARD_MAX_REQUEST_LENGTH 31
/*
* Maximum length of a response received from pccardd.
*/
#define PCCARD_MAX_RESPONSE_LENGTH 511
/*
* Maximum length of an error message.
*/
#define PCCARD_MAX_ERROR_MESSAGE_LENGTH 127
/*
* Card status list.
*/
#define PCCARD_STATUS_EMPTY 0
#define PCCARD_STATUS_FILLED 1
#define PCCARD_STATUS_INACTIVE 2
#define PCCARD_STATUS_UNKNOWN 9
/*
* Function declarations.
*/
#if defined(__STDC__) || defined(__cplusplus)
int pccard_open_socket(void);
void pccard_close_socket(void);
int pccard_send_request(const char *);
int pccard_wait_response(void);
int pccard_receive_response(char *);
int pccard_query_number_of_slots(void);
int pccard_query_slot_information(int, char *, char *, char *, int *);
int pccard_query_insertion(int);
int pccard_query_removal(int);
int pccard_status_changed(int *, char *, char *, char *, int *);
void pccard_message_to_stderr(const char *, ...);
void pccard_message_to_nowhere(const char *, ...);
void pccard_set_error_message_handler(void (*)(const char *, ...));
void pccard_set_warning_message_handler(void (*)(const char *, ...));
void (*pccard_error_message_handler(void))(const char *, ...);
void (*pccard_warning_message_handler(void))(const char *, ...);
int pccard_socket_file(void);
#else /* not defined(__STDC__) && not defined(__cplusplus) */
int pccard_open_socket();
void pccard_close_socket();
int pccard_send_request();
int pccard_wait_response();
int pccard_receive_response();
int pccard_query_number_of_slots();
int pccard_query_slot_information();
int pccard_query_insertion();
int pccard_query_removal();
int pccard_status_changed();
const char *pccard_error_message();
void pccard_set_error_message();
int pccard_socket_file();
#endif /* not defined(__STDC__) && not defined(__cplusplus) */
#ifdef __cplusplus
}
#endif
#endif /* not PCCARD_LOW_H */
syntax highlighted by Code2HTML, v. 0.9.1