main.c
来自「适合于Unix/Linux下的一个持久数据库连接池」· C语言 代码 · 共 67 行
C
67 行
// Copyright (c) 1999-2001 David Muse// See the file COPYING for more information#include <sybaseconnection.h>#include <rudiments/signalclasses.h>#include <stdlib.h>#include <stdio.h>#include <sys/types.h>#include <unistd.h>#ifdef NEED_REDHAT_9_GLIBC_2_3_2_HACKextern "C" { #include <ctype.h> const unsigned short int **__ctype_b() { return __ctype_b_loc(); } const __int32_t **__ctype_toupper() { return __ctype_toupper_loc(); } const __int32_t **__ctype_tolower() { return __ctype_tolower_loc(); }}#endifsybaseconnection *conn;signalhandler *alarmhandler;void cleanUp() { conn->closeConnection(); delete conn; delete alarmhandler;}void shutDown() { cleanUp(); exit(0);}int main(int argc, const char **argv) { #include <version.h> conn=new sybaseconnection(); // handle kill signals conn->handleShutDown((void *)shutDown); // handle alarm alarmhandler=new signalhandler(SIGALRM,(void *)shutDown); // open the connection if (conn->initConnection(argc,argv)) { // wait for connections conn->listen(); } // unsuccessful completion cleanUp(); exit(1);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?