# This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.39
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

package ZNC;
use base qw(Exporter);
use base qw(DynaLoader);
package ZNCc;
bootstrap ZNC;
package ZNC;
@EXPORT = qw();

# ---------- BASE METHODS -------------

package ZNC;

sub TIEHASH {
    my ($classname,$obj) = @_;
    return bless $obj, $classname;
}

sub CLEAR { }

sub FIRSTKEY { }

sub NEXTKEY { }

sub FETCH {
    my ($self,$field) = @_;
    my $member_func = "swig_${field}_get";
    $self->$member_func();
}

sub STORE {
    my ($self,$field,$newval) = @_;
    my $member_func = "swig_${field}_set";
    $self->$member_func($newval);
}

sub this {
    my $ptr = shift;
    return tied(%$ptr);
}


# ------- FUNCTION WRAPPERS --------

package ZNC;

*SetFdCloseOnExec = *ZNCc::SetFdCloseOnExec;
*GetAddrInfo = *ZNCc::GetAddrInfo;
*GetCsockClassIdx = *ZNCc::GetCsockClassIdx;
*InitCsocket = *ZNCc::InitCsocket;
*ShutdownCsocket = *ZNCc::ShutdownCsocket;
*GetSockError = *ZNCc::GetSockError;
*TFD_ZERO = *ZNCc::TFD_ZERO;
*TFD_SET = *ZNCc::TFD_SET;
*TFD_ISSET = *ZNCc::TFD_ISSET;
*TFD_CLR = *ZNCc::TFD_CLR;
*__Perror = *ZNCc::__Perror;
*millitime = *ZNCc::millitime;
*AsPerlModule = *ZNCc::AsPerlModule;
*CreatePerlTimer = *ZNCc::CreatePerlTimer;
*CreatePerlSocket = *ZNCc::CreatePerlSocket;
*HaveIPv6 = *ZNCc::HaveIPv6;
*HaveSSL = *ZNCc::HaveSSL;
*HaveCAres = *ZNCc::HaveCAres;
*_GetSOMAXCONN = *ZNCc::_GetSOMAXCONN;
*_VPair_Add2Str = *ZNCc::_VPair_Add2Str;
*_CreateWebSubPage = *ZNCc::_CreateWebSubPage;

############# Class : ZNC::_stringlist ##############

package ZNC::_stringlist;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new__stringlist(@_);
    bless $self, $pkg if defined($self);
}

*size = *ZNCc::_stringlist_size;
*empty = *ZNCc::_stringlist_empty;
*clear = *ZNCc::_stringlist_clear;
*push = *ZNCc::_stringlist_push;
sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete__stringlist($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CUtils ##############

package ZNC::CUtils;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CUtils(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CUtils($self);
        delete $OWNER{$self};
    }
}

*GetIP = *ZNCc::CUtils_GetIP;
*GetLongIP = *ZNCc::CUtils_GetLongIP;
*SetStdoutIsTTY = *ZNCc::CUtils_SetStdoutIsTTY;
*StdoutIsTTY = *ZNCc::CUtils_StdoutIsTTY;
*SetDebug = *ZNCc::CUtils_SetDebug;
*Debug = *ZNCc::CUtils_Debug;
*PrintError = *ZNCc::CUtils_PrintError;
*PrintMessage = *ZNCc::CUtils_PrintMessage;
*PrintPrompt = *ZNCc::CUtils_PrintPrompt;
*PrintAction = *ZNCc::CUtils_PrintAction;
*PrintStatus = *ZNCc::CUtils_PrintStatus;
*sDefaultHash = *ZNCc::CUtils_sDefaultHash;
*GetSaltedHashPass = *ZNCc::CUtils_GetSaltedHashPass;
*GetSalt = *ZNCc::CUtils_GetSalt;
*SaltedMD5Hash = *ZNCc::CUtils_SaltedMD5Hash;
*SaltedSHA256Hash = *ZNCc::CUtils_SaltedSHA256Hash;
*GetPass = *ZNCc::CUtils_GetPass;
*GetInput = *ZNCc::CUtils_GetInput;
*GetBoolInput = *ZNCc::CUtils_GetBoolInput;
*GetNumInput = *ZNCc::CUtils_GetNumInput;
*GetMillTime = *ZNCc::CUtils_GetMillTime;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CException ##############

package ZNC::CException;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
*EX_Shutdown = *ZNCc::CException_EX_Shutdown;
*EX_Restart = *ZNCc::CException_EX_Restart;
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CException(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CException($self);
        delete $OWNER{$self};
    }
}

*GetType = *ZNCc::CException_GetType;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CTable ##############

package ZNC::CTable;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CTable(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CTable($self);
        delete $OWNER{$self};
    }
}

*AddColumn = *ZNCc::CTable_AddColumn;
*AddRow = *ZNCc::CTable_AddRow;
*SetCell = *ZNCc::CTable_SetCell;
*GetLine = *ZNCc::CTable_GetLine;
*GetColumnWidth = *ZNCc::CTable_GetColumnWidth;
*Clear = *ZNCc::CTable_Clear;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CSCharBuffer ##############

package ZNC::CSCharBuffer;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CSCharBuffer(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CSCharBuffer($self);
        delete $OWNER{$self};
    }
}

*__call__ = *ZNCc::CSCharBuffer___call__;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CSSockAddr ##############

package ZNC::CSSockAddr;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CSSockAddr(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CSSockAddr($self);
        delete $OWNER{$self};
    }
}

*RAF_ANY = *ZNCc::CSSockAddr_RAF_ANY;
*RAF_INET = *ZNCc::CSSockAddr_RAF_INET;
*SinFamily = *ZNCc::CSSockAddr_SinFamily;
*SinPort = *ZNCc::CSSockAddr_SinPort;
*SetIPv6 = *ZNCc::CSSockAddr_SetIPv6;
*GetIPv6 = *ZNCc::CSSockAddr_GetIPv6;
*GetSockAddrLen = *ZNCc::CSSockAddr_GetSockAddrLen;
*GetSockAddr = *ZNCc::CSSockAddr_GetSockAddr;
*GetAddr = *ZNCc::CSSockAddr_GetAddr;
*SetAFRequire = *ZNCc::CSSockAddr_SetAFRequire;
*GetAFRequire = *ZNCc::CSSockAddr_GetAFRequire;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CCron ##############

package ZNC::CCron;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CCron(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CCron($self);
        delete $OWNER{$self};
    }
}

*run = *ZNCc::CCron_run;
*StartMaxCycles = *ZNCc::CCron_StartMaxCycles;
*Start = *ZNCc::CCron_Start;
*Stop = *ZNCc::CCron_Stop;
*Pause = *ZNCc::CCron_Pause;
*UnPause = *ZNCc::CCron_UnPause;
*GetInterval = *ZNCc::CCron_GetInterval;
*GetMaxCycles = *ZNCc::CCron_GetMaxCycles;
*GetCyclesLeft = *ZNCc::CCron_GetCyclesLeft;
*isValid = *ZNCc::CCron_isValid;
*GetName = *ZNCc::CCron_GetName;
*SetName = *ZNCc::CCron_SetName;
*GetNextRun = *ZNCc::CCron_GetNextRun;
*RunJob = *ZNCc::CCron_RunJob;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::Csock ##############

package ZNC::Csock;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_Csock(@_);
    bless $self, $pkg if defined($self);
}

*GetSockObj = *ZNCc::Csock_GetSockObj;
sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_Csock($self);
        delete $OWNER{$self};
    }
}

*Dereference = *ZNCc::Csock_Dereference;
*Copy = *ZNCc::Csock_Copy;
*OUTBOUND = *ZNCc::Csock_OUTBOUND;
*LISTENER = *ZNCc::Csock_LISTENER;
*INBOUND = *ZNCc::Csock_INBOUND;
*READ_EOF = *ZNCc::Csock_READ_EOF;
*READ_ERR = *ZNCc::Csock_READ_ERR;
*READ_EAGAIN = *ZNCc::Csock_READ_EAGAIN;
*READ_CONNREFUSED = *ZNCc::Csock_READ_CONNREFUSED;
*READ_TIMEDOUT = *ZNCc::Csock_READ_TIMEDOUT;
*SEL_OK = *ZNCc::Csock_SEL_OK;
*SEL_TIMEOUT = *ZNCc::Csock_SEL_TIMEOUT;
*SEL_EAGAIN = *ZNCc::Csock_SEL_EAGAIN;
*SEL_ERR = *ZNCc::Csock_SEL_ERR;
*SSL23 = *ZNCc::Csock_SSL23;
*SSL2 = *ZNCc::Csock_SSL2;
*SSL3 = *ZNCc::Csock_SSL3;
*TLS1 = *ZNCc::Csock_TLS1;
*CST_START = *ZNCc::Csock_CST_START;
*CST_DNS = *ZNCc::Csock_CST_DNS;
*CST_BINDVHOST = *ZNCc::Csock_CST_BINDVHOST;
*CST_DESTDNS = *ZNCc::Csock_CST_DESTDNS;
*CST_CONNECT = *ZNCc::Csock_CST_CONNECT;
*CST_CONNECTSSL = *ZNCc::Csock_CST_CONNECTSSL;
*CST_OK = *ZNCc::Csock_CST_OK;
*CLT_DONT = *ZNCc::Csock_CLT_DONT;
*CLT_NOW = *ZNCc::Csock_CLT_NOW;
*CLT_AFTERWRITE = *ZNCc::Csock_CLT_AFTERWRITE;
*CLT_DEREFERENCE = *ZNCc::Csock_CLT_DEREFERENCE;
*__lshift__ = *ZNCc::Csock___lshift__;
*Connect = *ZNCc::Csock_Connect;
*WriteSelect = *ZNCc::Csock_WriteSelect;
*ReadSelect = *ZNCc::Csock_ReadSelect;
*Listen = *ZNCc::Csock_Listen;
*Accept = *ZNCc::Csock_Accept;
*AcceptSSL = *ZNCc::Csock_AcceptSSL;
*SSLClientSetup = *ZNCc::Csock_SSLClientSetup;
*SSLServerSetup = *ZNCc::Csock_SSLServerSetup;
*ConnectSSL = *ZNCc::Csock_ConnectSSL;
*Write = *ZNCc::Csock_Write;
*Read = *ZNCc::Csock_Read;
*GetLocalIP = *ZNCc::Csock_GetLocalIP;
*GetRemoteIP = *ZNCc::Csock_GetRemoteIP;
*ConvertAddress = *ZNCc::Csock_ConvertAddress;
*IsConnected = *ZNCc::Csock_IsConnected;
*SetIsConnected = *ZNCc::Csock_SetIsConnected;
*GetRSock = *ZNCc::Csock_GetRSock;
*SetRSock = *ZNCc::Csock_SetRSock;
*GetWSock = *ZNCc::Csock_GetWSock;
*SetWSock = *ZNCc::Csock_SetWSock;
*SetSock = *ZNCc::Csock_SetSock;
*GetSock = *ZNCc::Csock_GetSock;
*ResetTimer = *ZNCc::Csock_ResetTimer;
*PauseRead = *ZNCc::Csock_PauseRead;
*UnPauseRead = *ZNCc::Csock_UnPauseRead;
*IsReadPaused = *ZNCc::Csock_IsReadPaused;
*TMO_READ = *ZNCc::Csock_TMO_READ;
*TMO_WRITE = *ZNCc::Csock_TMO_WRITE;
*TMO_ACCEPT = *ZNCc::Csock_TMO_ACCEPT;
*TMO_ALL = *ZNCc::Csock_TMO_ALL;
*SetTimeout = *ZNCc::Csock_SetTimeout;
*SetTimeoutType = *ZNCc::Csock_SetTimeoutType;
*GetTimeout = *ZNCc::Csock_GetTimeout;
*GetTimeoutType = *ZNCc::Csock_GetTimeoutType;
*CheckTimeout = *ZNCc::Csock_CheckTimeout;
*PushBuff = *ZNCc::Csock_PushBuff;
*GetInternalReadBuffer = *ZNCc::Csock_GetInternalReadBuffer;
*GetInternalWriteBuffer = *ZNCc::Csock_GetInternalWriteBuffer;
*SetMaxBufferThreshold = *ZNCc::Csock_SetMaxBufferThreshold;
*GetMaxBufferThreshold = *ZNCc::Csock_GetMaxBufferThreshold;
*GetType = *ZNCc::Csock_GetType;
*SetType = *ZNCc::Csock_SetType;
*GetSockName = *ZNCc::Csock_GetSockName;
*SetSockName = *ZNCc::Csock_SetSockName;
*GetHostName = *ZNCc::Csock_GetHostName;
*SetHostName = *ZNCc::Csock_SetHostName;
*GetStartTime = *ZNCc::Csock_GetStartTime;
*ResetStartTime = *ZNCc::Csock_ResetStartTime;
*GetBytesRead = *ZNCc::Csock_GetBytesRead;
*ResetBytesRead = *ZNCc::Csock_ResetBytesRead;
*GetBytesWritten = *ZNCc::Csock_GetBytesWritten;
*ResetBytesWritten = *ZNCc::Csock_ResetBytesWritten;
*GetAvgRead = *ZNCc::Csock_GetAvgRead;
*GetAvgWrite = *ZNCc::Csock_GetAvgWrite;
*GetRemotePort = *ZNCc::Csock_GetRemotePort;
*GetLocalPort = *ZNCc::Csock_GetLocalPort;
*GetPort = *ZNCc::Csock_GetPort;
*SetPort = *ZNCc::Csock_SetPort;
*Close = *ZNCc::Csock_Close;
*GetCloseType = *ZNCc::Csock_GetCloseType;
*IsClosed = *ZNCc::Csock_IsClosed;
*BlockIO = *ZNCc::Csock_BlockIO;
*NonBlockingIO = *ZNCc::Csock_NonBlockingIO;
*GetSSL = *ZNCc::Csock_GetSSL;
*SetSSL = *ZNCc::Csock_SetSSL;
*GetWriteBuffer = *ZNCc::Csock_GetWriteBuffer;
*ClearWriteBuffer = *ZNCc::Csock_ClearWriteBuffer;
*SslIsEstablished = *ZNCc::Csock_SslIsEstablished;
*ConnectInetd = *ZNCc::Csock_ConnectInetd;
*ConnectFD = *ZNCc::Csock_ConnectFD;
*SetParentSockName = *ZNCc::Csock_SetParentSockName;
*GetParentSockName = *ZNCc::Csock_GetParentSockName;
*SetRate = *ZNCc::Csock_SetRate;
*GetRateBytes = *ZNCc::Csock_GetRateBytes;
*GetRateTime = *ZNCc::Csock_GetRateTime;
*Cron = *ZNCc::Csock_Cron;
*AddCron = *ZNCc::Csock_AddCron;
*DelCron = *ZNCc::Csock_DelCron;
*DelCronByAddr = *ZNCc::Csock_DelCronByAddr;
*Connected = *ZNCc::Csock_Connected;
*Disconnected = *ZNCc::Csock_Disconnected;
*Timeout = *ZNCc::Csock_Timeout;
*ReadData = *ZNCc::Csock_ReadData;
*ReadLine = *ZNCc::Csock_ReadLine;
*EnableReadLine = *ZNCc::Csock_EnableReadLine;
*DisableReadLine = *ZNCc::Csock_DisableReadLine;
*HasReadLine = *ZNCc::Csock_HasReadLine;
*ReachedMaxBuffer = *ZNCc::Csock_ReachedMaxBuffer;
*SockError = *ZNCc::Csock_SockError;
*ConnectionFrom = *ZNCc::Csock_ConnectionFrom;
*ConnectionRefused = *ZNCc::Csock_ConnectionRefused;
*ReadPaused = *ZNCc::Csock_ReadPaused;
*GetTimeSinceLastDataTransaction = *ZNCc::Csock_GetTimeSinceLastDataTransaction;
*GetLastCheckTimeout = *ZNCc::Csock_GetLastCheckTimeout;
*GetPending = *ZNCc::Csock_GetPending;
*GetConState = *ZNCc::Csock_GetConState;
*SetConState = *ZNCc::Csock_SetConState;
*CreateSocksFD = *ZNCc::Csock_CreateSocksFD;
*CloseSocksFD = *ZNCc::Csock_CloseSocksFD;
*GetBindHost = *ZNCc::Csock_GetBindHost;
*SetBindHost = *ZNCc::Csock_SetBindHost;
*DNS_VHOST = *ZNCc::Csock_DNS_VHOST;
*DNS_DEST = *ZNCc::Csock_DNS_DEST;
*DNSLookup = *ZNCc::Csock_DNSLookup;
*SetupVHost = *ZNCc::Csock_SetupVHost;
*GetIPv6 = *ZNCc::Csock_GetIPv6;
*SetIPv6 = *ZNCc::Csock_SetIPv6;
*SetAFRequire = *ZNCc::Csock_SetAFRequire;
*AllowWrite = *ZNCc::Csock_AllowWrite;
*GetCrons = *ZNCc::Csock_GetCrons;
*SetSkipConnect = *ZNCc::Csock_SetSkipConnect;
*GetAddrInfo = *ZNCc::Csock_GetAddrInfo;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CSConnection ##############

package ZNC::CSConnection;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CSConnection(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CSConnection($self);
        delete $OWNER{$self};
    }
}

*GetHostname = *ZNCc::CSConnection_GetHostname;
*GetSockName = *ZNCc::CSConnection_GetSockName;
*GetBindHost = *ZNCc::CSConnection_GetBindHost;
*GetPort = *ZNCc::CSConnection_GetPort;
*GetTimeout = *ZNCc::CSConnection_GetTimeout;
*GetIsSSL = *ZNCc::CSConnection_GetIsSSL;
*GetAFRequire = *ZNCc::CSConnection_GetAFRequire;
*SetHostname = *ZNCc::CSConnection_SetHostname;
*SetSockName = *ZNCc::CSConnection_SetSockName;
*SetBindHost = *ZNCc::CSConnection_SetBindHost;
*SetPort = *ZNCc::CSConnection_SetPort;
*SetTimeout = *ZNCc::CSConnection_SetTimeout;
*SetIsSSL = *ZNCc::CSConnection_SetIsSSL;
*SetAFRequire = *ZNCc::CSConnection_SetAFRequire;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CSSSLConnection ##############

package ZNC::CSSSLConnection;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::CSConnection ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CSSSLConnection(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CSSSLConnection($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CSListener ##############

package ZNC::CSListener;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CSListener(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CSListener($self);
        delete $OWNER{$self};
    }
}

*GetPort = *ZNCc::CSListener_GetPort;
*GetSockName = *ZNCc::CSListener_GetSockName;
*GetBindHost = *ZNCc::CSListener_GetBindHost;
*GetIsSSL = *ZNCc::CSListener_GetIsSSL;
*GetMaxConns = *ZNCc::CSListener_GetMaxConns;
*GetTimeout = *ZNCc::CSListener_GetTimeout;
*GetAFRequire = *ZNCc::CSListener_GetAFRequire;
*SetPort = *ZNCc::CSListener_SetPort;
*SetSockName = *ZNCc::CSListener_SetSockName;
*SetBindHost = *ZNCc::CSListener_SetBindHost;
*SetIsSSL = *ZNCc::CSListener_SetIsSSL;
*SetMaxConns = *ZNCc::CSListener_SetMaxConns;
*SetTimeout = *ZNCc::CSListener_SetTimeout;
*SetAFRequire = *ZNCc::CSListener_SetAFRequire;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::ZNCSocketManager ##############

package ZNC::ZNCSocketManager;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_ZNCSocketManager(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_ZNCSocketManager($self);
        delete $OWNER{$self};
    }
}

*clear = *ZNCc::ZNCSocketManager_clear;
*Cleanup = *ZNCc::ZNCSocketManager_Cleanup;
*SUCCESS = *ZNCc::ZNCSocketManager_SUCCESS;
*SELECT_ERROR = *ZNCc::ZNCSocketManager_SELECT_ERROR;
*SELECT_TIMEOUT = *ZNCc::ZNCSocketManager_SELECT_TIMEOUT;
*SELECT_TRYAGAIN = *ZNCc::ZNCSocketManager_SELECT_TRYAGAIN;
*Connect = *ZNCc::ZNCSocketManager_Connect;
*Listen = *ZNCc::ZNCSocketManager_Listen;
*Loop = *ZNCc::ZNCSocketManager_Loop;
*DynamicSelectLoop = *ZNCc::ZNCSocketManager_DynamicSelectLoop;
*AddSock = *ZNCc::ZNCSocketManager_AddSock;
*FindSockByRemotePort = *ZNCc::ZNCSocketManager_FindSockByRemotePort;
*FindSockByLocalPort = *ZNCc::ZNCSocketManager_FindSockByLocalPort;
*FindSockByName = *ZNCc::ZNCSocketManager_FindSockByName;
*FindSockByFD = *ZNCc::ZNCSocketManager_FindSockByFD;
*FindSocksByName = *ZNCc::ZNCSocketManager_FindSocksByName;
*FindSocksByRemoteHost = *ZNCc::ZNCSocketManager_FindSocksByRemoteHost;
*GetErrno = *ZNCc::ZNCSocketManager_GetErrno;
*AddCron = *ZNCc::ZNCSocketManager_AddCron;
*DelCron = *ZNCc::ZNCSocketManager_DelCron;
*DelCronByAddr = *ZNCc::ZNCSocketManager_DelCronByAddr;
*GetSelectTimeout = *ZNCc::ZNCSocketManager_GetSelectTimeout;
*SetSelectTimeout = *ZNCc::ZNCSocketManager_SetSelectTimeout;
*GetCrons = *ZNCc::ZNCSocketManager_GetCrons;
*DelSockByAddr = *ZNCc::ZNCSocketManager_DelSockByAddr;
*DelSock = *ZNCc::ZNCSocketManager_DelSock;
*SwapSockByIdx = *ZNCc::ZNCSocketManager_SwapSockByIdx;
*SwapSockByAddr = *ZNCc::ZNCSocketManager_SwapSockByAddr;
*GetBytesRead = *ZNCc::ZNCSocketManager_GetBytesRead;
*GetBytesWritten = *ZNCc::ZNCSocketManager_GetBytesWritten;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CZNCSock ##############

package ZNC::CZNCSock;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::Csock ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CZNCSock(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CZNCSock($self);
        delete $OWNER{$self};
    }
}

*ConvertAddress = *ZNCc::CZNCSock_ConvertAddress;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CSockManager ##############

package ZNC::CSockManager;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::ZNCSocketManager ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CSockManager(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CSockManager($self);
        delete $OWNER{$self};
    }
}

*ListenHost = *ZNCc::CSockManager_ListenHost;
*ListenAll = *ZNCc::CSockManager_ListenAll;
*ListenRand = *ZNCc::CSockManager_ListenRand;
*ListenAllRand = *ZNCc::CSockManager_ListenAllRand;
*Connect = *ZNCc::CSockManager_Connect;
*GetAnonConnectionCount = *ZNCc::CSockManager_GetAnonConnectionCount;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CSocket ##############

package ZNC::CSocket;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::CZNCSock ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CSocket(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CSocket($self);
        delete $OWNER{$self};
    }
}

*ReachedMaxBuffer = *ZNCc::CSocket_ReachedMaxBuffer;
*SockError = *ZNCc::CSocket_SockError;
*ConnectionFrom = *ZNCc::CSocket_ConnectionFrom;
*Connect = *ZNCc::CSocket_Connect;
*Listen = *ZNCc::CSocket_Listen;
*GetModule = *ZNCc::CSocket_GetModule;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CDCCBounce ##############

package ZNC::CDCCBounce;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::CZNCSock ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CDCCBounce(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CDCCBounce($self);
        delete $OWNER{$self};
    }
}

*DCCRequest = *ZNCc::CDCCBounce_DCCRequest;
*ReadLine = *ZNCc::CDCCBounce_ReadLine;
*ReadData = *ZNCc::CDCCBounce_ReadData;
*ReadPaused = *ZNCc::CDCCBounce_ReadPaused;
*Timeout = *ZNCc::CDCCBounce_Timeout;
*ConnectionRefused = *ZNCc::CDCCBounce_ConnectionRefused;
*ReachedMaxBuffer = *ZNCc::CDCCBounce_ReachedMaxBuffer;
*SockError = *ZNCc::CDCCBounce_SockError;
*Connected = *ZNCc::CDCCBounce_Connected;
*Disconnected = *ZNCc::CDCCBounce_Disconnected;
*GetSockObj = *ZNCc::CDCCBounce_GetSockObj;
*Shutdown = *ZNCc::CDCCBounce_Shutdown;
*PutServ = *ZNCc::CDCCBounce_PutServ;
*PutPeer = *ZNCc::CDCCBounce_PutPeer;
*IsPeerConnected = *ZNCc::CDCCBounce_IsPeerConnected;
*SetPeer = *ZNCc::CDCCBounce_SetPeer;
*SetRemoteIP = *ZNCc::CDCCBounce_SetRemoteIP;
*SetRemoteNick = *ZNCc::CDCCBounce_SetRemoteNick;
*SetRemote = *ZNCc::CDCCBounce_SetRemote;
*GetUserPort = *ZNCc::CDCCBounce_GetUserPort;
*GetRemoteIP = *ZNCc::CDCCBounce_GetRemoteIP;
*GetRemoteNick = *ZNCc::CDCCBounce_GetRemoteNick;
*GetFileName = *ZNCc::CDCCBounce_GetFileName;
*GetPeer = *ZNCc::CDCCBounce_GetPeer;
*IsRemote = *ZNCc::CDCCBounce_IsRemote;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CDCCSock ##############

package ZNC::CDCCSock;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::CZNCSock ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CDCCSock(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CDCCSock($self);
        delete $OWNER{$self};
    }
}

*ReadData = *ZNCc::CDCCSock_ReadData;
*ConnectionRefused = *ZNCc::CDCCSock_ConnectionRefused;
*SockError = *ZNCc::CDCCSock_SockError;
*Timeout = *ZNCc::CDCCSock_Timeout;
*Connected = *ZNCc::CDCCSock_Connected;
*Disconnected = *ZNCc::CDCCSock_Disconnected;
*SendPacket = *ZNCc::CDCCSock_SendPacket;
*GetSockObj = *ZNCc::CDCCSock_GetSockObj;
*OpenFile = *ZNCc::CDCCSock_OpenFile;
*Seek = *ZNCc::CDCCSock_Seek;
*SetRemoteIP = *ZNCc::CDCCSock_SetRemoteIP;
*SetRemoteNick = *ZNCc::CDCCSock_SetRemoteNick;
*SetFileName = *ZNCc::CDCCSock_SetFileName;
*SetFileOffset = *ZNCc::CDCCSock_SetFileOffset;
*GetUserPort = *ZNCc::CDCCSock_GetUserPort;
*GetRemoteNick = *ZNCc::CDCCSock_GetRemoteNick;
*GetFileName = *ZNCc::CDCCSock_GetFileName;
*GetLocalFile = *ZNCc::CDCCSock_GetLocalFile;
*GetModuleName = *ZNCc::CDCCSock_GetModuleName;
*GetFile = *ZNCc::CDCCSock_GetFile;
*GetProgress = *ZNCc::CDCCSock_GetProgress;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CFile ##############

package ZNC::CFile;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CFile(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CFile($self);
        delete $OWNER{$self};
    }
}

*FT_REGULAR = *ZNCc::CFile_FT_REGULAR;
*FT_DIRECTORY = *ZNCc::CFile_FT_DIRECTORY;
*FT_CHARACTER = *ZNCc::CFile_FT_CHARACTER;
*FT_BLOCK = *ZNCc::CFile_FT_BLOCK;
*FT_FIFO = *ZNCc::CFile_FT_FIFO;
*FT_LINK = *ZNCc::CFile_FT_LINK;
*FT_SOCK = *ZNCc::CFile_FT_SOCK;
*SetFileName = *ZNCc::CFile_SetFileName;
*IsReg = *ZNCc::CFile_IsReg;
*IsDir = *ZNCc::CFile_IsDir;
*IsChr = *ZNCc::CFile_IsChr;
*IsBlk = *ZNCc::CFile_IsBlk;
*IsFifo = *ZNCc::CFile_IsFifo;
*IsLnk = *ZNCc::CFile_IsLnk;
*IsSock = *ZNCc::CFile_IsSock;
*FType = *ZNCc::CFile_FType;
*FA_Name = *ZNCc::CFile_FA_Name;
*FA_Size = *ZNCc::CFile_FA_Size;
*FA_ATime = *ZNCc::CFile_FA_ATime;
*FA_MTime = *ZNCc::CFile_FA_MTime;
*FA_CTime = *ZNCc::CFile_FA_CTime;
*FA_UID = *ZNCc::CFile_FA_UID;
*Exists = *ZNCc::CFile_Exists;
*GetSize = *ZNCc::CFile_GetSize;
*GetATime = *ZNCc::CFile_GetATime;
*GetMTime = *ZNCc::CFile_GetMTime;
*GetCTime = *ZNCc::CFile_GetCTime;
*GetUID = *ZNCc::CFile_GetUID;
*GetGID = *ZNCc::CFile_GetGID;
*GetInfo = *ZNCc::CFile_GetInfo;
*Delete = *ZNCc::CFile_Delete;
*Move = *ZNCc::CFile_Move;
*Copy = *ZNCc::CFile_Copy;
*Chmod = *ZNCc::CFile_Chmod;
*Seek = *ZNCc::CFile_Seek;
*Truncate = *ZNCc::CFile_Truncate;
*Sync = *ZNCc::CFile_Sync;
*Open = *ZNCc::CFile_Open;
*Read = *ZNCc::CFile_Read;
*ReadLine = *ZNCc::CFile_ReadLine;
*ReadFile = *ZNCc::CFile_ReadFile;
*Write = *ZNCc::CFile_Write;
*Close = *ZNCc::CFile_Close;
*ClearBuffer = *ZNCc::CFile_ClearBuffer;
*TryExLock = *ZNCc::CFile_TryExLock;
*ExLock = *ZNCc::CFile_ExLock;
*UnLock = *ZNCc::CFile_UnLock;
*IsOpen = *ZNCc::CFile_IsOpen;
*GetLongName = *ZNCc::CFile_GetLongName;
*GetShortName = *ZNCc::CFile_GetShortName;
*GetDir = *ZNCc::CFile_GetDir;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CDir ##############

package ZNC::CDir;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CDir(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CDir($self);
        delete $OWNER{$self};
    }
}

*CleanUp = *ZNCc::CDir_CleanUp;
*Fill = *ZNCc::CDir_Fill;
*FillByWildcard = *ZNCc::CDir_FillByWildcard;
*Chmod = *ZNCc::CDir_Chmod;
*Delete = *ZNCc::CDir_Delete;
*GetSortAttr = *ZNCc::CDir_GetSortAttr;
*IsDescending = *ZNCc::CDir_IsDescending;
*CheckPathPrefix = *ZNCc::CDir_CheckPathPrefix;
*ChangeDir = *ZNCc::CDir_ChangeDir;
*MakeDir = *ZNCc::CDir_MakeDir;
*GetCWD = *ZNCc::CDir_GetCWD;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CExecSock ##############

package ZNC::CExecSock;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::CZNCSock ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CExecSock(@_);
    bless $self, $pkg if defined($self);
}

*Execute = *ZNCc::CExecSock_Execute;
*Kill = *ZNCc::CExecSock_Kill;
sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CExecSock($self);
        delete $OWNER{$self};
    }
}

*popen2 = *ZNCc::CExecSock_popen2;
*close2 = *ZNCc::CExecSock_close2;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CTimer ##############

package ZNC::CTimer;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::CCron ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CTimer(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CTimer($self);
        delete $OWNER{$self};
    }
}

*SetModule = *ZNCc::CTimer_SetModule;
*SetDescription = *ZNCc::CTimer_SetDescription;
*GetModule = *ZNCc::CTimer_GetModule;
*GetDescription = *ZNCc::CTimer_GetDescription;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CFPTimer ##############

package ZNC::CFPTimer;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::CTimer ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CFPTimer(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CFPTimer($self);
        delete $OWNER{$self};
    }
}

*SetFPCallback = *ZNCc::CFPTimer_SetFPCallback;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CModInfo ##############

package ZNC::CModInfo;
use overload
    "<" => sub { $_[0]->__lt__($_[1])},
    "=" => sub { my $class = ref($_[0]); $class->new($_[0]) },
    "fallback" => 1;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CModInfo(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CModInfo($self);
        delete $OWNER{$self};
    }
}

*__lt__ = *ZNCc::CModInfo___lt__;
*GetName = *ZNCc::CModInfo_GetName;
*GetPath = *ZNCc::CModInfo_GetPath;
*GetDescription = *ZNCc::CModInfo_GetDescription;
*IsGlobal = *ZNCc::CModInfo_IsGlobal;
*SetName = *ZNCc::CModInfo_SetName;
*SetPath = *ZNCc::CModInfo_SetPath;
*SetDescription = *ZNCc::CModInfo_SetDescription;
*SetGlobal = *ZNCc::CModInfo_SetGlobal;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CModule ##############

package ZNC::CModule;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CModule(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CModule($self);
        delete $OWNER{$self};
    }
}

*CONTINUE = *ZNCc::CModule_CONTINUE;
*HALT = *ZNCc::CModule_HALT;
*HALTMODS = *ZNCc::CModule_HALTMODS;
*HALTCORE = *ZNCc::CModule_HALTCORE;
*UNLOAD = *ZNCc::CModule_UNLOAD;
*SetUser = *ZNCc::CModule_SetUser;
*SetClient = *ZNCc::CModule_SetClient;
*Unload = *ZNCc::CModule_Unload;
*OnLoad = *ZNCc::CModule_OnLoad;
*OnBoot = *ZNCc::CModule_OnBoot;
*WebRequiresLogin = *ZNCc::CModule_WebRequiresLogin;
*WebRequiresAdmin = *ZNCc::CModule_WebRequiresAdmin;
*GetWebMenuTitle = *ZNCc::CModule_GetWebMenuTitle;
*OnWebPreRequest = *ZNCc::CModule_OnWebPreRequest;
*OnWebRequest = *ZNCc::CModule_OnWebRequest;
*AddSubPage = *ZNCc::CModule_AddSubPage;
*ClearSubPages = *ZNCc::CModule_ClearSubPages;
*GetSubPages = *ZNCc::CModule_GetSubPages;
*OnEmbeddedWebRequest = *ZNCc::CModule_OnEmbeddedWebRequest;
*OnPreRehash = *ZNCc::CModule_OnPreRehash;
*OnPostRehash = *ZNCc::CModule_OnPostRehash;
*OnIRCDisconnected = *ZNCc::CModule_OnIRCDisconnected;
*OnIRCConnected = *ZNCc::CModule_OnIRCConnected;
*OnIRCConnecting = *ZNCc::CModule_OnIRCConnecting;
*OnIRCRegistration = *ZNCc::CModule_OnIRCRegistration;
*OnBroadcast = *ZNCc::CModule_OnBroadcast;
*OnConfigLine = *ZNCc::CModule_OnConfigLine;
*OnWriteUserConfig = *ZNCc::CModule_OnWriteUserConfig;
*OnWriteChanConfig = *ZNCc::CModule_OnWriteChanConfig;
*OnDCCUserSend = *ZNCc::CModule_OnDCCUserSend;
*OnChanPermission = *ZNCc::CModule_OnChanPermission;
*OnOp = *ZNCc::CModule_OnOp;
*OnDeop = *ZNCc::CModule_OnDeop;
*OnVoice = *ZNCc::CModule_OnVoice;
*OnDevoice = *ZNCc::CModule_OnDevoice;
*OnMode = *ZNCc::CModule_OnMode;
*OnRawMode = *ZNCc::CModule_OnRawMode;
*OnRaw = *ZNCc::CModule_OnRaw;
*OnStatusCommand = *ZNCc::CModule_OnStatusCommand;
*OnModCommand = *ZNCc::CModule_OnModCommand;
*OnModNotice = *ZNCc::CModule_OnModNotice;
*OnModCTCP = *ZNCc::CModule_OnModCTCP;
*OnQuit = *ZNCc::CModule_OnQuit;
*OnNick = *ZNCc::CModule_OnNick;
*OnKick = *ZNCc::CModule_OnKick;
*OnJoin = *ZNCc::CModule_OnJoin;
*OnPart = *ZNCc::CModule_OnPart;
*OnChanBufferStarting = *ZNCc::CModule_OnChanBufferStarting;
*OnChanBufferEnding = *ZNCc::CModule_OnChanBufferEnding;
*OnChanBufferPlayLine = *ZNCc::CModule_OnChanBufferPlayLine;
*OnPrivBufferPlayLine = *ZNCc::CModule_OnPrivBufferPlayLine;
*OnClientLogin = *ZNCc::CModule_OnClientLogin;
*OnClientDisconnect = *ZNCc::CModule_OnClientDisconnect;
*OnUserRaw = *ZNCc::CModule_OnUserRaw;
*OnUserCTCPReply = *ZNCc::CModule_OnUserCTCPReply;
*OnUserCTCP = *ZNCc::CModule_OnUserCTCP;
*OnUserAction = *ZNCc::CModule_OnUserAction;
*OnUserMsg = *ZNCc::CModule_OnUserMsg;
*OnUserNotice = *ZNCc::CModule_OnUserNotice;
*OnUserJoin = *ZNCc::CModule_OnUserJoin;
*OnUserPart = *ZNCc::CModule_OnUserPart;
*OnUserTopic = *ZNCc::CModule_OnUserTopic;
*OnUserTopicRequest = *ZNCc::CModule_OnUserTopicRequest;
*OnCTCPReply = *ZNCc::CModule_OnCTCPReply;
*OnPrivCTCP = *ZNCc::CModule_OnPrivCTCP;
*OnChanCTCP = *ZNCc::CModule_OnChanCTCP;
*OnPrivAction = *ZNCc::CModule_OnPrivAction;
*OnChanAction = *ZNCc::CModule_OnChanAction;
*OnPrivMsg = *ZNCc::CModule_OnPrivMsg;
*OnChanMsg = *ZNCc::CModule_OnChanMsg;
*OnPrivNotice = *ZNCc::CModule_OnPrivNotice;
*OnChanNotice = *ZNCc::CModule_OnChanNotice;
*OnTopic = *ZNCc::CModule_OnTopic;
*OnServerCapAvailable = *ZNCc::CModule_OnServerCapAvailable;
*OnServerCapResult = *ZNCc::CModule_OnServerCapResult;
*OnTimerAutoJoin = *ZNCc::CModule_OnTimerAutoJoin;
*GetDLL = *ZNCc::CModule_GetDLL;
*GetCoreVersion = *ZNCc::CModule_GetCoreVersion;
*PutIRC = *ZNCc::CModule_PutIRC;
*PutUser = *ZNCc::CModule_PutUser;
*PutStatus = *ZNCc::CModule_PutStatus;
*PutModule = *ZNCc::CModule_PutModule;
*PutModNotice = *ZNCc::CModule_PutModNotice;
*GetModName = *ZNCc::CModule_GetModName;
*GetModNick = *ZNCc::CModule_GetModNick;
*GetModDataDir = *ZNCc::CModule_GetModDataDir;
*AddTimer = *ZNCc::CModule_AddTimer;
*RemTimer = *ZNCc::CModule_RemTimer;
*UnlinkTimer = *ZNCc::CModule_UnlinkTimer;
*FindTimer = *ZNCc::CModule_FindTimer;
*BeginTimers = *ZNCc::CModule_BeginTimers;
*EndTimers = *ZNCc::CModule_EndTimers;
*ListTimers = *ZNCc::CModule_ListTimers;
*AddSocket = *ZNCc::CModule_AddSocket;
*RemSocket = *ZNCc::CModule_RemSocket;
*UnlinkSocket = *ZNCc::CModule_UnlinkSocket;
*FindSocket = *ZNCc::CModule_FindSocket;
*BeginSockets = *ZNCc::CModule_BeginSockets;
*EndSockets = *ZNCc::CModule_EndSockets;
*ListSockets = *ZNCc::CModule_ListSockets;
*LoadRegistry = *ZNCc::CModule_LoadRegistry;
*SaveRegistry = *ZNCc::CModule_SaveRegistry;
*SetNV = *ZNCc::CModule_SetNV;
*GetNV = *ZNCc::CModule_GetNV;
*FindNV = *ZNCc::CModule_FindNV;
*EndNV = *ZNCc::CModule_EndNV;
*BeginNV = *ZNCc::CModule_BeginNV;
*DelNV = *ZNCc::CModule_DelNV;
*ClearNV = *ZNCc::CModule_ClearNV;
*GetSavePath = *ZNCc::CModule_GetSavePath;
*SetGlobal = *ZNCc::CModule_SetGlobal;
*SetDescription = *ZNCc::CModule_SetDescription;
*SetModPath = *ZNCc::CModule_SetModPath;
*SetArgs = *ZNCc::CModule_SetArgs;
*IsGlobal = *ZNCc::CModule_IsGlobal;
*GetDescription = *ZNCc::CModule_GetDescription;
*GetArgs = *ZNCc::CModule_GetArgs;
*GetModPath = *ZNCc::CModule_GetModPath;
*GetUser = *ZNCc::CModule_GetUser;
*GetClient = *ZNCc::CModule_GetClient;
*GetManager = *ZNCc::CModule_GetManager;
*_GetNVKeys = *ZNCc::CModule__GetNVKeys;
*ExistsNV = *ZNCc::CModule_ExistsNV;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CModules ##############

package ZNC::CModules;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CModules(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CModules($self);
        delete $OWNER{$self};
    }
}

*SetUser = *ZNCc::CModules_SetUser;
*SetClient = *ZNCc::CModules_SetClient;
*GetUser = *ZNCc::CModules_GetUser;
*GetClient = *ZNCc::CModules_GetClient;
*UnloadAll = *ZNCc::CModules_UnloadAll;
*OnBoot = *ZNCc::CModules_OnBoot;
*OnPreRehash = *ZNCc::CModules_OnPreRehash;
*OnPostRehash = *ZNCc::CModules_OnPostRehash;
*OnIRCDisconnected = *ZNCc::CModules_OnIRCDisconnected;
*OnIRCConnected = *ZNCc::CModules_OnIRCConnected;
*OnIRCConnecting = *ZNCc::CModules_OnIRCConnecting;
*OnIRCRegistration = *ZNCc::CModules_OnIRCRegistration;
*OnBroadcast = *ZNCc::CModules_OnBroadcast;
*OnConfigLine = *ZNCc::CModules_OnConfigLine;
*OnWriteUserConfig = *ZNCc::CModules_OnWriteUserConfig;
*OnWriteChanConfig = *ZNCc::CModules_OnWriteChanConfig;
*OnDCCUserSend = *ZNCc::CModules_OnDCCUserSend;
*OnChanPermission = *ZNCc::CModules_OnChanPermission;
*OnOp = *ZNCc::CModules_OnOp;
*OnDeop = *ZNCc::CModules_OnDeop;
*OnVoice = *ZNCc::CModules_OnVoice;
*OnDevoice = *ZNCc::CModules_OnDevoice;
*OnRawMode = *ZNCc::CModules_OnRawMode;
*OnMode = *ZNCc::CModules_OnMode;
*OnRaw = *ZNCc::CModules_OnRaw;
*OnStatusCommand = *ZNCc::CModules_OnStatusCommand;
*OnModCommand = *ZNCc::CModules_OnModCommand;
*OnModNotice = *ZNCc::CModules_OnModNotice;
*OnModCTCP = *ZNCc::CModules_OnModCTCP;
*OnQuit = *ZNCc::CModules_OnQuit;
*OnNick = *ZNCc::CModules_OnNick;
*OnKick = *ZNCc::CModules_OnKick;
*OnJoin = *ZNCc::CModules_OnJoin;
*OnPart = *ZNCc::CModules_OnPart;
*OnChanBufferStarting = *ZNCc::CModules_OnChanBufferStarting;
*OnChanBufferEnding = *ZNCc::CModules_OnChanBufferEnding;
*OnChanBufferPlayLine = *ZNCc::CModules_OnChanBufferPlayLine;
*OnPrivBufferPlayLine = *ZNCc::CModules_OnPrivBufferPlayLine;
*OnClientLogin = *ZNCc::CModules_OnClientLogin;
*OnClientDisconnect = *ZNCc::CModules_OnClientDisconnect;
*OnUserRaw = *ZNCc::CModules_OnUserRaw;
*OnUserCTCPReply = *ZNCc::CModules_OnUserCTCPReply;
*OnUserCTCP = *ZNCc::CModules_OnUserCTCP;
*OnUserAction = *ZNCc::CModules_OnUserAction;
*OnUserMsg = *ZNCc::CModules_OnUserMsg;
*OnUserNotice = *ZNCc::CModules_OnUserNotice;
*OnUserJoin = *ZNCc::CModules_OnUserJoin;
*OnUserPart = *ZNCc::CModules_OnUserPart;
*OnUserTopic = *ZNCc::CModules_OnUserTopic;
*OnUserTopicRequest = *ZNCc::CModules_OnUserTopicRequest;
*OnCTCPReply = *ZNCc::CModules_OnCTCPReply;
*OnPrivCTCP = *ZNCc::CModules_OnPrivCTCP;
*OnChanCTCP = *ZNCc::CModules_OnChanCTCP;
*OnPrivAction = *ZNCc::CModules_OnPrivAction;
*OnChanAction = *ZNCc::CModules_OnChanAction;
*OnPrivMsg = *ZNCc::CModules_OnPrivMsg;
*OnChanMsg = *ZNCc::CModules_OnChanMsg;
*OnPrivNotice = *ZNCc::CModules_OnPrivNotice;
*OnChanNotice = *ZNCc::CModules_OnChanNotice;
*OnTopic = *ZNCc::CModules_OnTopic;
*OnTimerAutoJoin = *ZNCc::CModules_OnTimerAutoJoin;
*OnServerCapAvailable = *ZNCc::CModules_OnServerCapAvailable;
*OnServerCapResult = *ZNCc::CModules_OnServerCapResult;
*FindModule = *ZNCc::CModules_FindModule;
*LoadModule = *ZNCc::CModules_LoadModule;
*UnloadModule = *ZNCc::CModules_UnloadModule;
*ReloadModule = *ZNCc::CModules_ReloadModule;
*GetModInfo = *ZNCc::CModules_GetModInfo;
*GetModPathInfo = *ZNCc::CModules_GetModPathInfo;
*GetAvailableMods = *ZNCc::CModules_GetAvailableMods;
*FindModPath = *ZNCc::CModules_FindModPath;
*GetModDirs = *ZNCc::CModules_GetModDirs;
*push_back = *ZNCc::CModules_push_back;
*removeModule = *ZNCc::CModules_removeModule;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CGlobalModule ##############

package ZNC::CGlobalModule;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::CModule ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CGlobalModule(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CGlobalModule($self);
        delete $OWNER{$self};
    }
}

*OnWriteConfig = *ZNCc::CGlobalModule_OnWriteConfig;
*OnAddUser = *ZNCc::CGlobalModule_OnAddUser;
*OnDeleteUser = *ZNCc::CGlobalModule_OnDeleteUser;
*OnClientConnect = *ZNCc::CGlobalModule_OnClientConnect;
*OnLoginAttempt = *ZNCc::CGlobalModule_OnLoginAttempt;
*OnFailedLogin = *ZNCc::CGlobalModule_OnFailedLogin;
*OnUnknownUserRaw = *ZNCc::CGlobalModule_OnUnknownUserRaw;
*OnClientCapLs = *ZNCc::CGlobalModule_OnClientCapLs;
*IsClientCapSupported = *ZNCc::CGlobalModule_IsClientCapSupported;
*OnClientCapRequest = *ZNCc::CGlobalModule_OnClientCapRequest;
*OnModuleLoading = *ZNCc::CGlobalModule_OnModuleLoading;
*OnModuleUnloading = *ZNCc::CGlobalModule_OnModuleUnloading;
*OnGetModInfo = *ZNCc::CGlobalModule_OnGetModInfo;
*OnGetAvailableMods = *ZNCc::CGlobalModule_OnGetAvailableMods;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CGlobalModules ##############

package ZNC::CGlobalModules;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::CModules ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CGlobalModules(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CGlobalModules($self);
        delete $OWNER{$self};
    }
}

*OnWriteConfig = *ZNCc::CGlobalModules_OnWriteConfig;
*OnAddUser = *ZNCc::CGlobalModules_OnAddUser;
*OnDeleteUser = *ZNCc::CGlobalModules_OnDeleteUser;
*OnClientConnect = *ZNCc::CGlobalModules_OnClientConnect;
*OnLoginAttempt = *ZNCc::CGlobalModules_OnLoginAttempt;
*OnFailedLogin = *ZNCc::CGlobalModules_OnFailedLogin;
*OnUnknownUserRaw = *ZNCc::CGlobalModules_OnUnknownUserRaw;
*OnClientCapLs = *ZNCc::CGlobalModules_OnClientCapLs;
*IsClientCapSupported = *ZNCc::CGlobalModules_IsClientCapSupported;
*OnClientCapRequest = *ZNCc::CGlobalModules_OnClientCapRequest;
*OnModuleLoading = *ZNCc::CGlobalModules_OnModuleLoading;
*OnModuleUnloading = *ZNCc::CGlobalModules_OnModuleUnloading;
*OnGetModInfo = *ZNCc::CGlobalModules_OnGetModInfo;
*OnGetAvailableMods = *ZNCc::CGlobalModules_OnGetAvailableMods;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CNick ##############

package ZNC::CNick;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CNick(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CNick($self);
        delete $OWNER{$self};
    }
}

*Reset = *ZNCc::CNick_Reset;
*Parse = *ZNCc::CNick_Parse;
*GetHostMask = *ZNCc::CNick_GetHostMask;
*GetCommonChans = *ZNCc::CNick_GetCommonChans;
*SetUser = *ZNCc::CNick_SetUser;
*SetNick = *ZNCc::CNick_SetNick;
*SetIdent = *ZNCc::CNick_SetIdent;
*SetHost = *ZNCc::CNick_SetHost;
*AddPerm = *ZNCc::CNick_AddPerm;
*RemPerm = *ZNCc::CNick_RemPerm;
*GetPermStr = *ZNCc::CNick_GetPermStr;
*GetPermChar = *ZNCc::CNick_GetPermChar;
*HasPerm = *ZNCc::CNick_HasPerm;
*GetNick = *ZNCc::CNick_GetNick;
*GetIdent = *ZNCc::CNick_GetIdent;
*GetHost = *ZNCc::CNick_GetHost;
*GetNickMask = *ZNCc::CNick_GetNickMask;
*Clone = *ZNCc::CNick_Clone;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CChan ##############

package ZNC::CChan;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
*Voice = *ZNCc::CChan_Voice;
*HalfOp = *ZNCc::CChan_HalfOp;
*Op = *ZNCc::CChan_Op;
*Admin = *ZNCc::CChan_Admin;
*Owner = *ZNCc::CChan_Owner;
*M_Private = *ZNCc::CChan_M_Private;
*M_Secret = *ZNCc::CChan_M_Secret;
*M_Moderated = *ZNCc::CChan_M_Moderated;
*M_InviteOnly = *ZNCc::CChan_M_InviteOnly;
*M_NoMessages = *ZNCc::CChan_M_NoMessages;
*M_OpTopic = *ZNCc::CChan_M_OpTopic;
*M_Limit = *ZNCc::CChan_M_Limit;
*M_Key = *ZNCc::CChan_M_Key;
*M_Op = *ZNCc::CChan_M_Op;
*M_Voice = *ZNCc::CChan_M_Voice;
*M_Ban = *ZNCc::CChan_M_Ban;
*M_Except = *ZNCc::CChan_M_Except;
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CChan(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CChan($self);
        delete $OWNER{$self};
    }
}

*Reset = *ZNCc::CChan_Reset;
*WriteConfig = *ZNCc::CChan_WriteConfig;
*Clone = *ZNCc::CChan_Clone;
*Cycle = *ZNCc::CChan_Cycle;
*JoinUser = *ZNCc::CChan_JoinUser;
*DetachUser = *ZNCc::CChan_DetachUser;
*AttachUser = *ZNCc::CChan_AttachUser;
*OnWho = *ZNCc::CChan_OnWho;
*SetModes = *ZNCc::CChan_SetModes;
*ModeChange = *ZNCc::CChan_ModeChange;
*AddMode = *ZNCc::CChan_AddMode;
*RemMode = *ZNCc::CChan_RemMode;
*GetModeString = *ZNCc::CChan_GetModeString;
*GetModeForNames = *ZNCc::CChan_GetModeForNames;
*ClearNicks = *ZNCc::CChan_ClearNicks;
*FindNick = *ZNCc::CChan_FindNick;
*AddNicks = *ZNCc::CChan_AddNicks;
*AddNick = *ZNCc::CChan_AddNick;
*RemNick = *ZNCc::CChan_RemNick;
*ChangeNick = *ZNCc::CChan_ChangeNick;
*AddBuffer = *ZNCc::CChan_AddBuffer;
*ClearBuffer = *ZNCc::CChan_ClearBuffer;
*SendBuffer = *ZNCc::CChan_SendBuffer;
*GetPermStr = *ZNCc::CChan_GetPermStr;
*HasPerm = *ZNCc::CChan_HasPerm;
*AddPerm = *ZNCc::CChan_AddPerm;
*RemPerm = *ZNCc::CChan_RemPerm;
*SetIsOn = *ZNCc::CChan_SetIsOn;
*SetKey = *ZNCc::CChan_SetKey;
*SetTopic = *ZNCc::CChan_SetTopic;
*SetTopicOwner = *ZNCc::CChan_SetTopicOwner;
*SetTopicDate = *ZNCc::CChan_SetTopicDate;
*SetDefaultModes = *ZNCc::CChan_SetDefaultModes;
*SetBufferCount = *ZNCc::CChan_SetBufferCount;
*SetKeepBuffer = *ZNCc::CChan_SetKeepBuffer;
*SetDetached = *ZNCc::CChan_SetDetached;
*SetInConfig = *ZNCc::CChan_SetInConfig;
*SetCreationDate = *ZNCc::CChan_SetCreationDate;
*Disable = *ZNCc::CChan_Disable;
*Enable = *ZNCc::CChan_Enable;
*IncJoinTries = *ZNCc::CChan_IncJoinTries;
*ResetJoinTries = *ZNCc::CChan_ResetJoinTries;
*HasMode = *ZNCc::CChan_HasMode;
*GetOptions = *ZNCc::CChan_GetOptions;
*GetModeArg = *ZNCc::CChan_GetModeArg;
*GetPermCounts = *ZNCc::CChan_GetPermCounts;
*IsOn = *ZNCc::CChan_IsOn;
*GetName = *ZNCc::CChan_GetName;
*GetModes = *ZNCc::CChan_GetModes;
*GetKey = *ZNCc::CChan_GetKey;
*GetTopic = *ZNCc::CChan_GetTopic;
*GetTopicOwner = *ZNCc::CChan_GetTopicOwner;
*GetTopicDate = *ZNCc::CChan_GetTopicDate;
*GetDefaultModes = *ZNCc::CChan_GetDefaultModes;
*GetBuffer = *ZNCc::CChan_GetBuffer;
*GetNicks = *ZNCc::CChan_GetNicks;
*GetNickCount = *ZNCc::CChan_GetNickCount;
*GetBufferCount = *ZNCc::CChan_GetBufferCount;
*KeepBuffer = *ZNCc::CChan_KeepBuffer;
*IsDetached = *ZNCc::CChan_IsDetached;
*InConfig = *ZNCc::CChan_InConfig;
*GetCreationDate = *ZNCc::CChan_GetCreationDate;
*IsDisabled = *ZNCc::CChan_IsDisabled;
*GetJoinTries = *ZNCc::CChan_GetJoinTries;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CUser ##############

package ZNC::CUser;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CUser(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CUser($self);
        delete $OWNER{$self};
    }
}

*HASH_NONE = *ZNCc::CUser_HASH_NONE;
*HASH_MD5 = *ZNCc::CUser_HASH_MD5;
*HASH_SHA256 = *ZNCc::CUser_HASH_SHA256;
*HASH_DEFAULT = *ZNCc::CUser_HASH_DEFAULT;
*SaltedHash = *ZNCc::CUser_SaltedHash;
*PrintLine = *ZNCc::CUser_PrintLine;
*WriteConfig = *ZNCc::CUser_WriteConfig;
*FindChan = *ZNCc::CUser_FindChan;
*AddChan = *ZNCc::CUser_AddChan;
*DelChan = *ZNCc::CUser_DelChan;
*JoinChans = *ZNCc::CUser_JoinChans;
*JoinChan = *ZNCc::CUser_JoinChan;
*FindServer = *ZNCc::CUser_FindServer;
*DelServer = *ZNCc::CUser_DelServer;
*AddServer = *ZNCc::CUser_AddServer;
*GetNextServer = *ZNCc::CUser_GetNextServer;
*GetCurrentServer = *ZNCc::CUser_GetCurrentServer;
*SetNextServer = *ZNCc::CUser_SetNextServer;
*CheckPass = *ZNCc::CUser_CheckPass;
*AddAllowedHost = *ZNCc::CUser_AddAllowedHost;
*IsHostAllowed = *ZNCc::CUser_IsHostAllowed;
*IsValid = *ZNCc::CUser_IsValid;
*IsValidUserName = *ZNCc::CUser_IsValidUserName;
*MakeCleanUserName = *ZNCc::CUser_MakeCleanUserName;
*IsLastServer = *ZNCc::CUser_IsLastServer;
*ConnectPaused = *ZNCc::CUser_ConnectPaused;
*DelClients = *ZNCc::CUser_DelClients;
*DelServers = *ZNCc::CUser_DelServers;
*DelModules = *ZNCc::CUser_DelModules;
*UpdateModule = *ZNCc::CUser_UpdateModule;
*GetModules = *ZNCc::CUser_GetModules;
*AddRawBuffer = *ZNCc::CUser_AddRawBuffer;
*UpdateRawBuffer = *ZNCc::CUser_UpdateRawBuffer;
*UpdateExactRawBuffer = *ZNCc::CUser_UpdateExactRawBuffer;
*ClearRawBuffer = *ZNCc::CUser_ClearRawBuffer;
*AddMotdBuffer = *ZNCc::CUser_AddMotdBuffer;
*UpdateMotdBuffer = *ZNCc::CUser_UpdateMotdBuffer;
*ClearMotdBuffer = *ZNCc::CUser_ClearMotdBuffer;
*AddQueryBuffer = *ZNCc::CUser_AddQueryBuffer;
*UpdateQueryBuffer = *ZNCc::CUser_UpdateQueryBuffer;
*ClearQueryBuffer = *ZNCc::CUser_ClearQueryBuffer;
*PutIRC = *ZNCc::CUser_PutIRC;
*PutUser = *ZNCc::CUser_PutUser;
*PutStatus = *ZNCc::CUser_PutStatus;
*PutStatusNotice = *ZNCc::CUser_PutStatusNotice;
*PutModule = *ZNCc::CUser_PutModule;
*IsUserAttached = *ZNCc::CUser_IsUserAttached;
*UserConnected = *ZNCc::CUser_UserConnected;
*UserDisconnected = *ZNCc::CUser_UserDisconnected;
*GetLocalIP = *ZNCc::CUser_GetLocalIP;
*GetLocalDCCIP = *ZNCc::CUser_GetLocalDCCIP;
*IsIRCConnected = *ZNCc::CUser_IsIRCConnected;
*IRCConnected = *ZNCc::CUser_IRCConnected;
*IRCDisconnected = *ZNCc::CUser_IRCDisconnected;
*CheckIRCConnect = *ZNCc::CUser_CheckIRCConnect;
*AddDCCBounce = *ZNCc::CUser_AddDCCBounce;
*DelDCCBounce = *ZNCc::CUser_DelDCCBounce;
*AddDCCSock = *ZNCc::CUser_AddDCCSock;
*DelDCCSock = *ZNCc::CUser_DelDCCSock;
*ExpandString = *ZNCc::CUser_ExpandString;
*AddTimestamp = *ZNCc::CUser_AddTimestamp;
*SendFile = *ZNCc::CUser_SendFile;
*GetFile = *ZNCc::CUser_GetFile;
*ResumeFile = *ZNCc::CUser_ResumeFile;
*GetCurNick = *ZNCc::CUser_GetCurNick;
*Clone = *ZNCc::CUser_Clone;
*BounceAllClients = *ZNCc::CUser_BounceAllClients;
*AddBytesRead = *ZNCc::CUser_AddBytesRead;
*AddBytesWritten = *ZNCc::CUser_AddBytesWritten;
*SetUserName = *ZNCc::CUser_SetUserName;
*SetNick = *ZNCc::CUser_SetNick;
*SetAltNick = *ZNCc::CUser_SetAltNick;
*SetIdent = *ZNCc::CUser_SetIdent;
*SetRealName = *ZNCc::CUser_SetRealName;
*SetBindHost = *ZNCc::CUser_SetBindHost;
*SetDCCBindHost = *ZNCc::CUser_SetDCCBindHost;
*SetPass = *ZNCc::CUser_SetPass;
*SetBounceDCCs = *ZNCc::CUser_SetBounceDCCs;
*SetMultiClients = *ZNCc::CUser_SetMultiClients;
*SetUseClientIP = *ZNCc::CUser_SetUseClientIP;
*SetDenyLoadMod = *ZNCc::CUser_SetDenyLoadMod;
*SetAdmin = *ZNCc::CUser_SetAdmin;
*SetDenySetBindHost = *ZNCc::CUser_SetDenySetBindHost;
*SetStatusPrefix = *ZNCc::CUser_SetStatusPrefix;
*SetDefaultChanModes = *ZNCc::CUser_SetDefaultChanModes;
*SetIRCNick = *ZNCc::CUser_SetIRCNick;
*SetIRCServer = *ZNCc::CUser_SetIRCServer;
*SetQuitMsg = *ZNCc::CUser_SetQuitMsg;
*AddCTCPReply = *ZNCc::CUser_AddCTCPReply;
*SetBufferCount = *ZNCc::CUser_SetBufferCount;
*SetKeepBuffer = *ZNCc::CUser_SetKeepBuffer;
*SetChanPrefixes = *ZNCc::CUser_SetChanPrefixes;
*SetBeingDeleted = *ZNCc::CUser_SetBeingDeleted;
*SetTimestampFormat = *ZNCc::CUser_SetTimestampFormat;
*SetTimestampAppend = *ZNCc::CUser_SetTimestampAppend;
*SetTimestampPrepend = *ZNCc::CUser_SetTimestampPrepend;
*SetTimezoneOffset = *ZNCc::CUser_SetTimezoneOffset;
*SetJoinTries = *ZNCc::CUser_SetJoinTries;
*SetMaxJoins = *ZNCc::CUser_SetMaxJoins;
*SetSkinName = *ZNCc::CUser_SetSkinName;
*SetIRCConnectEnabled = *ZNCc::CUser_SetIRCConnectEnabled;
*SetIRCAway = *ZNCc::CUser_SetIRCAway;
*GetClients = *ZNCc::CUser_GetClients;
*GetIRCSock = *ZNCc::CUser_GetIRCSock;
*GetUserName = *ZNCc::CUser_GetUserName;
*GetCleanUserName = *ZNCc::CUser_GetCleanUserName;
*GetNick = *ZNCc::CUser_GetNick;
*GetAltNick = *ZNCc::CUser_GetAltNick;
*GetIdent = *ZNCc::CUser_GetIdent;
*GetRealName = *ZNCc::CUser_GetRealName;
*GetBindHost = *ZNCc::CUser_GetBindHost;
*GetDCCBindHost = *ZNCc::CUser_GetDCCBindHost;
*GetPass = *ZNCc::CUser_GetPass;
*GetPassHashType = *ZNCc::CUser_GetPassHashType;
*GetPassSalt = *ZNCc::CUser_GetPassSalt;
*GetAllowedHosts = *ZNCc::CUser_GetAllowedHosts;
*GetTimestampFormat = *ZNCc::CUser_GetTimestampFormat;
*GetTimestampAppend = *ZNCc::CUser_GetTimestampAppend;
*GetTimestampPrepend = *ZNCc::CUser_GetTimestampPrepend;
*GetIRCConnectEnabled = *ZNCc::CUser_GetIRCConnectEnabled;
*GetChanPrefixes = *ZNCc::CUser_GetChanPrefixes;
*IsChan = *ZNCc::CUser_IsChan;
*GetUserPath = *ZNCc::CUser_GetUserPath;
*GetDLPath = *ZNCc::CUser_GetDLPath;
*UseClientIP = *ZNCc::CUser_UseClientIP;
*DenyLoadMod = *ZNCc::CUser_DenyLoadMod;
*IsAdmin = *ZNCc::CUser_IsAdmin;
*DenySetBindHost = *ZNCc::CUser_DenySetBindHost;
*BounceDCCs = *ZNCc::CUser_BounceDCCs;
*MultiClients = *ZNCc::CUser_MultiClients;
*GetStatusPrefix = *ZNCc::CUser_GetStatusPrefix;
*GetDefaultChanModes = *ZNCc::CUser_GetDefaultChanModes;
*GetChans = *ZNCc::CUser_GetChans;
*GetServers = *ZNCc::CUser_GetServers;
*GetIRCNick = *ZNCc::CUser_GetIRCNick;
*GetIRCServer = *ZNCc::CUser_GetIRCServer;
*GetQuitMsg = *ZNCc::CUser_GetQuitMsg;
*GetCTCPReplies = *ZNCc::CUser_GetCTCPReplies;
*GetBufferCount = *ZNCc::CUser_GetBufferCount;
*KeepBuffer = *ZNCc::CUser_KeepBuffer;
*IsBeingDeleted = *ZNCc::CUser_IsBeingDeleted;
*HasServers = *ZNCc::CUser_HasServers;
*GetTimezoneOffset = *ZNCc::CUser_GetTimezoneOffset;
*BytesRead = *ZNCc::CUser_BytesRead;
*BytesWritten = *ZNCc::CUser_BytesWritten;
*JoinTries = *ZNCc::CUser_JoinTries;
*MaxJoins = *ZNCc::CUser_MaxJoins;
*IsIRCAway = *ZNCc::CUser_IsIRCAway;
*GetSkinName = *ZNCc::CUser_GetSkinName;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CAuthBase ##############

package ZNC::CAuthBase;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CAuthBase($self);
        delete $OWNER{$self};
    }
}

*SetLoginInfo = *ZNCc::CAuthBase_SetLoginInfo;
*AcceptLogin = *ZNCc::CAuthBase_AcceptLogin;
*RefuseLogin = *ZNCc::CAuthBase_RefuseLogin;
*GetUsername = *ZNCc::CAuthBase_GetUsername;
*GetPassword = *ZNCc::CAuthBase_GetPassword;
*GetSocket = *ZNCc::CAuthBase_GetSocket;
*GetRemoteIP = *ZNCc::CAuthBase_GetRemoteIP;
*Invalidate = *ZNCc::CAuthBase_Invalidate;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CClientAuth ##############

package ZNC::CClientAuth;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::CAuthBase ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CClientAuth(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CClientAuth($self);
        delete $OWNER{$self};
    }
}

*Invalidate = *ZNCc::CClientAuth_Invalidate;
*AcceptedLogin = *ZNCc::CClientAuth_AcceptedLogin;
*RefusedLogin = *ZNCc::CClientAuth_RefusedLogin;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CClient ##############

package ZNC::CClient;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::CZNCSock ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CClient(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CClient($self);
        delete $OWNER{$self};
    }
}

*AcceptLogin = *ZNCc::CClient_AcceptLogin;
*RefuseLogin = *ZNCc::CClient_RefuseLogin;
*GetNick = *ZNCc::CClient_GetNick;
*GetNickMask = *ZNCc::CClient_GetNickMask;
*HasNamesx = *ZNCc::CClient_HasNamesx;
*HasUHNames = *ZNCc::CClient_HasUHNames;
*UserCommand = *ZNCc::CClient_UserCommand;
*UserPortCommand = *ZNCc::CClient_UserPortCommand;
*StatusCTCP = *ZNCc::CClient_StatusCTCP;
*BouncedOff = *ZNCc::CClient_BouncedOff;
*IsAttached = *ZNCc::CClient_IsAttached;
*PutIRC = *ZNCc::CClient_PutIRC;
*PutClient = *ZNCc::CClient_PutClient;
*PutStatus = *ZNCc::CClient_PutStatus;
*PutStatusNotice = *ZNCc::CClient_PutStatusNotice;
*PutModule = *ZNCc::CClient_PutModule;
*PutModNotice = *ZNCc::CClient_PutModNotice;
*IsCapEnabled = *ZNCc::CClient_IsCapEnabled;
*ReadLine = *ZNCc::CClient_ReadLine;
*SendMotd = *ZNCc::CClient_SendMotd;
*HelpUser = *ZNCc::CClient_HelpUser;
*AuthUser = *ZNCc::CClient_AuthUser;
*Connected = *ZNCc::CClient_Connected;
*Timeout = *ZNCc::CClient_Timeout;
*Disconnected = *ZNCc::CClient_Disconnected;
*ConnectionRefused = *ZNCc::CClient_ConnectionRefused;
*ReachedMaxBuffer = *ZNCc::CClient_ReachedMaxBuffer;
*SetNick = *ZNCc::CClient_SetNick;
*GetUser = *ZNCc::CClient_GetUser;
*GetIRCSock = *ZNCc::CClient_GetIRCSock;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CIRCSock ##############

package ZNC::CIRCSock;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::CZNCSock ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CIRCSock(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CIRCSock($self);
        delete $OWNER{$self};
    }
}

*ListArg = *ZNCc::CIRCSock_ListArg;
*HasArg = *ZNCc::CIRCSock_HasArg;
*ArgWhenSet = *ZNCc::CIRCSock_ArgWhenSet;
*NoArg = *ZNCc::CIRCSock_NoArg;
*OnCTCPReply = *ZNCc::CIRCSock_OnCTCPReply;
*OnPrivCTCP = *ZNCc::CIRCSock_OnPrivCTCP;
*OnChanCTCP = *ZNCc::CIRCSock_OnChanCTCP;
*OnGeneralCTCP = *ZNCc::CIRCSock_OnGeneralCTCP;
*OnPrivMsg = *ZNCc::CIRCSock_OnPrivMsg;
*OnChanMsg = *ZNCc::CIRCSock_OnChanMsg;
*OnPrivNotice = *ZNCc::CIRCSock_OnPrivNotice;
*OnChanNotice = *ZNCc::CIRCSock_OnChanNotice;
*OnServerCapAvailable = *ZNCc::CIRCSock_OnServerCapAvailable;
*ReadLine = *ZNCc::CIRCSock_ReadLine;
*Connected = *ZNCc::CIRCSock_Connected;
*Disconnected = *ZNCc::CIRCSock_Disconnected;
*ConnectionRefused = *ZNCc::CIRCSock_ConnectionRefused;
*SockError = *ZNCc::CIRCSock_SockError;
*Timeout = *ZNCc::CIRCSock_Timeout;
*ReachedMaxBuffer = *ZNCc::CIRCSock_ReachedMaxBuffer;
*PutIRC = *ZNCc::CIRCSock_PutIRC;
*ResetChans = *ZNCc::CIRCSock_ResetChans;
*Quit = *ZNCc::CIRCSock_Quit;
*PauseCap = *ZNCc::CIRCSock_PauseCap;
*ResumeCap = *ZNCc::CIRCSock_ResumeCap;
*SetPass = *ZNCc::CIRCSock_SetPass;
*GetMaxNickLen = *ZNCc::CIRCSock_GetMaxNickLen;
*GetModeType = *ZNCc::CIRCSock_GetModeType;
*GetPermFromMode = *ZNCc::CIRCSock_GetPermFromMode;
*GetChanModes = *ZNCc::CIRCSock_GetChanModes;
*IsPermChar = *ZNCc::CIRCSock_IsPermChar;
*IsPermMode = *ZNCc::CIRCSock_IsPermMode;
*GetPerms = *ZNCc::CIRCSock_GetPerms;
*GetPermModes = *ZNCc::CIRCSock_GetPermModes;
*GetNickMask = *ZNCc::CIRCSock_GetNickMask;
*GetNick = *ZNCc::CIRCSock_GetNick;
*GetPass = *ZNCc::CIRCSock_GetPass;
*GetUser = *ZNCc::CIRCSock_GetUser;
*HasNamesx = *ZNCc::CIRCSock_HasNamesx;
*HasUHNames = *ZNCc::CIRCSock_HasUHNames;
*GetUserModes = *ZNCc::CIRCSock_GetUserModes;
*IsAuthed = *ZNCc::CIRCSock_IsAuthed;
*IsCapAccepted = *ZNCc::CIRCSock_IsCapAccepted;
*ForwardRaw353 = *ZNCc::CIRCSock_ForwardRaw353;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CListener ##############

package ZNC::CListener;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
*ACCEPT_IRC = *ZNCc::CListener_ACCEPT_IRC;
*ACCEPT_HTTP = *ZNCc::CListener_ACCEPT_HTTP;
*ACCEPT_ALL = *ZNCc::CListener_ACCEPT_ALL;
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CListener(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CListener($self);
        delete $OWNER{$self};
    }
}

*IsSSL = *ZNCc::CListener_IsSSL;
*GetAddrType = *ZNCc::CListener_GetAddrType;
*GetPort = *ZNCc::CListener_GetPort;
*GetBindHost = *ZNCc::CListener_GetBindHost;
*GetRealListener = *ZNCc::CListener_GetRealListener;
*GetAcceptType = *ZNCc::CListener_GetAcceptType;
*SetAcceptType = *ZNCc::CListener_SetAcceptType;
*Listen = *ZNCc::CListener_Listen;
*ResetRealListener = *ZNCc::CListener_ResetRealListener;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CRealListener ##############

package ZNC::CRealListener;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::CZNCSock ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CRealListener(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CRealListener($self);
        delete $OWNER{$self};
    }
}

*ConnectionFrom = *ZNCc::CRealListener_ConnectionFrom;
*GetSockObj = *ZNCc::CRealListener_GetSockObj;
*SockError = *ZNCc::CRealListener_SockError;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CIncomingConnection ##############

package ZNC::CIncomingConnection;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::CZNCSock ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CIncomingConnection(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CIncomingConnection($self);
        delete $OWNER{$self};
    }
}

*ReadLine = *ZNCc::CIncomingConnection_ReadLine;
*ReachedMaxBuffer = *ZNCc::CIncomingConnection_ReachedMaxBuffer;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CHTTPSock ##############

package ZNC::CHTTPSock;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::CSocket ZNC );
%OWNER = ();
%ITERATORS = ();
sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CHTTPSock($self);
        delete $OWNER{$self};
    }
}

*ReadData = *ZNCc::CHTTPSock_ReadData;
*ReadLine = *ZNCc::CHTTPSock_ReadLine;
*ReachedMaxBuffer = *ZNCc::CHTTPSock_ReachedMaxBuffer;
*SockError = *ZNCc::CHTTPSock_SockError;
*Timeout = *ZNCc::CHTTPSock_Timeout;
*Connected = *ZNCc::CHTTPSock_Connected;
*Disconnected = *ZNCc::CHTTPSock_Disconnected;
*GetSockObj = *ZNCc::CHTTPSock_GetSockObj;
*ForceLogin = *ZNCc::CHTTPSock_ForceLogin;
*OnLogin = *ZNCc::CHTTPSock_OnLogin;
*OnPageRequest = *ZNCc::CHTTPSock_OnPageRequest;
*PrintFile = *ZNCc::CHTTPSock_PrintFile;
*CheckPost = *ZNCc::CHTTPSock_CheckPost;
*SentHeader = *ZNCc::CHTTPSock_SentHeader;
*PrintHeader = *ZNCc::CHTTPSock_PrintHeader;
*AddHeader = *ZNCc::CHTTPSock_AddHeader;
*SetContentType = *ZNCc::CHTTPSock_SetContentType;
*PrintNotFound = *ZNCc::CHTTPSock_PrintNotFound;
*Redirect = *ZNCc::CHTTPSock_Redirect;
*PrintErrorPage = *ZNCc::CHTTPSock_PrintErrorPage;
*ParseParams = *ZNCc::CHTTPSock_ParseParams;
*ParseURI = *ZNCc::CHTTPSock_ParseURI;
*GetPage = *ZNCc::CHTTPSock_GetPage;
*GetRequestCookie = *ZNCc::CHTTPSock_GetRequestCookie;
*SendCookie = *ZNCc::CHTTPSock_SendCookie;
*SetDocRoot = *ZNCc::CHTTPSock_SetDocRoot;
*SetLoggedIn = *ZNCc::CHTTPSock_SetLoggedIn;
*GetPath = *ZNCc::CHTTPSock_GetPath;
*IsLoggedIn = *ZNCc::CHTTPSock_IsLoggedIn;
*GetDocRoot = *ZNCc::CHTTPSock_GetDocRoot;
*GetUser = *ZNCc::CHTTPSock_GetUser;
*GetPass = *ZNCc::CHTTPSock_GetPass;
*GetParamString = *ZNCc::CHTTPSock_GetParamString;
*GetContentType = *ZNCc::CHTTPSock_GetContentType;
*IsPost = *ZNCc::CHTTPSock_IsPost;
*GetParam = *ZNCc::CHTTPSock_GetParam;
*GetRawParam = *ZNCc::CHTTPSock_GetRawParam;
*HasParam = *ZNCc::CHTTPSock_HasParam;
*GetParams = *ZNCc::CHTTPSock_GetParams;
*GetParamValues = *ZNCc::CHTTPSock_GetParamValues;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CTemplateTagHandler ##############

package ZNC::CTemplateTagHandler;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CTemplateTagHandler(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CTemplateTagHandler($self);
        delete $OWNER{$self};
    }
}

*HandleVar = *ZNCc::CTemplateTagHandler_HandleVar;
*HandleTag = *ZNCc::CTemplateTagHandler_HandleTag;
*HandleIf = *ZNCc::CTemplateTagHandler_HandleIf;
*HandleValue = *ZNCc::CTemplateTagHandler_HandleValue;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CTemplateOptions ##############

package ZNC::CTemplateOptions;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CTemplateOptions(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CTemplateOptions($self);
        delete $OWNER{$self};
    }
}

*Parse = *ZNCc::CTemplateOptions_Parse;
*GetEscapeFrom = *ZNCc::CTemplateOptions_GetEscapeFrom;
*GetEscapeTo = *ZNCc::CTemplateOptions_GetEscapeTo;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CTemplateLoopContext ##############

package ZNC::CTemplateLoopContext;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CTemplateLoopContext(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CTemplateLoopContext($self);
        delete $OWNER{$self};
    }
}

*SetHasData = *ZNCc::CTemplateLoopContext_SetHasData;
*SetName = *ZNCc::CTemplateLoopContext_SetName;
*SetRowIndex = *ZNCc::CTemplateLoopContext_SetRowIndex;
*IncRowIndex = *ZNCc::CTemplateLoopContext_IncRowIndex;
*DecRowIndex = *ZNCc::CTemplateLoopContext_DecRowIndex;
*SetFilePosition = *ZNCc::CTemplateLoopContext_SetFilePosition;
*HasData = *ZNCc::CTemplateLoopContext_HasData;
*GetName = *ZNCc::CTemplateLoopContext_GetName;
*GetFilePosition = *ZNCc::CTemplateLoopContext_GetFilePosition;
*GetRowIndex = *ZNCc::CTemplateLoopContext_GetRowIndex;
*GetRowCount = *ZNCc::CTemplateLoopContext_GetRowCount;
*GetRows = *ZNCc::CTemplateLoopContext_GetRows;
*GetNextRow = *ZNCc::CTemplateLoopContext_GetNextRow;
*GetCurRow = *ZNCc::CTemplateLoopContext_GetCurRow;
*GetRow = *ZNCc::CTemplateLoopContext_GetRow;
*GetValue = *ZNCc::CTemplateLoopContext_GetValue;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CTemplate ##############

package ZNC::CTemplate;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CTemplate(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CTemplate($self);
        delete $OWNER{$self};
    }
}

*AddTagHandler = *ZNCc::CTemplate_AddTagHandler;
*GetTagHandlers = *ZNCc::CTemplate_GetTagHandlers;
*ResolveLiteral = *ZNCc::CTemplate_ResolveLiteral;
*Init = *ZNCc::CTemplate_Init;
*GetParent = *ZNCc::CTemplate_GetParent;
*ExpandFile = *ZNCc::CTemplate_ExpandFile;
*SetFile = *ZNCc::CTemplate_SetFile;
*SetPath = *ZNCc::CTemplate_SetPath;
*MakePath = *ZNCc::CTemplate_MakePath;
*PrependPath = *ZNCc::CTemplate_PrependPath;
*AppendPath = *ZNCc::CTemplate_AppendPath;
*RemovePath = *ZNCc::CTemplate_RemovePath;
*ClearPaths = *ZNCc::CTemplate_ClearPaths;
*PrintString = *ZNCc::CTemplate_PrintString;
*Print = *ZNCc::CTemplate_Print;
*ValidIf = *ZNCc::CTemplate_ValidIf;
*ValidExpr = *ZNCc::CTemplate_ValidExpr;
*IsTrue = *ZNCc::CTemplate_IsTrue;
*HasLoop = *ZNCc::CTemplate_HasLoop;
*GetValue = *ZNCc::CTemplate_GetValue;
*AddRow = *ZNCc::CTemplate_AddRow;
*GetRow = *ZNCc::CTemplate_GetRow;
*GetLoop = *ZNCc::CTemplate_GetLoop;
*DelCurLoopContext = *ZNCc::CTemplate_DelCurLoopContext;
*GetCurLoopContext = *ZNCc::CTemplate_GetCurLoopContext;
*GetCurTemplate = *ZNCc::CTemplate_GetCurTemplate;
*GetFileName = *ZNCc::CTemplate_GetFileName;
*set = *ZNCc::CTemplate_set;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CZNCTagHandler ##############

package ZNC::CZNCTagHandler;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::CTemplateTagHandler ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CZNCTagHandler(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CZNCTagHandler($self);
        delete $OWNER{$self};
    }
}

*HandleTag = *ZNCc::CZNCTagHandler_HandleTag;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CWebSession ##############

package ZNC::CWebSession;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CWebSession(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CWebSession($self);
        delete $OWNER{$self};
    }
}

*GetId = *ZNCc::CWebSession_GetId;
*GetUser = *ZNCc::CWebSession_GetUser;
*IsLoggedIn = *ZNCc::CWebSession_IsLoggedIn;
*IsAdmin = *ZNCc::CWebSession_IsAdmin;
*SetUser = *ZNCc::CWebSession_SetUser;
*ClearMessageLoops = *ZNCc::CWebSession_ClearMessageLoops;
*FillMessageLoops = *ZNCc::CWebSession_FillMessageLoops;
*AddError = *ZNCc::CWebSession_AddError;
*AddSuccess = *ZNCc::CWebSession_AddSuccess;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CWebSubPage ##############

package ZNC::CWebSubPage;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CWebSubPage(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CWebSubPage($self);
        delete $OWNER{$self};
    }
}

*F_ADMIN = *ZNCc::CWebSubPage_F_ADMIN;
*SetName = *ZNCc::CWebSubPage_SetName;
*SetTitle = *ZNCc::CWebSubPage_SetTitle;
*AddParam = *ZNCc::CWebSubPage_AddParam;
*RequiresAdmin = *ZNCc::CWebSubPage_RequiresAdmin;
*GetName = *ZNCc::CWebSubPage_GetName;
*GetTitle = *ZNCc::CWebSubPage_GetTitle;
*GetParams = *ZNCc::CWebSubPage_GetParams;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CWebAuth ##############

package ZNC::CWebAuth;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::CAuthBase ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CWebAuth(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CWebAuth($self);
        delete $OWNER{$self};
    }
}

*SetWebSock = *ZNCc::CWebAuth_SetWebSock;
*AcceptedLogin = *ZNCc::CWebAuth_AcceptedLogin;
*RefusedLogin = *ZNCc::CWebAuth_RefusedLogin;
*Invalidate = *ZNCc::CWebAuth_Invalidate;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CWebSessionMap ##############

package ZNC::CWebSessionMap;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CWebSessionMap(@_);
    bless $self, $pkg if defined($self);
}

*FinishUserSessions = *ZNCc::CWebSessionMap_FinishUserSessions;
sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CWebSessionMap($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CWebSock ##############

package ZNC::CWebSock;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::CHTTPSock ZNC );
%OWNER = ();
%ITERATORS = ();
*PAGE_NOTFOUND = *ZNCc::CWebSock_PAGE_NOTFOUND;
*PAGE_PRINT = *ZNCc::CWebSock_PAGE_PRINT;
*PAGE_DEFERRED = *ZNCc::CWebSock_PAGE_DEFERRED;
*PAGE_DONE = *ZNCc::CWebSock_PAGE_DONE;
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CWebSock(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CWebSock($self);
        delete $OWNER{$self};
    }
}

*ForceLogin = *ZNCc::CWebSock_ForceLogin;
*OnLogin = *ZNCc::CWebSock_OnLogin;
*OnPageRequest = *ZNCc::CWebSock_OnPageRequest;
*ParsePath = *ZNCc::CWebSock_ParsePath;
*ResolveModule = *ZNCc::CWebSock_ResolveModule;
*PrintTemplate = *ZNCc::CWebSock_PrintTemplate;
*PrintStaticFile = *ZNCc::CWebSock_PrintStaticFile;
*AddModLoop = *ZNCc::CWebSock_AddModLoop;
*GetDirs = *ZNCc::CWebSock_GetDirs;
*FindTmpl = *ZNCc::CWebSock_FindTmpl;
*SetPaths = *ZNCc::CWebSock_SetPaths;
*SetVars = *ZNCc::CWebSock_SetVars;
*FillErrorPage = *ZNCc::CWebSock_FillErrorPage;
*PrintErrorPage = *ZNCc::CWebSock_PrintErrorPage;
*GetSession = *ZNCc::CWebSock_GetSession;
*GetCSRFCheck = *ZNCc::CWebSock_GetCSRFCheck;
*GetSockObj = *ZNCc::CWebSock_GetSockObj;
*GetSkinPath = *ZNCc::CWebSock_GetSkinPath;
*GetModule = *ZNCc::CWebSock_GetModule;
*GetAvailSkins = *ZNCc::CWebSock_GetAvailSkins;
*GetSkinName = *ZNCc::CWebSock_GetSkinName;
*GetRequestCookie = *ZNCc::CWebSock_GetRequestCookie;
*SendCookie = *ZNCc::CWebSock_SendCookie;
*FinishUserSessions = *ZNCc::CWebSock_FinishUserSessions;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CZNC ##############

package ZNC::CZNC;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CZNC(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CZNC($self);
        delete $OWNER{$self};
    }
}

*ECONFIG_NOTHING = *ZNCc::CZNC_ECONFIG_NOTHING;
*ECONFIG_NEED_REHASH = *ZNCc::CZNC_ECONFIG_NEED_REHASH;
*ECONFIG_NEED_WRITE = *ZNCc::CZNC_ECONFIG_NEED_WRITE;
*DeleteUsers = *ZNCc::CZNC_DeleteUsers;
*Loop = *ZNCc::CZNC_Loop;
*WriteISpoof = *ZNCc::CZNC_WriteISpoof;
*ReleaseISpoof = *ZNCc::CZNC_ReleaseISpoof;
*WritePidFile = *ZNCc::CZNC_WritePidFile;
*DeletePidFile = *ZNCc::CZNC_DeletePidFile;
*WaitForChildLock = *ZNCc::CZNC_WaitForChildLock;
*FindSockByName = *ZNCc::CZNC_FindSockByName;
*IsHostAllowed = *ZNCc::CZNC_IsHostAllowed;
*AllowConnectionFrom = *ZNCc::CZNC_AllowConnectionFrom;
*InitDirs = *ZNCc::CZNC_InitDirs;
*OnBoot = *ZNCc::CZNC_OnBoot;
*ExpandConfigPath = *ZNCc::CZNC_ExpandConfigPath;
*WriteNewConfig = *ZNCc::CZNC_WriteNewConfig;
*WriteConfig = *ZNCc::CZNC_WriteConfig;
*ParseConfig = *ZNCc::CZNC_ParseConfig;
*RehashConfig = *ZNCc::CZNC_RehashConfig;
*GetVersion = *ZNCc::CZNC_GetVersion;
*GetTag = *ZNCc::CZNC_GetTag;
*GetUptime = *ZNCc::CZNC_GetUptime;
*ClearBindHosts = *ZNCc::CZNC_ClearBindHosts;
*AddBindHost = *ZNCc::CZNC_AddBindHost;
*RemBindHost = *ZNCc::CZNC_RemBindHost;
*Broadcast = *ZNCc::CZNC_Broadcast;
*AddBytesRead = *ZNCc::CZNC_AddBytesRead;
*AddBytesWritten = *ZNCc::CZNC_AddBytesWritten;
*BytesRead = *ZNCc::CZNC_BytesRead;
*BytesWritten = *ZNCc::CZNC_BytesWritten;
*GetTrafficStats = *ZNCc::CZNC_GetTrafficStats;
*AuthUser = *ZNCc::CZNC_AuthUser;
*SetConfigState = *ZNCc::CZNC_SetConfigState;
*SetSkinName = *ZNCc::CZNC_SetSkinName;
*SetStatusPrefix = *ZNCc::CZNC_SetStatusPrefix;
*SetISpoofFile = *ZNCc::CZNC_SetISpoofFile;
*SetISpoofFormat = *ZNCc::CZNC_SetISpoofFormat;
*SetMaxBufferSize = *ZNCc::CZNC_SetMaxBufferSize;
*GetConfigState = *ZNCc::CZNC_GetConfigState;
*GetManager = *ZNCc::CZNC_GetManager;
*GetModules = *ZNCc::CZNC_GetModules;
*FilterUncommonModules = *ZNCc::CZNC_FilterUncommonModules;
*GetSkinName = *ZNCc::CZNC_GetSkinName;
*GetStatusPrefix = *ZNCc::CZNC_GetStatusPrefix;
*GetCurPath = *ZNCc::CZNC_GetCurPath;
*GetHomePath = *ZNCc::CZNC_GetHomePath;
*GetZNCPath = *ZNCc::CZNC_GetZNCPath;
*GetConfPath = *ZNCc::CZNC_GetConfPath;
*GetUserPath = *ZNCc::CZNC_GetUserPath;
*GetModPath = *ZNCc::CZNC_GetModPath;
*GetPemLocation = *ZNCc::CZNC_GetPemLocation;
*GetConfigFile = *ZNCc::CZNC_GetConfigFile;
*WritePemFile = *ZNCc::CZNC_WritePemFile;
*GetISpoofFile = *ZNCc::CZNC_GetISpoofFile;
*GetISpoofFormat = *ZNCc::CZNC_GetISpoofFormat;
*GetBindHosts = *ZNCc::CZNC_GetBindHosts;
*GetListeners = *ZNCc::CZNC_GetListeners;
*TimeStarted = *ZNCc::CZNC_TimeStarted;
*GetMaxBufferSize = *ZNCc::CZNC_GetMaxBufferSize;
*Get = *ZNCc::CZNC_Get;
*FindUser = *ZNCc::CZNC_FindUser;
*FindModule = *ZNCc::CZNC_FindModule;
*DeleteUser = *ZNCc::CZNC_DeleteUser;
*AddUser = *ZNCc::CZNC_AddUser;
*GetUserMap = *ZNCc::CZNC_GetUserMap;
*FindListener = *ZNCc::CZNC_FindListener;
*AddListener = *ZNCc::CZNC_AddListener;
*DelListener = *ZNCc::CZNC_DelListener;
*SetMotd = *ZNCc::CZNC_SetMotd;
*AddMotd = *ZNCc::CZNC_AddMotd;
*ClearMotd = *ZNCc::CZNC_ClearMotd;
*GetMotd = *ZNCc::CZNC_GetMotd;
*ConnectUser = *ZNCc::CZNC_ConnectUser;
*EnableConnectUser = *ZNCc::CZNC_EnableConnectUser;
*DisableConnectUser = *ZNCc::CZNC_DisableConnectUser;
*LeakConnectUser = *ZNCc::CZNC_LeakConnectUser;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CServer ##############

package ZNC::CServer;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CServer(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CServer($self);
        delete $OWNER{$self};
    }
}

*GetName = *ZNCc::CServer_GetName;
*GetPort = *ZNCc::CServer_GetPort;
*GetPass = *ZNCc::CServer_GetPass;
*IsSSL = *ZNCc::CServer_IsSSL;
*GetString = *ZNCc::CServer_GetString;
*IsValidHostName = *ZNCc::CServer_IsValidHostName;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CPerlModule ##############

package ZNC::CPerlModule;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::CModule ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CPerlModule(@_);
    bless $self, $pkg if defined($self);
}

*GetPerlID = *ZNCc::CPerlModule_GetPerlID;
*OnBoot = *ZNCc::CPerlModule_OnBoot;
*WebRequiresLogin = *ZNCc::CPerlModule_WebRequiresLogin;
*WebRequiresAdmin = *ZNCc::CPerlModule_WebRequiresAdmin;
*GetWebMenuTitle = *ZNCc::CPerlModule_GetWebMenuTitle;
*OnWebPreRequest = *ZNCc::CPerlModule_OnWebPreRequest;
*OnWebRequest = *ZNCc::CPerlModule_OnWebRequest;
*GetSubPages = *ZNCc::CPerlModule_GetSubPages;
*OnPreRehash = *ZNCc::CPerlModule_OnPreRehash;
*OnPostRehash = *ZNCc::CPerlModule_OnPostRehash;
*OnIRCDisconnected = *ZNCc::CPerlModule_OnIRCDisconnected;
*OnIRCConnected = *ZNCc::CPerlModule_OnIRCConnected;
*OnIRCConnecting = *ZNCc::CPerlModule_OnIRCConnecting;
*OnIRCRegistration = *ZNCc::CPerlModule_OnIRCRegistration;
*OnBroadcast = *ZNCc::CPerlModule_OnBroadcast;
*OnConfigLine = *ZNCc::CPerlModule_OnConfigLine;
*OnWriteUserConfig = *ZNCc::CPerlModule_OnWriteUserConfig;
*OnWriteChanConfig = *ZNCc::CPerlModule_OnWriteChanConfig;
*OnDCCUserSend = *ZNCc::CPerlModule_OnDCCUserSend;
*OnChanPermission = *ZNCc::CPerlModule_OnChanPermission;
*OnOp = *ZNCc::CPerlModule_OnOp;
*OnDeop = *ZNCc::CPerlModule_OnDeop;
*OnVoice = *ZNCc::CPerlModule_OnVoice;
*OnDevoice = *ZNCc::CPerlModule_OnDevoice;
*OnMode = *ZNCc::CPerlModule_OnMode;
*OnRawMode = *ZNCc::CPerlModule_OnRawMode;
*OnRaw = *ZNCc::CPerlModule_OnRaw;
*OnStatusCommand = *ZNCc::CPerlModule_OnStatusCommand;
*OnModCommand = *ZNCc::CPerlModule_OnModCommand;
*OnModNotice = *ZNCc::CPerlModule_OnModNotice;
*OnModCTCP = *ZNCc::CPerlModule_OnModCTCP;
*OnQuit = *ZNCc::CPerlModule_OnQuit;
*OnNick = *ZNCc::CPerlModule_OnNick;
*OnKick = *ZNCc::CPerlModule_OnKick;
*OnJoin = *ZNCc::CPerlModule_OnJoin;
*OnPart = *ZNCc::CPerlModule_OnPart;
*OnChanBufferStarting = *ZNCc::CPerlModule_OnChanBufferStarting;
*OnChanBufferEnding = *ZNCc::CPerlModule_OnChanBufferEnding;
*OnChanBufferPlayLine = *ZNCc::CPerlModule_OnChanBufferPlayLine;
*OnPrivBufferPlayLine = *ZNCc::CPerlModule_OnPrivBufferPlayLine;
*OnClientLogin = *ZNCc::CPerlModule_OnClientLogin;
*OnClientDisconnect = *ZNCc::CPerlModule_OnClientDisconnect;
*OnUserRaw = *ZNCc::CPerlModule_OnUserRaw;
*OnUserCTCPReply = *ZNCc::CPerlModule_OnUserCTCPReply;
*OnUserCTCP = *ZNCc::CPerlModule_OnUserCTCP;
*OnUserAction = *ZNCc::CPerlModule_OnUserAction;
*OnUserMsg = *ZNCc::CPerlModule_OnUserMsg;
*OnUserNotice = *ZNCc::CPerlModule_OnUserNotice;
*OnUserJoin = *ZNCc::CPerlModule_OnUserJoin;
*OnUserPart = *ZNCc::CPerlModule_OnUserPart;
*OnUserTopic = *ZNCc::CPerlModule_OnUserTopic;
*OnUserTopicRequest = *ZNCc::CPerlModule_OnUserTopicRequest;
*OnCTCPReply = *ZNCc::CPerlModule_OnCTCPReply;
*OnPrivCTCP = *ZNCc::CPerlModule_OnPrivCTCP;
*OnChanCTCP = *ZNCc::CPerlModule_OnChanCTCP;
*OnPrivAction = *ZNCc::CPerlModule_OnPrivAction;
*OnChanAction = *ZNCc::CPerlModule_OnChanAction;
*OnPrivMsg = *ZNCc::CPerlModule_OnPrivMsg;
*OnChanMsg = *ZNCc::CPerlModule_OnChanMsg;
*OnPrivNotice = *ZNCc::CPerlModule_OnPrivNotice;
*OnChanNotice = *ZNCc::CPerlModule_OnChanNotice;
*OnTopic = *ZNCc::CPerlModule_OnTopic;
*OnServerCapAvailable = *ZNCc::CPerlModule_OnServerCapAvailable;
*OnServerCapResult = *ZNCc::CPerlModule_OnServerCapResult;
*OnTimerAutoJoin = *ZNCc::CPerlModule_OnTimerAutoJoin;
*OnEmbeddedWebRequest = *ZNCc::CPerlModule_OnEmbeddedWebRequest;
sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CPerlModule($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CPerlTimer ##############

package ZNC::CPerlTimer;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::CTimer ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CPerlTimer(@_);
    bless $self, $pkg if defined($self);
}

*RunJob = *ZNCc::CPerlTimer_RunJob;
*GetPerlID = *ZNCc::CPerlTimer_GetPerlID;
sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CPerlTimer($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::CPerlSocket ##############

package ZNC::CPerlSocket;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC::CSocket ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_CPerlSocket(@_);
    bless $self, $pkg if defined($self);
}

*GetPerlID = *ZNCc::CPerlSocket_GetPerlID;
sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_CPerlSocket($self);
        delete $OWNER{$self};
    }
}

*Connected = *ZNCc::CPerlSocket_Connected;
*Disconnected = *ZNCc::CPerlSocket_Disconnected;
*Timeout = *ZNCc::CPerlSocket_Timeout;
*ConnectionRefused = *ZNCc::CPerlSocket_ConnectionRefused;
*ReadData = *ZNCc::CPerlSocket_ReadData;
*ReadLine = *ZNCc::CPerlSocket_ReadLine;
*GetSockObj = *ZNCc::CPerlSocket_GetSockObj;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::String ##############

package ZNC::String;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_String(@_);
    bless $self, $pkg if defined($self);
}

*GetPerlStr = *ZNCc::String_GetPerlStr;
sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_String($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::StrPair ##############

package ZNC::StrPair;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_StrPair(@_);
    bless $self, $pkg if defined($self);
}

*swig_first_get = *ZNCc::StrPair_first_get;
*swig_first_set = *ZNCc::StrPair_first_set;
*swig_second_get = *ZNCc::StrPair_second_get;
*swig_second_set = *ZNCc::StrPair_second_set;
sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_StrPair($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::VPair ##############

package ZNC::VPair;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_VPair(@_);
    bless $self, $pkg if defined($self);
}

*size = *ZNCc::VPair_size;
*empty = *ZNCc::VPair_empty;
*clear = *ZNCc::VPair_clear;
*push = *ZNCc::VPair_push;
*pop = *ZNCc::VPair_pop;
*get = *ZNCc::VPair_get;
*set = *ZNCc::VPair_set;
sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_VPair($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : ZNC::VWebSubPages ##############

package ZNC::VWebSubPages;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( ZNC );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = ZNCc::new_VWebSubPages(@_);
    bless $self, $pkg if defined($self);
}

*size = *ZNCc::VWebSubPages_size;
*empty = *ZNCc::VWebSubPages_empty;
*clear = *ZNCc::VWebSubPages_clear;
*push = *ZNCc::VWebSubPages_push;
*pop = *ZNCc::VWebSubPages_pop;
*get = *ZNCc::VWebSubPages_get;
*set = *ZNCc::VWebSubPages_set;
sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        ZNCc::delete_VWebSubPages($self);
        delete $OWNER{$self};
    }
}

sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


# ------- VARIABLE STUBS --------

package ZNC;

*g_HexDigits = *ZNCc::g_HexDigits;
*CUtils_sDefaultHash = *ZNCc::CUtils_sDefaultHash;
*CS_INVALID_SOCK = *ZNCc::CS_INVALID_SOCK;
*CS_BLOCKSIZE = *ZNCc::CS_BLOCKSIZE;
*ADDR_IPV4ONLY = *ZNCc::ADDR_IPV4ONLY;
*ADDR_IPV6ONLY = *ZNCc::ADDR_IPV6ONLY;
*ADDR_ALL = *ZNCc::ADDR_ALL;
*Perl_NotFound = *ZNCc::Perl_NotFound;
*Perl_Loaded = *ZNCc::Perl_Loaded;
*Perl_LoadError = *ZNCc::Perl_LoadError;

	package ZNC::CModule;
	sub GetNVKeys {
		my $result = _GetNVKeys(@_);
		return @$result;
	}

	package ZNC;
	sub CreateWebSubPage {
		my ($name, %arg) = @_;
		my $params = $arg{params}//{};
		my $vpair = ZNC::VPair->new;
		while (my ($key, $val) = each %$params) {
			ZNC::_VPair_Add2Str($vpair, $key, $val);
		}
		my $flags = 0;
		$flags |= $ZNC::CWebSubPage::F_ADMIN if $arg{admin}//0;
		return _CreateWebSubPage($name, $arg{title}//'', $vpair, $flags);
	}

	package ZNC;
	*CONTINUE = *ZNC::CModule::CONTINUE;
	*HALT = *ZNC::CModule::HALT;
	*HALTMODS = *ZNC::CModule::HALTMODS;
	*HALTCORE = *ZNC::CModule::HALTCORE;
	*UNLOAD = *ZNC::CModule::UNLOAD;
1;
