Connection * InitConnection(ForkDesc *desc, DnsRes *dres) { MemPool *pool = NULL; Connection *conn = zalloc(&pool, sizeof(Connection)); desc->d_Data = conn; if (dres) conn->co_Auth = *dres; conn->co_Desc = desc; conn->co_MemPool = pool; gettimeofday(&conn->co_RateTv, NULL); conn->co_LastActiveTime = conn->co_SessionStartTime = conn->co_RateTv.tv_sec; MBInit(&conn->co_TMBuf, desc->d_Fd, &conn->co_MemPool, &conn->co_BufPool); MBInit(&conn->co_RMBuf, desc->d_Fd, &conn->co_MemPool, &conn->co_BufPool); MBInit(&conn->co_ArtBuf, -1, &conn->co_MemPool, &conn->co_BufPool); if (conn->co_Desc->d_Type == THREAD_NNTP) { conn->co_ClientTotalByteCount = 0.0; conn->co_ClientTotalArticleCount = 0; conn->co_ClientGroupByteCount = 0.0; conn->co_ClientGroupArticleCount = 0; conn->co_ClientGroupCount = conn->co_ClientPostCount = 0; } return(conn); }
bool GUIIsDBCS( void ) { if( !Init ) { MBInit(); Init = TRUE; } return( IsDBCS ); }
int GUICharLen( int ch ) { if( !Init ) { MBInit(); Init = TRUE; } return( __CharLenTable[ch] ); }