All pastes #2478 Raw Edit

top of code

public cpp v1 · immutable
#2478 ·published 2004-11-30 11:15 UTC
rendered paste body
/* * Asterisk -- A telephony toolkit for Linux. * * Copyright (C) 1999-2004, Digium, Inc. * * Mark Spencer <markster@digium.com> * * res_odbc.c <ODBC resource manager> * Copyright (C) 2004 Anthony Minessale II <anthmct@yahoo.com> */#include <asterisk/file.h>#include <asterisk/logger.h>#include <asterisk/channel.h>#include <asterisk/config.h>#include <asterisk/options.h>#include <asterisk/pbx.h>#include <asterisk/module.h>#include <asterisk/cli.h>#include <asterisk/lock.h>#include <stdlib.h>#include <unistd.h>#include <string.h>#include <asterisk/res_odbc.h>#define MAX_ODBC_HANDLES 25struct odbc_list{        char name[80];        odbc_obj *obj;        int used;};static struct odbc_list ODBC_REGISTRY[MAX_ODBC_HANDLES];static void odbc_destroy(void){        int x = 0;        for (x = 0; x < MAX_ODBC_HANDLES; x++) {                if (ODBC_REGISTRY[x].obj) {                        destroy_obdc_obj(&ODBC_REGISTRY[x].obj);                        ODBC_REGISTRY[x].obj = NULL;                }        }}