Blame src/include/k5-plugin.h

Packit fd8b60
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
Packit fd8b60
/*
Packit fd8b60
 * Copyright (C) 2006 Massachusetts Institute of Technology.
Packit fd8b60
 * All Rights Reserved.
Packit fd8b60
 *
Packit fd8b60
 * This software is being provided to you, the LICENSEE, by the
Packit fd8b60
 * Massachusetts Institute of Technology (M.I.T.) under the following
Packit fd8b60
 * license.  By obtaining, using and/or copying this software, you agree
Packit fd8b60
 * that you have read, understood, and will comply with these terms and
Packit fd8b60
 * conditions:
Packit fd8b60
 *
Packit fd8b60
 * Export of this software from the United States of America may
Packit fd8b60
 * require a specific license from the United States Government.
Packit fd8b60
 * It is the responsibility of any person or organization contemplating
Packit fd8b60
 * export to obtain such a license before exporting.
Packit fd8b60
 *
Packit fd8b60
 * WITHIN THAT CONSTRAINT, permission to use, copy, modify and distribute
Packit fd8b60
 * this software and its documentation for any purpose and without fee or
Packit fd8b60
 * royalty is hereby granted, provided that you agree to comply with the
Packit fd8b60
 * following copyright notice and statements, including the disclaimer, and
Packit fd8b60
 * that the same appear on ALL copies of the software and documentation,
Packit fd8b60
 * including modifications that you make for internal use or for
Packit fd8b60
 * distribution:
Packit fd8b60
 *
Packit fd8b60
 * THIS SOFTWARE IS PROVIDED "AS IS", AND M.I.T. MAKES NO REPRESENTATIONS
Packit fd8b60
 * OR WARRANTIES, EXPRESS OR IMPLIED.  By way of example, but not
Packit fd8b60
 * limitation, M.I.T. MAKES NO REPRESENTATIONS OR WARRANTIES OF
Packit fd8b60
 * MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF
Packit fd8b60
 * THE LICENSED SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY
Packit fd8b60
 * PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
Packit fd8b60
 *
Packit fd8b60
 * The name of the Massachusetts Institute of Technology or M.I.T. may NOT
Packit fd8b60
 * be used in advertising or publicity pertaining to distribution of the
Packit fd8b60
 * software.  Title to copyright in this software and any associated
Packit fd8b60
 * documentation shall at all times remain with M.I.T., and USER agrees to
Packit fd8b60
 * preserve same.
Packit fd8b60
 *
Packit fd8b60
 * Furthermore if you modify this software you must label
Packit fd8b60
 * your software as modified software and not distribute it in such a
Packit fd8b60
 * fashion that it might be confused with the original M.I.T. software.
Packit fd8b60
 */
Packit fd8b60
Packit fd8b60
/* Just those definitions which are needed by util/support/plugins.c,
Packit fd8b60
   which gets compiled before util/et is built, which happens before
Packit fd8b60
   we can construct krb5.h, which is included by k5-int.h.
Packit fd8b60
Packit fd8b60
   So, no krb5 types.  */
Packit fd8b60
Packit fd8b60
#ifndef K5_PLUGIN_H
Packit fd8b60
#define K5_PLUGIN_H
Packit fd8b60
Packit fd8b60
#if defined(_MSDOS) || defined(_WIN32)
Packit fd8b60
#include "win-mac.h"
Packit fd8b60
#endif
Packit fd8b60
#include "autoconf.h"
Packit fd8b60
#ifndef KRB5_CALLCONV
Packit fd8b60
#define KRB5_CALLCONV
Packit fd8b60
#define KRB5_CALLCONV_C
Packit fd8b60
#endif
Packit fd8b60
Packit fd8b60
#include "k5-err.h"
Packit fd8b60
Packit fd8b60
/*
Packit fd8b60
 * Plugins normally export fixed symbol names, but when statically
Packit fd8b60
 * linking plugins, we need a different symbol name for each plugin.
Packit fd8b60
 * The first argument to PLUGIN_SYMBOL_NAME acts as the
Packit fd8b60
 * differentiator, and is only used for static plugin linking.
Packit fd8b60
 *
Packit fd8b60
 * Although this macro (and thus this header file) are used in plugins
Packit fd8b60
 * whose code lies inside the krb5 tree, plugins maintained separately
Packit fd8b60
 * from the krb5 tree do not need it; they can just use the fixed
Packit fd8b60
 * symbol name unconditionally.
Packit fd8b60
 */
Packit fd8b60
#ifdef STATIC_PLUGINS
Packit fd8b60
#define PLUGIN_SYMBOL_NAME(prefix, symbol) prefix ## _ ## symbol
Packit fd8b60
#else
Packit fd8b60
#define PLUGIN_SYMBOL_NAME(prefix, symbol) symbol
Packit fd8b60
#endif
Packit fd8b60
Packit fd8b60
struct plugin_file_handle;      /* opaque */
Packit fd8b60
Packit fd8b60
struct plugin_dir_handle {
Packit fd8b60
    /* This points to a NULL-terminated list of pointers to plugin_file_handle structs */
Packit fd8b60
    struct plugin_file_handle **files;
Packit fd8b60
};
Packit fd8b60
#define PLUGIN_DIR_INIT(P) ((P)->files = NULL)
Packit fd8b60
#define PLUGIN_DIR_OPEN(P) ((P)->files != NULL)
Packit fd8b60
Packit fd8b60
long KRB5_CALLCONV
Packit fd8b60
krb5int_open_plugin (const char *, struct plugin_file_handle **, struct errinfo *);
Packit fd8b60
void KRB5_CALLCONV
Packit fd8b60
krb5int_close_plugin (struct plugin_file_handle *);
Packit fd8b60
Packit fd8b60
long KRB5_CALLCONV
Packit fd8b60
krb5int_get_plugin_data (struct plugin_file_handle *, const char *, void **,
Packit fd8b60
                         struct errinfo *);
Packit fd8b60
Packit fd8b60
long KRB5_CALLCONV
Packit fd8b60
krb5int_get_plugin_func (struct plugin_file_handle *, const char *,
Packit fd8b60
                         void (**)(), struct errinfo *);
Packit fd8b60
Packit fd8b60
Packit fd8b60
long KRB5_CALLCONV
Packit fd8b60
krb5int_open_plugin_dirs (const char * const *, const char * const *,
Packit fd8b60
                          struct plugin_dir_handle *, struct errinfo *);
Packit fd8b60
void KRB5_CALLCONV
Packit fd8b60
krb5int_close_plugin_dirs (struct plugin_dir_handle *);
Packit fd8b60
Packit fd8b60
long KRB5_CALLCONV
Packit fd8b60
krb5int_get_plugin_dir_data (struct plugin_dir_handle *, const char *,
Packit fd8b60
                             void ***, struct errinfo *);
Packit fd8b60
void KRB5_CALLCONV
Packit fd8b60
krb5int_free_plugin_dir_data (void **);
Packit fd8b60
Packit fd8b60
long KRB5_CALLCONV
Packit fd8b60
krb5int_get_plugin_dir_func (struct plugin_dir_handle *, const char *,
Packit fd8b60
                             void (***)(void), struct errinfo *);
Packit fd8b60
void KRB5_CALLCONV
Packit fd8b60
krb5int_free_plugin_dir_func (void (**)(void));
Packit fd8b60
Packit fd8b60
#endif /* K5_PLUGIN_H */