/* assuan.h - Definitions for the Assuan IPC library             -*- c -*-
 * Copyright (C) 2001-2013 Free Software Foundation, Inc.
 * Copyright (C) 2001-2021,2023-2024 g10 Code GmbH
 *
 * 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, see <http://www.gnu.org/licenses/>.
 * SPDX-License-Identifier: LGPL-2.1-or-later
 *
 * Do not edit.  Generated from assuan.h.in by mkheader for linux-gnu.
 */

/* Compile time configuration:
 *
 * #define _ASSUAN_NO_SOCKET_WRAPPER
 *
 * Do not include the definitions for the socket wrapper feature.
 */

#ifndef ASSUAN_H
#define ASSUAN_H

#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdarg.h>

#ifndef _ASSUAN_NO_SOCKET_WRAPPER
#include <sys/socket.h>
#endif /*!_ASSUAN_NO_SOCKET_WRAPPER*/

typedef struct msghdr *assuan_msghdr_t;
typedef pid_t assuan_pid_t;

#include <gpg-error.h>

#ifdef __cplusplus
extern "C"
{
#if 0
}
#endif
#endif

/* The version of this header should match the one of the library.  Do
 * not use this symbol in your application; use assuan_check_version
 * instead.  */
#define ASSUAN_VERSION "3.0.0"

/* The version number of this header.  It may be used to handle minor
 * API incompatibilities.  */
#define ASSUAN_VERSION_NUMBER 0x030000


/* Check for compiler features.  */
#if __GNUC__
#define _ASSUAN_GCC_VERSION (__GNUC__ * 10000 \
                            + __GNUC_MINOR__ * 100 \
                            + __GNUC_PATCHLEVEL__)

#if _ASSUAN_GCC_VERSION > 30100
#define _ASSUAN_DEPRECATED  __attribute__ ((__deprecated__))
#endif
#endif
#ifndef _ASSUAN_DEPRECATED
#define _ASSUAN_DEPRECATED
#endif


#define ASSUAN_LINELENGTH 1002 /* 1000 + [CR,]LF */

struct assuan_context_s;
typedef struct assuan_context_s *assuan_context_t;

typedef int assuan_fd_t;
#define ASSUAN_INVALID_FD  (-1)
#define ASSUAN_INVALID_PID ((pid_t) -1)
static GPG_ERR_INLINE assuan_fd_t
assuan_fd_from_posix_fd (int fd)
{
  return fd;
}


assuan_fd_t assuan_fdopen (int fd);

/* Under Windows Assuan features an emulation of Unix domain sockets
   based on a local TCP connections.  To implement access permissions
   based on file permissions a nonce is used which is expected by the
   server as the first bytes received.  On POSIX systems this is a
   dummy structure. */
struct assuan_sock_nonce_s
{
  size_t length;
};
typedef struct assuan_sock_nonce_s assuan_sock_nonce_t;

