Path: blob/main/crypto/krb5/src/include/k5-plugin.h
34879 views
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */1/*2* Copyright (C) 2006 Massachusetts Institute of Technology.3* All Rights Reserved.4*5* This software is being provided to you, the LICENSEE, by the6* Massachusetts Institute of Technology (M.I.T.) under the following7* license. By obtaining, using and/or copying this software, you agree8* that you have read, understood, and will comply with these terms and9* conditions:10*11* Export of this software from the United States of America may12* require a specific license from the United States Government.13* It is the responsibility of any person or organization contemplating14* export to obtain such a license before exporting.15*16* WITHIN THAT CONSTRAINT, permission to use, copy, modify and distribute17* this software and its documentation for any purpose and without fee or18* royalty is hereby granted, provided that you agree to comply with the19* following copyright notice and statements, including the disclaimer, and20* that the same appear on ALL copies of the software and documentation,21* including modifications that you make for internal use or for22* distribution:23*24* THIS SOFTWARE IS PROVIDED "AS IS", AND M.I.T. MAKES NO REPRESENTATIONS25* OR WARRANTIES, EXPRESS OR IMPLIED. By way of example, but not26* limitation, M.I.T. MAKES NO REPRESENTATIONS OR WARRANTIES OF27* MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF28* THE LICENSED SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY29* PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.30*31* The name of the Massachusetts Institute of Technology or M.I.T. may NOT32* be used in advertising or publicity pertaining to distribution of the33* software. Title to copyright in this software and any associated34* documentation shall at all times remain with M.I.T., and USER agrees to35* preserve same.36*37* Furthermore if you modify this software you must label38* your software as modified software and not distribute it in such a39* fashion that it might be confused with the original M.I.T. software.40*/4142/* Just those definitions which are needed by util/support/plugins.c,43which gets compiled before util/et is built, which happens before44we can construct krb5.h, which is included by k5-int.h.4546So, no krb5 types. */4748#ifndef K5_PLUGIN_H49#define K5_PLUGIN_H5051#if defined(_MSDOS) || defined(_WIN32)52#include "win-mac.h"53#endif54#include "autoconf.h"55#ifndef KRB5_CALLCONV56#define KRB5_CALLCONV57#define KRB5_CALLCONV_C58#endif5960#include "k5-err.h"6162/*63* Plugins normally export fixed symbol names, but when statically64* linking plugins, we need a different symbol name for each plugin.65* The first argument to PLUGIN_SYMBOL_NAME acts as the66* differentiator, and is only used for static plugin linking.67*68* Although this macro (and thus this header file) are used in plugins69* whose code lies inside the krb5 tree, plugins maintained separately70* from the krb5 tree do not need it; they can just use the fixed71* symbol name unconditionally.72*/73#ifdef STATIC_PLUGINS74#define PLUGIN_SYMBOL_NAME(prefix, symbol) prefix ## _ ## symbol75#else76#define PLUGIN_SYMBOL_NAME(prefix, symbol) symbol77#endif7879struct plugin_file_handle; /* opaque */8081struct plugin_dir_handle {82/* This points to a NULL-terminated list of pointers to plugin_file_handle structs */83struct plugin_file_handle **files;84};85#define PLUGIN_DIR_INIT(P) ((P)->files = NULL)86#define PLUGIN_DIR_OPEN(P) ((P)->files != NULL)8788long KRB5_CALLCONV89krb5int_open_plugin (const char *, struct plugin_file_handle **, struct errinfo *);90void KRB5_CALLCONV91krb5int_close_plugin (struct plugin_file_handle *);9293long KRB5_CALLCONV94krb5int_get_plugin_data (struct plugin_file_handle *, const char *, void **,95struct errinfo *);9697long KRB5_CALLCONV98krb5int_get_plugin_func (struct plugin_file_handle *, const char *,99void (**)(void), struct errinfo *);100101102long KRB5_CALLCONV103krb5int_open_plugin_dirs (const char * const *, const char * const *,104struct plugin_dir_handle *, struct errinfo *);105void KRB5_CALLCONV106krb5int_close_plugin_dirs (struct plugin_dir_handle *);107108long KRB5_CALLCONV109krb5int_get_plugin_dir_data (struct plugin_dir_handle *, const char *,110void ***, struct errinfo *);111void KRB5_CALLCONV112krb5int_free_plugin_dir_data (void **);113114long KRB5_CALLCONV115krb5int_get_plugin_dir_func (struct plugin_dir_handle *, const char *,116void (***)(void), struct errinfo *);117void KRB5_CALLCONV118krb5int_free_plugin_dir_func (void (**)(void));119120#endif /* K5_PLUGIN_H */121122123