Path: blob/main/crypto/krb5/src/ccapi/lib/win/OldCC/client.h
39587 views
/* ccapi/lib/win/OldCC/client.h */1/*2* Copyright 2008 Massachusetts Institute of Technology.3* All Rights Reserved.4*5* Export of this software from the United States of America may6* require a specific license from the United States Government.7* It is the responsibility of any person or organization contemplating8* export to obtain such a license before exporting.9*10* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and11* distribute this software and its documentation for any purpose and12* without fee is hereby granted, provided that the above copyright13* notice appear in all copies and that both that copyright notice and14* this permission notice appear in supporting documentation, and that15* the name of M.I.T. not be used in advertising or publicity pertaining16* to distribution of the software without specific, written prior17* permission. Furthermore if you modify this software you must label18* your software as modified software and not distribute it in such a19* fashion that it might be confused with the original M.I.T. software.20* M.I.T. makes no representations about the suitability of21* this software for any purpose. It is provided "as is" without express22* or implied warranty.23*/2425#ifndef __DLL_CLIENT_H__26#define __DLL_CLIENT_H__2728#include "autolock.hxx"29#include "init.hxx"3031class Client {32public:33static DWORD Initialize(char* ep OPTIONAL);34static DWORD Cleanup();35static DWORD Reconnect(char* ep OPTIONAL);3637static bool Initialized() { return s_init; }3839static CcOsLock sLock;4041private:42static bool s_init;4344static DWORD Disconnect();45static DWORD Connect(char* ep OPTIONAL);46};4748#define CLIENT_INIT_EX(trap, error) \49do \50{ \51INIT_INIT_EX(trap, error); \52if (!Client::Initialized()) \53{ \54DWORD status = Client::Initialize(0); \55if (status) return (trap) ? (error) : status; \56} \57} while(0)5859#endif606162