#EDIR DATA#
DOCTYPE='BOOK' PUBLICID='-//SYBOOKS//Default DTD//EN' SYSTEMID=''DOCTYPE='book' PUBLICID='' SYSTEMID=''Open Server Server-Library/C Reference ManualOpen Servername='trade' font='symbol' code='228'  charset='fontspecific'Server-Library/C Reference ManualREMAP="titleBO--Body"Open Server Release 10.0REMAP="titleBO--Body"Document ID: 35400-00-1000-03REMAP="titleBO--Body"Change Level: 1REMAP="titleBO--Body"Last Revised: December 30, 1993Principal authorship: Jenny SchafferDocument ID: 35400-00-1000REMAP="discBO--Body"This publication pertains to Open Server Release 10.0 of the SYBASE database management software and to any subsequent release until otherwise indicated in new editions or technical notes. Information in this document is subject to change without notice. The software described herein is furnished under a license agreement, and it may be used or copied only in accordance with the terms of the agreement.Document OrdersREMAP="discBO--Body"Customers may purchase additional copies of any document or the right to make photocopies of documentation for their in-house use.REMAP="discBO--Body"To order additional documents or photocopy rights, U.S. and Canadian customers should call Customer Fulfillment at (800) 685-8225, fax (617) 229-9845.REMAP="discBO--Body"Customers in other countries with a U.S. license agreement may contact Customer Fulfillment via the fax number. All other international customers should contact their Sybase subsidiary or local distributor.REMAP="discBO--Body"Upgrades are provided only at regularly scheduled software release dates.REMAP="discBO--Body"© Copyright Sybase, Inc., 1989, 1994. All rights reserved.REMAP="discBO--Body"No part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic, mechanical, manual, optical or otherwise, without prior written permission of Sybase, Inc.Sybase TrademarksREMAP="discBO--Body"SYBASE, the SYBASE logo, SyBooks, APT-FORMS, Data Workbench, DBA Companion, Deft, GainMomentum, SA Companion, SQL Debug, SQL Solutions, SQR, Transact-SQL, and VQL are registered trademarks of Sybase, Inc. ADA Workbench, Adaptable Windowing Environment, Application Manager, Applications from Models, APT Workbench, APT-Build, APT-Edit, APT-Execute, APT-Translator, APT-Library, Build Momentum, Camelot, Client/Server Architecture for the Online Enterprise, Client/Server for the Real World, Configurator, DataServer, Data Workbench, Database Analyzer, DB-Library, Deft Analyst, Deft Designer, Deft Educational, Deft Professional, Deft Trial, Developers Workbench, Easy SQR, Embedded SQL, Enterprise Builder, Enterprise Client/Server, Enterprise Meta Server, Enterprise Modeler, Enterprise Momentum, Gain, GainExposure, Insight, Mainframe Access Products (MAP), Momentum, Movedb, Navigation Server, Net-Gateway, Net Library, Object Momentum, OmniSQL Gateway, Omni SQL Server, OmniSQL Access Module, Open Client, Open Gateway, Open Server, Open Solutions, PC APT-Execute, PC DB-Net, PC Net Library, Report Workbench, Report Execute, Open Server, Partnerships that Work, Replication Server, Resource Manager, RW-Display Lib, RW-Library, SA Monitor, Secure SQL Server, Secure SQL Toolset, SQL Code Checker, SQL Edit/TPU, SQL Edit, SQL Monitor, SQL Server, SQL Toolset, SQL Server/CFT, SQL Server/DBM, SQL Station, SQR Toolset, SQR Developers Kit, SQR Workbench, SYBASE Client/Server Interfaces, SYBASE Gateways, SYBASE SQL Lifecycle, Sybase Synergy Program, SYBASE Virtual Server Architecture, SYBASE User Workbench System 10, Tabular Data Stream, and The Enterprise Client/Server Company are trademarks of Sybase, Inc.REMAP="discBO--Body"All other company and product names used herein may be the trademarks or registered trademarks of their respective companies.Restricted Rights LegendREMAP="discBO--Body"Use, duplication or disclosure by the Government is subject to restrictions set forth in subparagraph (c)(1)(ii) of DFARS 52.227-7013 for the DOD and as set forth in FAR 52.227-19(a)-(d) for civilian agencies.REMAP="discBO--Body"Sybase, Inc., 6475 Christie Avenue, Emeryville, CA 94608PrefaceREMAP="BO--Body"This document, the Open Server Server-Library/C Reference Manual, contains reference information for the C version of Open Servername='trade' font='symbol' code='228'  charset='fontspecific' Server-Library.RENDERAS="SECT1"AudienceREMAP="BO--Body"The Open Server Reference Manual is designed to serve as a reference manual for programmers who are writing Open Server applications. It is written for applications programmers familiar with the C programming language.RENDERAS="SECT1"How to Use This BookREMAP="BO--Body"When writing an Open Server application, use the Open Server Reference Manual as a source of reference information.REMAP="BO--Body"LINKEND="X11111"Chapter 1, "Introducing Open Server," contains a brief introduction to Open Server. REMAP="BO--Body"LINKEND="X22222"Chapter 2, "Topics," contains information on how to accomplish specific programming tasks, such as using Server-Library
routines to read a text or image value from the server
. This chapter also contains information on Open Server structures, programming techniques, and error handling.REMAP="BO--Body"LINKEND="X33333"Chapter 3, "Routines," contains specific information about each Server-Library routine, such as what parameters the routine takes and what it returns.REMAP="BO--Body"LINKEND="X44444"Chapter 4, "System Registered Procedures," contains information on the registered procedures built into the Open Server at start-up time. It includes a description of parameters, results and messages. RENDERAS="SECT1"Related DocumentsREMAP="BO--Body"The Open Client/Server Installation Guide for your platform explains how to install Open Server.REMAP="BO--Body"The Open Client and Open Server Common Libraries Reference Manual contains reference information for:MARK="BULL" REMAP="BU--Bullet"CS-LibraryClient-Library and Server-Library bulk copy routinesREMAP="BO--Body"The Open Client/Server Supplement for your platform contains platform-specific material for Open Client/Server products. This document includes information about:MARK="BULL" REMAP="BU--Bullet"The interfaces fileCompiling and linking an applicationThe example programs that are included on-line with Open Client/Server productsRoutines that have platform-specific behaviorsLocalizationRENDERAS="SECT2"Other Sources of InformationREMAP="BO--Body"The SYBASE®
document set includes a wide range of user guides and reference manuals that describe all aspects of the SYBASE relational database management system. Because application development can draw on a number of different parts of the SYBASE system, you may encounter most of the SYBASE document set at some time or another. A few manuals, however, will prove to be particularly useful: MARK="BULL" REMAP="BU--Bullet"The Open Client Client-Library/C Reference Manual contains reference information for Client-Library, a collection of routines for use in writing client applications.The Open Client DB-Library/C Reference Manual describes DB-Libraryname='trade' font='symbol' code='228'  charset='fontspecific'. Like Client-Library, DB-Library
is a collection of routines for use in writing client applications.The SYBASE SQL Server Reference Manual describes the Transact-SQL®
database language, which an application uses to create and manipulate SQL Server
database objects. RENDERAS="SECT1"ConventionsREMAP="BO--Body"Server-Library routine syntax is shown like this:REMAP="LS--LangSyntax" FORMAT="LINESPECIFIC"CS_RETCODE srv_getmsgq(msgqid, msgp, getflags, infop)SRV_OBJID       msgqid;CS_VOID         *msgp;CS_INT          getflags;CS_INT          *infop;REMAP="BO--Body"Program text and computer output are shown like this:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"srv_getmsgq(myqid, msgbuf, SRV_M_NOWAIT, &info);REMAP="BO--Body"Structure names and symbolic constants are written in small capital letters, like this: REMAP="BO--Body" CS_CONTEXT, SRV_CURDESCRENDERAS="SECT1"If You Need HelpREMAP="BO--Body"Help is available for your SYBASE software in the form of documentation, on-line help, and a Technical Support Center.RENDERAS="SECT2"On-Line HelpREMAP="BO--Body"Open Server
release 10.0 includes a number of sample Open Server application
programs. They are located in $SYBASE/sample/srvlibrary. The Open Client/Server Supplement for your platform summarizes each sample program and describes the requirements for running each.REMAP="BO--Body"If you have access to a SYBASE SQL Servername='trade' font='symbol' code='228'  charset='fontspecific' release 10.0, you can use MOREINFO="NONE"sp_syntax, a SYBASE system procedure, to retrieve the syntax of Server-Library routines. For information on how to install MOREINFO="NONE"sp_syntax, see the System Administration Guide Supplement for your platform. For information on how to run MOREINFO="NONE"sp_syntax, see its reference page in Volume 2 of the SYBASE SQL Server Reference Manual.RENDERAS="SECT2"Technical SupportREMAP="BO--Body"Each SYBASE installation has a designated person to contact Sybase Technical Support. If you cannot resolve your problem with theOpen Client/Server Supplement manuals or on-line help, ask the designated person at your site to contact Technical Support.NUMBER="1" ID="X11111"Introducing Open ServerID="IN1139921"Client/serverarchitectureRENDERAS="SECT1"Client/Server ArchitectureREMAP="BO--Body"Client/server architecture divides the work of computing between "clients" and "servers."REMAP="BO--Body"Clients make requests of servers and process the results of those requests. For example, a client application might request data from a database server. Another client application might send a request to an environmental control server to lower the temperature in a room.REMAP="BO--Body"Servers respond to requests by returning data or other information to clients, or by taking some action. For example, a database server returns tabular data and information about that data to clients, and an electronic mail server directs incoming mail toward its final destination.FLOAT="0"FORMAT="UNKNOWN" FILEREF="fig1_1.xwd"LBL="Figure 1-1: "Client/Server ArchitectureREMAP="BO--Body"Client/server architecture has several advantages over traditional program architectures:MARK="BULL" REMAP="BU--Bullet"Application size and complexity can be significantly reduced, because common services are handled in a single location, a server. This simplifies client applications, reduces duplicate code, and makes application maintenance easier.Client/server architecture facilitates communication between varied applications. Client applications that use dissimilar communication protocols cannot communicate directly, but can communicate through a server that "speaks" both protocols, known as a gateway
.ID="IN1139832"Client/serverarchitectureClient/server architecture enables applications to be developed with distinct components. These components can be modified or replaced without affecting other parts of the application.ID="IN169833"Clienttypes of clients
ID="IN169834"Clientdefinition ofRENDERAS="SECT2"Types of ClientsREMAP="BO--Body"A client is any application that makes requests of a server. SYBASE clients include:MARK="BULL" REMAP="BU--Bullet" SQL Toolset products such as APT-Edit and Data Workbench.Standalone utilities provided with SQL Server, such as MOREINFO="NONE"isql and MOREINFO="NONE"bcp.Applications written using Open Client libraries.Applications written using Open Client Embedded SQL.ID="IN179835"Serverstypes of serversRENDERAS="SECT2"Types of ServersREMAP="BO--Body"The SYBASE product line includes servers and tools for building servers:MARK="BULL" REMAP="BU--Bullet"SYBASE SQL Server is a database server. SQL Servers manage information stored in one or more databases.SYBASE Open Server provides the tools and interfaces needed to create a custom server. A custom server built with SYBASE Open Server is called an "Open Server application". ID="IN1239836"Open Server applicationdefinition ofREMAP="BO--Body"An Open Server application can be any type of server. For example, an Open Server application can perform specialized calculations, provide access to real time data, or interface with services such as electronic mail. An Open Server application is created using the building blocks provided by Open Server Server-Library.
ID="IN1239747"Open Server applicationcontrasted with SQL ServerREMAP="BO--Body"SQL Server and Open Server applications are similar in some ways:MARK="BULL" REMAP="BU--Bullet"SQL Server and Open Server applications are both servers, responding to client requests.Clients communicate with both SQL Server and Open Server applications through Open Client libraries.REMAP="BO--Body"But they also differ:MARK="BULL" REMAP="BU--Bullet"An application programmer must create an Open Server application, using Open Server's building blocks and supplying custom code. SQL Server is complete and does not require custom code.An Open Server application can be any kind of server, and can be written to understand any language. SQL Server is a database server, and understands only Transact-SQL.ID="IN1289478"Tabular Data Stream protocolSee TDS
ID="IN139479"TDSdefinition ofAn Open Server can communicate with "foreign" applications and servers that are not based on Sybase's Tabular Data Stream, or TDS
, protocol. It can also communicate with SYBASE applications and servers. SQL Server can communicate directly only with SYBASEID="IN12393810"Open Server applicationcontrasted with SQL Server
 applications and servers. In order to communicate with foreign applications and servers, it must use an Open Server gateway application as an intermediary.ID="IN11193811"Open Serverposition in client/server architectureRENDERAS="SECT2"Open Server ConfigurationsREMAP="BO--Body"An Open Server application's position in the client/server architecture depends on its function. Open Server applications fall into one of three functional categories: standalone, auxiliary, or gateway.ID="IN12393812"Open Server applicationstand-aloneREMAP="BO--Body"Figure 1-2 shows a standalone Open Server application. A client connects directly to a standalone Open Server application and submits requests using remote procedure calls (RPCs), which is a command language the server is programmed to recognize, a cursor
 command, or any other kind of client command
. The Open Server application programmer supplies code to process client commands.FLOAT="0"FORMAT="UNKNOWN" FILEREF="fig1_2.xwd"LBL="Figure 1-2: "A Standalone Open ServerID="IN12393813"Open Server applicationauxiliaryREMAP="BO--Body"An auxiliary Open Server application is shown in Figure 1-3. This category of Open Server application supports SQL Server by processing RPCs. The client connects directly to SQL Server and uses Transact-SQL for its language requests. To execute a procedure on the Open Server application, the client prefixes the procedure name with the name of the Open Server application, which causes SQL Server to initiate an RPC. An RPC is the only type of client command that can be sent to an Open Server via a SQL Server. REMAP="BO--Body"Using server-to-server RPCs, the Open Server can perform specialized calculations, provide access to real time data, and permit a SQL Server to access services such as electronic mail.FLOAT="0"FORMAT="UNKNOWN" FILEREF="fig1_3.xwd"LBL="Figure 1-3: "An Auxiliary Open ServerID="IN12393814"Open Server applicationgatewayREMAP="BO--Body"Figure 1-4 shows an Open Server application in a gateway role. A gateway server enables a client to access a server that cannot accept the client connection directly. The gateway does not have to connect to a SQL Server, or for that matter, to any DBMS server. It could connect to a file system or an application program that can be treated as a server.FLOAT="0"FORMAT="UNKNOWN" FILEREF="fig1_4.xwd"LBL="Figure 1-4: "A Gateway Open ServerREMAP="BO--Body"An Open Server application that accesses a SQL Server or another Open Server includes both Client-Library and Server-Library routines. It plays both client and server roles. In the server role, it uses Open Server to interface with clients. In the client role, it uses Client-Library routines to send requests to, and receive results from, a SQL Server or another Open Server. See the LINKEND="X70123"Gateway Applications
 topics page, for details.REMAP="BO--Body"The gateway above connects clients to a SQL Server. The gateway program uses Server-Library to process client requests and Client-Library to connect to the SQL server. The dotted lines in the illustration indicate that this particular gateway uses "TDS pass through mode," a low-overhead method of passing requests and results between SYBASE clients and SYBASE servers. See the LINKEND="X16584"Pass-Through Mode
  topics page, for details.RENDERAS="SECT1"The Open Server ProductREMAP="BO--Body"SYBASE Open Server provides the tools and interfaces needed to create custom server applications.REMAP="BO--Body"Open Server can be thought of as having two components: programming interfaces and network services.REMAP="BO--Body"The programming interfaces component of Open Server contains Server-Library. (Both Open Client and Open Server include CS-Library, which contains utility routines that are useful to both client and server applications.)REMAP="BO--Body"Open Server network services are, in most cases, transparent to Open Server developers and end-users of Open Server applications. On PC platforms, however, networking services are externalized.ID="IN11193815"Net-Libraryproviding network servicesREMAP="BO--Body"Network services include Net-Library, which provides support for specific network protocols, such as TCP/IP.RENDERAS="SECT2"The Open Server LibrariesREMAP="BO--Body"The libraries that make up Open Server programming interfaces are:MARK="BULL" REMAP="BU--Bullet"Server-Library, a collection of routines for use in writing server applications.ID="IN11093816"CS-Librarydefinition ofCS-Library, a collection of utility routines that are useful to both client and server applications. All Server-Library programs must include at least one call to CS-Library, because Server-Library routines use a structure that is allocated in CS-Library.REMAP="BO--Body"standalone and auxiliary Open Server applications include calls to Server-Library and CS-Library. Gateway applications include calls to Server-Library, CS-Library, and Client-Library.ID="IN11193817"Open Serverdescription of contentsRENDERAS="SECT2"What Is in Open Server?REMAP="BO--Body"Open Server includes routines that listen for commands from clients and return results to clients. Other routines set application attributes, handle error conditions, schedule interactions with clients, and provide a variety of information about client connections. ID="IN11193818"Open Serverheader filesREMAP="BO--Body"Open Server also contains a set of header files that define structures, types, and values used by Server-Library routines. They are: ospublic.h, oserror.h, and oscompat.h.ID="IN13592919"Building an Open Server applicationRENDERAS="SECT1"Using Open ServerREMAP="BO--Body"An application programmer writes an Open Server application, using calls to Server-Library and CS-Library routines to set up structures, listen for connection requests from clients and other servers, process client requests, and clean up. A gateway application also includes calls to Client-Library routines. An Open Server application program is compiled in the same way as any other C language program.RENDERAS="SECT2"Basic Control StructureID="IN120901120"CS_CONTEXT structureREMAP="BO--Body"An Open Server application requires a CS_CONTEXT structure, which defines a particular application "context", or operating environment. A CS_CONTEXT contains localization information, as well as server-wide control information. The first step in any Open Server application program is to call MOREINFO="NONE"cs_ctx_alloc, which allocates a CS_CONTEXT structure.REMAP="BO--Body"An application programmer shapes an application's behavior and attributes by manipulating the contents of the application's CS_CONTEXT structure. The MOREINFO="NONE"Tailoring Your Open Server topics page describes this process in detail.RENDERAS="SECT2"Steps in a Simple ProgramREMAP="BO--Body"On most platforms, a simple Open Server application program involves the following steps:Set up the Open Server operating environment by allocating structures and setting global attributes, known as properties.ID="IN114901121"Error handlersinstallation ofDefine error handling. Applications may install an error handling routine, which Open Server calls when it detects an error. Applications may also call the MOREINFO="NONE"srv_sendinfo routine on an ad hoc basis to send error messages to the client. See   the LINKEND="X24762"Errors
 topics page, for details.ID="IN16901122"EventshandlingInstall event-handling routines, which Open Server calls when client commands trigger Open Server events. An Open Server application does most of its work inside its event-handling routines.ID="IN123901123"Open Server applicationinitializingInitialize the server and start it running. In this state, the server simply listens for client requests.Exit.REMAP="BO--Body"The example program in the following section demonstrates all but step 3.ID="IN123891224"Open Server applicationa simple programRENDERAS="SECT1"Basic Open Server Program   REMAP="BO--Body"The following code illustrates the basic framework of an Open Server application program:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/***    This is a simple sample program that demonstrates the**    basic steps necessary to initialize and start up an**    Open Server application. No user-defined event handlers are**    installed.         REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** /*** Include the required Open Server header files.****    ospublic.h: Public Open Server structures, typedefs,**    defines, and function prototypes.****    oserror.h:   Open Server error number defines. This header**    file is only required if the Open Server application wants**    to detect specific errors inside the Open Server error**    handler.*/#include        <ospublic.h>#include        <oserror.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/***    Include the operating system specific header files required**    by this Open Server application.*/#include        <stdio.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*** Local defines.****    NIL            NULL type cast macro.**    OS_ARGCOUNT    Expected number of command line arguments*/#define        NIL(S)        (S)NULL#define        OS_ARGCOUNT2REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/***    This is the main entry point for this sample Open Server**    application.****    This Open Server application expects the following **    command line arguments:****    servername: The name of the Open Server application.****    This name must exist in the interfaces file defined by**    the SYBASE environment variable.**** Returns:**    0        Open Server exited successfully.**    1        An error was detected during initialization.*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"int      main(argc,
argv)int      argc;char     *argv[];{
    CS_CONTEXT     *cp;              /* Context structure.   */  
    CS_CHAR        *servername;      /* Open Server name.    */
    CS_CHAR        logfile[512];     /* Log file name.       */ 
    CS_BOOL        ok;               /* Error control flag.  */
    SRV_SERVER     *ssp;             /* Server control structure.*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Initialization.      */     ok = CS_TRUE;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*     ** Read the command line options.  There must be one     ** argument specifying the server name.     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if(argc != OS_ARGCOUNT)    {        (CS_VOID)fprintf(stderr, "Invalid number of        arguments(%d)\n",argc);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        (CS_VOID)fprintf(stderr, "Usage: <program>         <server name>\n");        exit(1);    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*    ** Initialize `servername' to the command line argument    ** provided.    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    servername = (CS_CHAR *)argv[1];REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*    ** Allocate a CS-Library context structure to define the    ** default localization information.  Open Server     ** also stores global state information in this structure    ** during initialization.    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if(cs_ctx_alloc(CS_VERSION_100, &cp) != CS_SUCCEED)    {        (CS_VOID)fprintf(stderr, "%s: cs_ctx_alloc failed",        servername);        exit(1);    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*    ** Default Open Server localization information can be    ** changed here before calling srv_version, using cs_config    ** and cs_locale.    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*    ** Set the Open Server version and context information    */    if(srv_version(cp, CS_VERSION_100) != CS_SUCCEED)    {        /*        ** Release the context structure already allocated.        */        (CS_VOID)cs_ctx_drop(cp);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        (CS_VOID)fprintf(stderr, "%s: srv_version failed",                                                    servername);        exit(1);    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*    ** There is no error handler installed in this sample    ** Open Server application.  Any errors detected by Open    ** Server are written to the Open Server log file    ** configured below.  A real Open Server application would    ** want to install an error handler just after calling    ** srv_version so that any subsequent errors are detected    ** by the Open Server** application code.    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*    ** Default Open Server global properties can be changed here    ** before calling srv_init.  We choose just to change the    ** default log file name to use the name of this Open    ** Server application.    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*    ** Build a new Open Server log file name using `servername'    */    (CS_VOID)sprintf(logfile, "%s.log", servername);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*    ** Set the new log file name using the global SRV_S_LOGFILE    ** property.    */    if(srv_props(cp, CS_SET, SRV_S_LOGFILE, logfile,    CS_NULLTERM,NIL(CS_INT *)) != CS_SUCCEED)    {        /*        ** Release the context structure already allocated.        */        (CS_VOID)cs_ctx_drop(cp);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        (CS_VOID)fprintf(stderr,"%s: srv_props(SRV_S_LOGFILE)        failed\n",servername);        exit(1);    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*    ** Initialize Open Server. This causes Open Server to    ** allocate internal control structures based on the global    ** properties set above. Open Server also looks up     ** the application name in the interfaces file.    */    if((ssp = srv_init(NIL(SRV_CONFIG *), servername,    CS_NULLTERM))== NIL(SRV_SERVER *))    {        /*        ** Release the context structure already allocated        */        (CS_VOID)cs_ctx_drop(cp);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        (CS_VOID)fprintf(stderr, "%s: srv_init failed\n",        servername);        exit(1);    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*    ** Start the Open Server application running.  We don't    ** install any event handlers in this simple example.  This    ** causes Open Server to use the default event    ** handlers.  These enable SYBASE client programs    ** (i.e., isql) to connect with this Open Server. The call    ** to srv_run does not return until a fatal error is    ** detected by this Open Server application, or a SRV_STOP    ** event is queued.  Since we haven't installed any event    ** handlers,the only way to stop this Open Server    ** application is to kill the operating system process in    ** which it is running.    */    if(srv_run(NIL(SRV_SERVER *)) == CS_FAIL)    {        (CS_VOID)fprintf(stderr, "%s: srv_run failed\n",        servername);        ok = CS_FALSE;    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*    ** Release all allocated control structures and exit.    */    (CS_VOID)srv_free(ssp);    (CS_VOID)cs_ctx_drop(cp);    exit(ok ? 0 : 1);ID="IN123881325"Open Server applicationa simple program
}RENDERAS="SECT1"Open Server Events   ID="IN16881326"Eventsdefinition ofREMAP="BO--Body"An Open Server can receive several kinds of requests from client applications. Many requests trigger an event
 in the server, causing the client's server process, known as a thread
, to execute a routine that processes the event. REMAP="BO--Body"Some events cannot be directly triggered by client programs. Programmer-defined events and SRV_STOP are triggered by calling MOREINFO="NONE"srv_event in the Open Server code, and SRV_START occurs as a part of the start-up process.REMAP="BO--Body"For more information, see  the LINKEND="X78566""Events"
 topics page.ID="IN121881327"Registered proceduresdefinition ofREMAP="BO--Body"Registered procedures, a special class of procedures accessible via Client-Library and Server-Library, are handled without events and event handler
 routines. A special subclass of registered procedures, known as system registered procedures, are created automatically when the server starts up. See  the LINKEND="X80111"Registered Procedures
 topics page for details. See Chapter 4 for a detailed description of each system registered procedure
.ID="IN17881328"Resultsoverview of
ID="IN17881329"ResultsprocessingRENDERAS="SECT2"Returning Results to Clients   REMAP="BO--Body"An Open Server application can send results to a client as messages, rows of data, result parameters, or status values. A single client request can have more than one set of results. After sending a result set, call MOREINFO="NONE"srv_senddone with a status of SRV_DONE_MORE if there are more result sets for the request, or SRV_DONE_FINAL if there are no more results. Calling MOREINFO="NONE"srv_senddone with a SRV_DONE_FINAL status is the minimum response to a client request. RENDERAS="SECT3"MessagesREMAP="BO--Body"An application can send error messages to clients with MOREINFO="NONE"srv_sendinfo. Client-Library programs process messages with a message handler routine. These routines typically display the message information on the user's terminal. If the message is an error message
, the client program can attempt to recover from the error or exit.ID="IN113881330"Status valuesreturning to clientRENDERAS="SECT3"Status ValuesREMAP="BO--Body"An application can call MOREINFO="NONE"srv_sendstatus to return an optional status value to a client application. The status is a CS_INT value that has an application-specific meaning. There can be just one status value for each set of results. ID="IN110851631"Parametersreturn parameters, See Return parametersRENDERAS="SECT3"ParametersREMAP="BO--Body"Parameters contain data that is passed between clients and the Open Server with client commands.RENDERAS="SECT3"Data Rows   REMAP="BO--Body"Open Server can return rows of data to clients just like SQL Server returns the results of SQL queries. A row consists of one or more columns of data. See  the LINKEND="X25021"Processing Parameter and Row Data
 topics page, for details.ID="IN17851632"Resultsorder returned inRENDERAS="SECT3"Order of Results   REMAP="BO--Body"The order in which you return results to clients is important. Here are the rules to follow: MARK="BULL" REMAP="BU--Bullet"Do not interrupt a set of data rows with other kinds of results. Data rows must be sent one after another until the entire set has been sent to the client. For example, you cannot send a few rows, then send a message, then send more rows. After you have sent all of the data rows (if any), you can send messages and status information to the client in any order. At the end of a set of results, call MOREINFO="NONE"srv_senddone to signal the end of the results. ID="IN114851633"Error handlersinstallation ofRENDERAS="SECT2"Error HandlingREMAP="BO--Body"One of the first actions to take in an Open Server application is to install an error handler with MOREINFO="NONE"srv_props. If no error handler has been installed, Open Server writes the error messages to the log file. See   the LINKEND="X24762"Errors
  topics page, for details.ID="IN135841734"Building an Open Server application
ID="IN123841735"Multithread programmingoverview ofRENDERAS="SECT1"Multithread Programming   REMAP="BO--Body"Open Server has a multithread architecture. This allows application developers to create multithread servers. A multithread server is a collection of threads, each executing routines to accomplish its specific task. For example, each client
 has a thread to manage its connection and execute the event handlers and procedures that fulfill its requests. The Open Server run-time system has several threads that manage server activities such as delivering messages, handling network communications, and scheduling tasks in the server. You can spawn threads for other non-client activities.REMAP="BO--Body"See   the LINKEND="X61092"Multithread Programming
 topics page, for details.ID="IN17812036"ChangesSee Migration from 2.0 to 10.0
ID="IN126802137"Migration from 2.0 to 10.0summary of new features RENDERAS="SECT1"Changes in This ReleaseREMAP="BO--Body"Release 10.0 of Open Server alters some 2.0 functionality and introduces a substantial number of new features. Because of this, existing applications require immediate changes, and may require future changes as well. For information on how to get an existing application up and running in a 10.0 environment, see   the LINKEND="X16149"Migration from 2.0 to 10.0
 topics page. For a discussion of how to ready an application to run with post-10.0 Open Server releases, see   the LINKEND="X12698"Preparing for Future Open Server Releases
 topics page. New users need not concern themselves with these two topics pages.RENDERAS="SECT2"New FeaturesREMAP="BO--Body"Below is a list of new features for Open Server release 10.0. Each is described in further detail in the topics page or reference page whose name follows in parentheses. Note that bulk copy
 support is documented in the Open Client and Open Server Common
Libraries Reference Manual, and multiple network listener
support is documented in the Open Client/Server Supplement
for your platform.MARK="BULL" REMAP="BU--Bullet"Browse mode (MOREINFO="NONE"Browse Mode)Bulk copyCapabilities (MOREINFO="NONE"Negotiated MOREINFO="NONE"Behavior, MOREINFO="NONE"Capabilities)Localization (MOREINFO="NONE"International MOREINFO="NONE"Support)Compute rows (MOREINFO="NONE"srv_alt_header)Control rows (MOREINFO="NONE"srv_setcontrol)Configuration of global behavior (MOREINFO="NONE"Tailoring Your Open Server)Cursors (MOREINFO="NONE"Cursors)Dynamic SQL
 (MOREINFO="NONE"Dynamic MOREINFO="NONE"SQL)Environment changes (MOREINFO="NONE"srv_envchange)Multiple network listener supportMessages (MOREINFO="NONE"Datastream Messages)Negotiated logins (MOREINFO="NONE"Negotiated MOREINFO="NONE"Behavior)New data binding model (MOREINFO="NONE"Processing MOREINFO="NONE"Parameter MOREINFO="NONE"and MOREINFO="NONE"Row MOREINFO="NONE"Data)New datatypes (MOREINFO="NONE"Types)Options (MOREINFO="NONE"Options)Order-by information (MOREINFO="NONE"srv_orderby)Parameterized error information (MOREINFO="NONE"Client Command Errors)Retrieval of thread information (MOREINFO="NONE"Thread MOREINFO="NONE"Properties)Shared Open Client/Open Server connectivity features (MOREINFO="NONE"CS-LibraryID="IN126792238"Migration from 2.0 to 10.0summary of new features
)REMAP="BO--Body"REMAP="BO--Body"NUMBER="2" ID="X22222"TopicsREMAP="BO--Body"This chapter contains information on:MARK="BULL" REMAP="BU--Bullet"Open Server programming topics, such as processing parameter
 and row data, and text and image support.How to use Open Server routines to accomplish specific programming tasks, such as responding to cursor requests and handling errors.Open Server properties, datatypes, and structures.RENDERAS="SECT1"List of TopicsREMAP="BO--Body"The following topics are included in this chapter:REMAP="UN--Under"AttentionsREMAP="UN--Under"Browse ModeREMAP="UN--Under"CapabilitiesREMAP="UN--Under"Client Command ErrorsREMAP="UN--Under"CS_BROWSEDESC StructureREMAP="UN--Under"CS_DATAFMT StructureREMAP="UN--Under"CS_IODESC StructureREMAP="UN--Under"CS-LibraryREMAP="UN--Under"CS_SERVERMSG StructureREMAP="UN--Under"CursorsREMAP="UN--Under"Datastream MessagesREMAP="UN--Under"Dynamic SQLREMAP="UN--Under"ErrorsREMAP="UN--Under"EventsREMAP="UN--Under"Gateway ApplicationsREMAP="UN--Under"International Support REMAP="UN--Under"Language CallsREMAP="UN--Under"MessagesREMAP="UN--Under"Migration from 2.0 to 10.0REMAP="UN--Under"Multithread ProgrammingREMAP="UN--Under"Negotiated BehaviorREMAP="UN--Under"OptionsREMAP="UN--Under"Pass-Through ModeREMAP="UN--Under"Preparing for Future Open Server ReleasesREMAP="UN--Under"Processing Parameter and Row DataREMAP="UN--Under"Registered ProceduresREMAP="UN--Under"Remote Procedure CallsREMAP="UN--Under"Tailoring Your Open ServerREMAP="UN--Under"Text and ImageREMAP="UN--Under"Thread PropertiesREMAP="UN--Under"TypesREMAP="BO--Body"ID="X52860" RENDERAS="SECT1"AttentionsREMAP="BO--Body"When a client application issues a cancel, via a MOREINFO="NONE"dbcancel or MOREINFO="NONE"ct_cancel command, it triggers an Open Server SRV_ATTENTION event. Open Server then calls the Open Server application's SRV_ATTENTION event handler. Once the SRV_ATTENTION event handler returns, Open Server resumes processing where it left off when the attention was detected.ID="IN42109741"AttentionsAttentionsand interrupt level:See Interrupt levelinterrrupt level
ID="IN42159742"Interrupt levelInterrupt leveland attentionsattentionsRENDERAS="SECT2"Interrupt-Level ActivityID="IN42109563"AttentionsAttentionsand the SRV_ATTENTION event handlerSRV_ATTENTION event handlerREMAP="BO--Body"A SRV_ATTENTION event handler is the only event handler that runs at interrupt level. An Open Server application can only issue the following four Server-Library calls from inside a SRV_ATTENTION handler: MARK="BULL" REMAP="BU--Bullet"ID="IN42159564"Interrupt levelServer-Library calls permitted at
MOREINFO="NONE"srv_wakeup with the wakeflags argument set to SRV_M_WAKE_INTR.MOREINFO="NONE"srv_ucwakeup with the wakeflags argument set to SRV_M_WAKE_INTRMOREINFO="NONE".MOREINFO="NONE"srv_thread_props with the cmd argument set to CS_GET.MOREINFO="NONE"srv_props with the cmd argument set to CS_GET.MOREINFO="NONE"srv_event_deferred.REMAP="BO--Body"No other Server-Library routines can be called from the SRV_ATTENTION event handler, or from other interrupt level code.ID="IN42109475"Attentionscoding recommendations forRENDERAS="SECT2"Coding Recommendations for AttentionsREMAP="BO--Body"Attentions are problematic if they arrive while non-interrupt-level handler code is executing. An application may do work it need no longer do because the client has cancelled a request.ID="IN42109386"Attentionschecking for with srv_thread_propsREMAP="BO--Body"It is the application programmer's responsibility to check for attentions periodically if it is performing a time-consuming I/O task or compute-intensive work at non-interrupt level. The application code should periodically check for attentions using MOREINFO="NONE"srv_thread_props with cmd set to CS_GET and property set to SRV_T_GOTATTENTION, in the application code.REMAP="BO--Body"Once it detects an attention, the Open Server application code can continue to send results, but clients will ignore them. The simplest thing to do is send a SRV_DONE_FINAL and return.REMAP="BO--Body"An attention can arrive while the Client -Library portion of the gateway application code is executing. The application can call MOREINFO="NONE"ct_command with the type argument set to CS_CANCEL_ATTENTION in its SRV_ATTENTION event handler to force the Client-Library routine to return to non-interrupt-level code. Because this command has no effect if an attention has not arrived, a gateway application should call it routinely.REMAP="BO--Body"ID="IN42109297"Attentionscoding recommendations for
It is strongly recommended that all gateway calls doing client I/O check for attentions with MOREINFO="NONE"srv_thread_props before calling MOREINFO="NONE"ct_send. This ensures that a query
 is not sent to a remote server if the client has already cancelled it.ID="IN42119298"Disconnectshandling ofRENDERAS="SECT2"Handling DisconnectsREMAP="BO--Body"If an Open Server application is in the middle of returning results to a client and the client abruptly disconnects, the application will continue to return results until it detects that the connection has been closed. Open Server will subsequently call the SRV_DISCONNECT event handler. In this scenario, the application is sending results to a client that is no longer there.ID="IN422790119"SRV_ATTENTION event handlercalling to handle client disconnectREMAP="BO--Body"To avoid this, an application can request that Open Server first call the application's SRV_ATTENTION event handler in response to a client disconnect. Inside the SRV_ATTENTION handler, the application can take appropriate steps to terminate the I/O activity and return from the routine that was executing in the original event handler. An application can thus respond to disconnects in the same way that it would to attentions.REMAP="BO--Body"Inside its SRV_ATTENTION event handler, an application can determine which event triggered the handler-an attention or a disconnect-by calling MOREINFO="NONE"srv_props with cmd set to CS_GET and property set to SRV_S_ATTNREASON.REMAP="BO--Body"To have Open Server handle disconnects in this fashion an application must set the SRV_S_DISCONNECT property
 to CS_TRUE via a call to MOREINFO="NONE"srv_props. This property defaults to CS_FALSE.RENDERAS="SECT2"ExampleREMAP="BO--Body"The on-line sample ctosdemo.c includes attention handling code.ID="X90209" RENDERAS="SECT1"Browse ModeBrowse mode is included in 10.0 Open Server in order to provide compatibility with older Open Client libraries. Its use in new Open Server Server-Library applications is discouraged, because cursors provide the same functionality in a more portable and flexible manner. Further, browse mode is SYBASE-specific and is not suited for use in a heterogeneous environment.REMAP="BO--Body"Browse mode provides a means for browsing through database rows and updating their values a row at a time. From the standpoint of a client application program, the process involves several steps, because each row must be transferred from the database into client application program variables before it can be browsed and updated.REMAP="BO--Body"Since a row being browsed is not the actual row residing in the database, but is instead a copy residing in program variables, the program must be able to ensure that changes to the variables' values can be reliably used to update the original database row. In particular, in multi-user situations, the program needs to ensure that updates made to the database by one user do not unwittingly overwrite updates recently made by another user. This can be a problem because a client application typically selects a number of rows from a database at one time, but the application's users browse and update the database one row at a time. A timestamp column in browsable tables provides the information necessary to regulate this type of multi-user updating.REMAP="BO--Body"Client applications that permit users to enter ad-hoc browse mode queries must update underlying database tables if a user command alters a table's contents. Consequently, these applications may need information about the underlying structure of a browse mode command.ID="IN4211901110"Browse modereturning browse mode results to a clientREMAP="BO--Body"Open Server 10.0 introduces two routines that provide such information, MOREINFO="NONE"srv_tabname and MOREINFO="NONE"srv_tabcolname. ID="IN4211881311"srv_tabnamecalling to return browse mode results
MOREINFO="NONE"srv_tabname provides the name and number of each table involved in the browse mode command. ID="IN4214861512"srv_tabcolnamecalling to return browse mode results
MOREINFO="NONE"srv_tabcolnameID="IN4211841713"Browse modeand the CS_BROWSEDESC structure
 returns a variety of information about result columns via a CS_BROWSEDESC structure. For more information on the CS_BROWSEDESC structure, LINKEND="X58653"see CS_BROWSEDESC Structure, its topics page.REMAP="BO--Body"An Open Server application that receives browse mode requests can call these two routines, along with the standard data binding routines, to return browse mode information. The specific steps are as follows:ID="IN4211841714"Browse modesteps to supportNUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"Call MOREINFO="NONE"srv_tabname once for each table that is the source of a result row.Call MOREINFO="NONE"srv_descfmt followed by MOREINFO="NONE"srv_tabcolname once for each column in the result row. If the application sets the status field to CS_RENAMED, then the client application's browse mode MOREINFO="NONE"select statement renamed the column, and the Open Server application must fill in the origname and origlen fields in the CS_BROWSEDESC structure prior to callingMOREINFO="NONE" srv_tabcolname.Bind and transfer the column data using the MOREINFO="NONE"srv_bind and MOREINFO="NONE"srv_xferdata routines respectively.Because MOREINFO="NONE"srv_tabcolname requires information returned by MOREINFO="NONE"srv_tabname-the unique table numberMOREINFO="NONE"-srv_tabcolname must follow a call to MOREINFO="NONE"srv_tabname.REMAP="BO--Body"For more information on browse mode, see the SYBASE Open Client Client-Library/C Reference Manual.RENDERAS="SECT2"ExampleREMAP="BO--Body"The on-line sample program ctosdemo.c includes code to process browse mode information.ID="IN4221812015"Connection attributesSee CapabilitiesID="X89653" RENDERAS="SECT1"CapabilitiesID="IN4212812016"Capabilitiesuses ofREMAP="BO--Body"An Open Server application and a client must agree on what requests the client can issue and what responses the Open Server application will return. For example, a client may want to issue language requests, but the Open Server application may not be equipped with a parser to process such requests. Similarly, a client may not want the Open Server application to return text or image data if the client is not equipped to handle it. A client/server connection's capabilities
 determine the types of client requests and server responses permitted for that connection.REMAP="BO--Body"The Open Server application ultimately determines which capabilities are valid for the connection. If the client does not accept these capabilities, its only option is to close the connection.REMAP="BO--Body"There are two types of capability negotiation: transparent and explicit. In transparent negotiations, Open Server assigns a default
 set of possible client requests and Open Server responses. In explicit negotiations, the Open Server application includes code to negotiate capabilities, using the MOREINFO="NONE"srv_capability_info routine. REMAP="BO--Body"Transparent negotiation is part of both Open Server and Open Client's default behavior. Therefore, an Open Server application must call MOREINFO="NONE"srv_capability_info if it wants to support something other than the default set of capabilities.ID="IN4212782317"CapabilitiesRequest Capabilities table
ID="IN4226752618"Request Capabilities tableRENDERAS="SECT2"Request CapabilitiesREMAP="BO--Body"The following table describes each request capability:TOCENTRY="1"LBL="Table 2-1: " ID="X74465"Request CapabilitiesCOLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="184*"COLNAME="C2" COLWIDTH="191*"COLNAME="C3" COLWIDTH="91*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REQUEST Capability:COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Meaning:COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Capabilityrelates to:VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CON_INBANDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"In-band (non-expedited) attentionsCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ConnectionsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CON_OOBCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Out-of-band (expedited) attentionsCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ConnectionsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CSR_ABSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Fetch of specified absolute cursor rowCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CursorsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CSR_FIRSTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Fetch of first cursor rowCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CursorsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CSR_LASTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Fetch of last cursor rowCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CursorsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CSR_MULTICOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Multi-row cursor fetchCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CursorsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CSR_PREVCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Fetch previous cursor rowCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CursorsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CSR_RELCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Fetch specified relative cursor rowCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CursorsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_BINCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Binary datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_VBINCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Variable-length binary typeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_LBINCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Long variable-length binary datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_BITCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Bit datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_BITNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Nullable bit datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_BOUNDARYCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Boundary datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_CHARCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Character datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_VCHARCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Variable-length character datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_LCHARCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Long variable-length character datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_DATE4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Short datetime datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_DATE8COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Datetime datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_DATETIMENCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Null datetime valuesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_DECCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Decimal datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_FLT4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4-byte float datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_FLT8COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"8-byte float datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_FLTNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Nullable float datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_IMAGECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Image datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_INT1COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Tiny integer datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_INT2COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Small integer datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_INT4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Integer datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_INTNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Null integersCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_MNY4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Short money datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_MNY8COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Money datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_MONEYNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Null money valuesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NUMCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Numeric datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_SENSITIVITYCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Sensitivity datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_TEXTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Text datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPTION_GETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Current option valuesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_PROTO_DYNAMICCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Use TDS DESCIN/OUT protocolCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CommandsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_PROTO_DYNPROCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Prepend "create proc" to dynamic 
preparesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CommandsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REQ_BCPCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Bulk copy requestsCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CommandsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REQ_CURSORCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Cursor requestsCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CommandsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REQ_DYNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Dynamic SQL requestsCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CommandsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REQ_LANGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Language requestsCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CommandsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REQ_MSGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Message dataCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CommandsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REQ_MSTMTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Multiple server commands per Client-
Library requestCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ConnectionCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REQ_NOTIFCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Event notificationsCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ConnectionCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REQ_RPCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Remote procedure requestsCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CommandsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REQ_URGNOTIFCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Use 5.0 event notification protocolCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CommandsID="IN4227722919"Response Capabilities table
ID="IN4212693220"CapabilitiesResponse Capabilities tableRENDERAS="SECT2"Response Capability REMAP="BO--Body"The table below describes each response capability.Response capabilities indicate the kinds of responses the client does not want to receive:TOCENTRY="1"LBL="Table 2-2: "Response CapabilitiesCOLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="184*"COLNAME="C2" COLWIDTH="193*"COLNAME="C3" COLWIDTH="91*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_RESPONSE Capability:COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Meaning:COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Capabilityrelates to:VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOBINCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No binary datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOVBINCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No variable-length binary typeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOLBINCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No long variable-length binary datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOBITCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No bit datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOBOUNDARYCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No boundary datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOCHARCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No character datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOVCHARCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No variable-length character datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOLCHARCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No long variable-length character 
datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NODATE4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No short datetime datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NODATE8COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No datetime datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NODATETIMENCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No null datetime valuesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NODECCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No decimal datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOFLT4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No 4-byte float datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOFLT8COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No 8-byte float datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOIMAGECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No image datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOINT1COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No tiny integer datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOINT2COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No small integer datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOINT4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No integer datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOINTNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No null integersCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOMNY4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No short money datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOMNY8COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No money datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOMONEYNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No null money valuesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NONUMCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No numeric datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOSENSITIVITYCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No sensitivity datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOTEXTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No text datatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_RES_NOEEDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No extended error resultsCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ResultsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_RES_NOMSGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No message resultsCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ResultsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_RES_NOTDSDEBUGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No TDS debug tokenCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ResultsREMAP="BO--Body"When an Open Server application defines the client data format using the MOREINFO="NONE"srv_descfmt routine, Open Server will verify that the response capability for the relevant datatype is not set. If it is set, either the client has requested the server not to send results pertaining to that datatype, or the TDS version of the client connection does not support that datatype. In such cases, Open Server raises an error and MOREINFO="NONE"srv_descfmt returns CS_FAIL. ID="IN4212693221"Capabilitiestransparent negotiation ofRENDERAS="SECT2"Transparent NegotiationREMAP="BO--Body"Open Server has a set of default capability values. For a list of defaults, see LINKEND="X65703""Server-Wide Defaults"
. These defaults are server-wide; they apply to all client connections. When the defaults are used, all capabilities Open Server supports are turned on.ID="IN4212683322"Capabilitieschanging default values of via srv_propsREMAP="BO--Body"An Open Server application can change the server-wide default values during initialization, by calling the MOREINFO="NONE"srv_props routine. See  the LINKEND="X84669"srv_props
 reference page, for details.REMAP="BO--Body"When a 10.0 DB-Library or Client-Library client logs in, it sends a list of desired capabilities in its login record. In transparent negotiation, Open Server finds the intersection of its default values and the client values. The resulting values will be the capabilities supported on that connection. RENDERAS="SECT3"When Does Transparent Negotiation Take Place?REMAP="BO--Body"Transparent negotiation takes place when:MARK="BULL" REMAP="BU--Bullet"An Open Server application does not have a SRV_CONNECT handler other than the default handler.An Open Server application does not explicitly include code in its custom SRV_CONNECT event handler to override default capabilities.In pass-through mode, MOREINFO="NONE"srv_getloginfo and MOREINFO="NONE"srv_setloginfo handle capability negotiation transparently.ID="IN4212673423"Capabilitieslist of default values forID="X65703" RENDERAS="SECT2"Server-Wide DefaultsREMAP="BO--Body"The table below describes the default value for each request capability by TDS version. A 1 indicates that the capability is supported in the TDS version. A 0 indicates that the capability is not supported.TOCENTRY="1"LBL="Table 2-3: "Request Capabilities by TDS VersionCOLS="6" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="153*"COLNAME="C2" COLWIDTH="27*"COLNAME="C3" COLWIDTH="32*"COLNAME="C4" COLWIDTH="28*"COLNAME="C5" COLWIDTH="28*"COLNAME="C6" COLWIDTH="38*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REQUEST Capability:COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4.0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4.0.2COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4.2COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4.6COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"10.0VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CON_INBANDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CON_OOBCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CSR_ABSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CSR_FIRSTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CSR_LASTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CSR_MULTICOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CSR_PREVCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CSR_RELCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_BINCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_BITCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_BITNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_BOUNDARYCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_CHARCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_DATE4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_DATE8COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_DATETIMENCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_DECCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_FLT4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_FLT8COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_FLTNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_IMAGECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_INT1COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_INT2COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_INT4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_INTNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_LBINCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_LCHARCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_MNY4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_MNY8COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_MONEYNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NUMCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_SENSITIVITYCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_TEXTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_VBINCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_VCHARCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPTION_GETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_PROTO_DYNAMICCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_PROTO_DYNPROCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REQ_BCPCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REQ_CURSORCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REQ_DYNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REQ_LANGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REQ_MSGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REQ_MSTMTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REQ_NOTIFCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REQ_PARAMCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REQ_RPCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REQ_URGNOTIFCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1REMAP="BO--Body"The table below describes the default value for each response capability by TDS version. A 1 indicates that the capability is not supported in the TDS version. A 0 indicates that the capability is supported. TOCENTRY="1"LBL="Table 2-4: "Response Capabilities by TDS VersionCOLS="6" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="144*"COLNAME="C2" COLWIDTH="27*"COLNAME="C3" COLWIDTH="36*"COLNAME="C4" COLWIDTH="27*"COLNAME="C5" COLWIDTH="27*"COLNAME="C6" COLWIDTH="36*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_RESPONSE Capability:COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4.0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4.0.2COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4.2COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4.6COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"10.0VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOBINCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOBITCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOBOUNDARYCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOCHARCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NODATE4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NODATE8COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NODATETIMENCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NODECCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOFLT4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOFLT8COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOIMAGECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CON_NOINBANDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOINT1COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOINT2COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOINT4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOINTNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOLBINCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOLCHARCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOMNY4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOMNY8COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOMONEYNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NONUMCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CON_NOOOBCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOSENSITIVITYCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOTEXTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOVBINCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATA_NOVCHARCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_RES_NOEEDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_RES_NOMSGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_RES_NOTDSDEBUGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1ID="IN4212663524"Capabilitiesexplicit negotiation ofRENDERAS="SECT2"Explicit NegotiationREMAP="BO--Body"Explicit negotiation takes place at connect time, inside the SRV_CONNECT event handler. The Open Server application retrieves the list of requests the client wishes to send. It then returns the list of requests it will accept. The process is repeated, this time with the list of responses a client does not want to receive, or those the Open Server application cannot return. REMAP="BO--Body"An application can retrieve and send capabilities one at a time or can retrieve and send an entire bit mask of capabilities at once. Open Server provides macros to test, clear, and set bits in a capability mask. For information on these macros, see LINKEND="X19490""Capability Macros" 
.RENDERAS="SECT3"Negotiating Capabilities One at a TimeREMAP="BO--Body"To negotiate request capabilities one at a time, an application must do the following for each capability it wishes to negotiate:NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"Call MOREINFO="NONE"srv_capability_info with the cmd argument set to CS_GET, the type argument set to CS_CAP_REQUEST, and the capability argument set to the capability of interest. If the *valp argument contains CS_TRUE, the client wants to make this type of request. If *valp contains CS_FALSE, the client does not.Call MOREINFO="NONE"srv_capability_info with the cmd argument set to CS_SET, the type argument set to CS_CAP_REQUEST, and the capability argument set to the capability of interest, and *valp set to a Boolean value. The application sets *valp to CS_TRUE if it wants to support this type of request and CS_FALSE if it does not.REMAP="BO--Body"An application negotiates response capabilities in a similar fashion, except that it must set the type argument to CS_RESPONSE_CAP.REMAP="BO--Body"An Open Server application only needs to call MOREINFO="NONE"srv_capability_info for the request and response capabilities it needs to negotiate explicitly. The default values are used for all the other capabilities.RENDERAS="SECT3"Negotiating Using a Capability Bit Mask REMAP="BO--Body"To negotiate request capabilities using a capability bit mask, an application must:NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"Read in the entire bit mask by calling MOREINFO="NONE"srv_capability_info with the cmd argument set to CS_GET, the type argument set to CS_CAP_REQUEST, the capability argument set to CS_ALL_CAPS, and valp pointing to the ID="IN4212643725"CapabilitiesCapabilitiesand the CS_CAP_TYPE structureCS_CAP_TYPE structure
CS_CAP_TYPE structure that will contain the bit mask.Test, set or clear particular bits in the bitID="IN4212633826"CapabilitiesCapabilitiesand the capability macroscapability macros
 mask using the CS_TST_CAPMASK, CS_SET_CAPMASK and CS_CLR_CAPMASK macros. REMAP="BO--Body"An application negotiates response capabilities in a similar fashion, except that it must set the type argument to CS_CAP_RESPONSE.REMAP="BO--Body"Gateway applications should use the mask method to negotiate capabilities. As the following diagram illustrates, the gateway would call MOREINFO="NONE"srv_capability_info to retrieve the remote client's capability mask, and sends those capabilities to the remote server by calling MOREINFO="NONE"ct_capability prior to calling MOREINFO="NONE"ct_connect. Once the remote connection has been established, the gateway can retrieve the capability masks the remote server has sent using MOREINFO="NONE"ct_capability, and then define them on the remote client connection, using MOREINFO="NONE"srv_capability_info            ID="IN4212623927"Capabilitiesexplicit negotiation ofFLOAT="0"FORMAT="UNKNOWN" FILEREF="fig2_1.xwd"LBL="Figure 2-1: "Capability Negotiation in a GatewayID="X19490" RENDERAS="SECT3"Capability MacrosREMAP="BO--Body"The following table describes the macros that an application can use to manipulate a capability bit mask:TOCENTRY="1"LBL="Table 2-5: "Capability MacrosCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="120*"COLNAME="C2" COLWIDTH="194*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Macro NameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FunctionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TST_CAPMASKCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Test to see whether a specific capability is 
set to CS_TRUE or CS_FALSE.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SET_CAPMASKCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Set a specific capability to CS_TRUE.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CLR_CAPMASKCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Set a specific capability to CS_FALSE.REMAP="BO--Body"When CS_CAP_REQUEST capabilities are handled explicitly, applications can only turn capabilities "off" from an "on" status. This is due to the fact that if a particular capability is off by default, it is not supported by that version of Open Server. Likewise, when CS_CAP_RESPONSE capabilities are handled explicitly, applications can only turn capabilities "on" from an "off" status. This is due to the fact that if a particular capability is on by default, it must be supported by that version of Open Server. If an application violates either of these rules, Open Server will automatically restore the default status without raising an error.ID="IN4212623928"Capabilitiesad hoc retrieval ofRENDERAS="SECT2"Ad Hoc Retrieval of Capability InformationREMAP="BO--Body"An Open Server application can call MOREINFO="NONE"srv_capability_info inside any handler at any time to retrieve a list of capabilities in effect for that particular client connection. In a SRV_CONNECT event handler, however, the capability masks retrieved are not the final masks for the connection. Rather, they are the client's requested capabilities combined with the Open Server application's defaults. This is because connection capabilities are not final until the SRV_CONNECT handler has returned.ID="IN4212623929"Capabilitiesnegotiating with pre-10.0 clientsRENDERAS="SECT2"A Note on Pre-10.0 ClientsREMAP="BO--Body"An Open Server application can negotiate capabilities with clients running any TDS version. If a pre-10.0 client is connecting, Open Server simulates capability negotiation. In this scenario, the Open Server application does not need to concern itself with what TDS version the client is running.RENDERAS="SECT2"ExampleREMAP="BO--Body"The on-line sample program ctosdemo.c includes code illustrating capability negotiation.REMAP="BO--Body"ID="IN426594230"ErrorsSee also Client command errors
ID="IN4214564531"Error messagessending to a client, See Client command errorsID="X83099" RENDERAS="SECT1"Client Command ErrorsREMAP="BO--Body"A client sometimes sends an incomplete or nonsensical request to an Open Server application. Requests can be incomplete or meaningless because of faulty client code or because of a network problem. An Open Server application should handle these errors in the event handler for the client request, by sending the appropriate error messages to the client.RENDERAS="SECT2"ID="IN4221534832"Client command errors sending via srv_sendinfo 
Sending Messages with MOREINFO="NONE"srv_sendinfoREMAP="BO--Body"An Open Server application calls MOREINFO="NONE"srv_sendinfo to send error messages to a client. An Open Server application describes the message in a ID="IN4221515033"Client command errorsClient command errors and the CS_SERVERMSG structureCS-SERVERMSG structure
CS_SERVERMSG structure and then calls MOREINFO="NONE"srv_sendinfo to send this description to the client. REMAP="BO--Body"For more information on the CS_SERVERMSG structure, see topics. RENDERAS="SECT2"Sequencing Long Messages REMAP="BO--Body"An Open Server application stores the message text itself in the text field of the CS_SERVERMSG structure. text has a maximum length of CS_MAX_MSG bytes.REMAP="BO--Body"An Open Server application uses as many CS_SERVERMSG structures as necessary to return the full text of a message. The application returns the first CS_MAX_MSG bytes in one structure, the second CS_MAX_MSG bytes in a second structure, and so forth. This is known as "chunking" the message. REMAP="BO--Body"An application calls MOREINFO="NONE"srv_sendinfo as many times as there are "chunks". If the entire message fits in one structure, the application only needs to call MOREINFO="NONE"srv_sendinfo once.RENDERAS="SECT3"CS_SERVERMSG Structure Fields for Sequenced MessagesREMAP="BO--Body"The status field in the CS_SERVERMSG structure indicates whether the structure contains a whole message or a chunk of a message. REMAP="UN--Under"The following table lists status values that are related to sequenced messages:TOCENTRY="1"LBL="Table 2-6: "status Values for Sequenced MessagesCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="127*"COLNAME="C2" COLWIDTH="232*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Symbolic Value:COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"To Indicate:VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FIRST_CHUNKCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The message text is the first chunk of the message.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_LAST_CHUNKCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The message text is the last chunk of the message.MARK="DASH" REMAP="BS--BulletSub"An application sets both CS_FIRST_CHUNK and CS_LAST_CHUNK on, if the message text in the structure is the entire message.An application sets neither CS_FIRST_CHUNK nor CS_LAST_CHUNK on if message text in the structure is a middle chunk.The textlen field in the CS_SERVERMSG structure always reflects the length of the current message chunk. All other fields in the CS_SERVERMSG are repeated with each message chunk.ID="IN4221485334"Client command errors sending via srv_sendinfo 
ID="IN4219475435"Extended error data
ID="IN4219475436"Extended error datadefinition ofID="X78290" RENDERAS="SECT2"Extended Error DataREMAP="BO--Body"Some server messages have "extended error data" associated with them. Extended error data is simply additional information about the error. REMAP="BO--Body"For SQL Server messages, the additional information is most typically which column or columns provoked the error. RENDERAS="SECT3"What's Extended Error Data Good For?REMAP="BO--Body"Client applications that allow end-users to enter or edit data often need to report errors to their users at the column level. The standard server message mechanism, however, makes column-level information available only within the text of the server message. Extended error data provides a means for applications to conveniently access column-level information.REMAP="BO--Body"For example, imagine a client application that allows end-users to enter and edit data in the titleauthor table in the pubs2 database. titleauthor uses a key
 composed of two columns, au_id and title_id. Any attempt to enter a row with an au_id and title_id that match an existing row will cause a "duplicate key" message to be sent to the client application. REMAP="BO--Body"On receiving this message, the client application needs to identify the problem column or columns to the end-user, so that the user can correct them. This information is not available in the duplicate key message, except in the message text. The information is available, however, as extended error data.RENDERAS="SECT3"ID="IN4219475437"Extended error datasending to a client
Sending Extended Error Data to A ClientREMAP="BO--Body"An Open Server application sets the CS_HASEED bit of the status field of the CS_SERVERMSG structure if extended error data is available for the message.REMAP="BO--Body"An Open Server application sends extended error data as parameters to the MOREINFO="NONE"srv_sendinfo routine. The application describes, binds, and sends the error parameters using the MOREINFO="NONE"srv_descfmt, MOREINFO="NONE"srv_bind, and MOREINFO="NONE"srv_xferdata routines, respectively.REMAP="BO--Body"The application must describe, bind, and send the error parameters immediately after calling MOREINFO="NONE"srv_sendinfo, before sending other results and before calling to MOREINFO="NONE"srv_senddone. The application must invoke MOREINFO="NONE"srv_descfmt, MOREINFO="NONE"srv_bind and MOREINFO="NONE"srv_xferdata with a type argument of SRV_ERRORDATA.REMAP="BO--Body"If an application calls MOREINFO="NONE"srv_sendinfo with the status field of the CS_SERVERMSG structure set to CS_HASEED but fails to send error parameters, Open Server will raise a fatal process error when the application calls MOREINFO="NONE"srv_senddone.ID="IN4219465538"Extended error data
ID="IN4223435839"CS_BROWSEDESC structureID="X58653" RENDERAS="SECT1"CS_BROWSEDESC StructureREMAP="BO--Body"MOREINFO="NONE"srv_tabname and MOREINFO="NONE"srv_tabcolname use a CS_BROWSEDESC structure to return information about the underlying structure of a browse mode query.REMAP="BO--Body"A CS_BROWSEDESC structure is defined as follows:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"/*** CS_BROWSEDESC** The Open Server browse column description** structure.*/typedef struct _cs_browsedesc{    CS_INT       status;    CS_BOOL      isbrowse;    CS_CHAR      origname[CS_MAX_NAME];    CS_INT       orignlen;    CS_INT       tablenum;    CS_CHAR      tablename[CS_OBJ_NAME];    CS_INT       tabnlen;} CS_BROWSEDESC;REMAP="BO--Body"where:REMAP="RI--RefIndent"status is a bit mask of the following symbols, OR'd together:REMAP="UN--Under"CS_EXPRESSION to indicate the column is the result of an expression, for example, "sum*2" in the query "select sum*2 from areas".REMAP="UN--Under"CS_RENAMED to indicate that the column's heading is not the original name of the column. Columns will have a different heading from the column name in the database if they are the result of a query of the form "select Author = au_lname from authors".isbrowse indicates whether or not the column can be browse-mode updated.REMAP="UN--Under"A column can be updated if it is neither a timestamp column nor the result of an expression, and it belongs to a browsable table. A table is browsable if it has a unique index and a timestamp column.REMAP="UN--Under"isbrowse is set to CS_TRUE if the column can be updated and CS_FALSE if it cannot.origname is the original name of the column in the database.REMAP="UN--Under"Any updates to a column must refer to it by its original name, not the heading that may have been given the column in a MOREINFO="NONE"select statement.orignlen is the length, in bytes, of origname.tablenum is the number of the table to which the column belongs. The first table in a MOREINFO="NONE"select statement's from-list is table number 1, the second is table number 2, and so forth.tablename is the name of the table to which the column belongs.tabnlen is the length, in bytes, of tablenameID="IN4223406140"CS_BROWSEDESC structure
.ID="IN4220376441"CS_DATAFMT structureID="X78182" RENDERAS="SECT1"CS_DATAFMT StructureREMAP="BO--Body"A CS_DATAFMT structure is used to describe data values and program variables. For example:MARK="BULL" REMAP="BU--Bullet" MOREINFO="NONE"srv_bind uses a CS_DATAFMT structure describing a source or destination program variable.MOREINFO="NONE"srv_descfmt uses a CS_DATAFMT structure to describe the client data.MOREINFO="NONE"cs_convert requires CS_DATAFMT structures describing source and destination data.REMAP="BO--Body"Most routines use only a subset of the fields in a CS_DATAFMT. For example, MOREINFO="NONE"srv_bind does not use the name, and usertype fields, and MOREINFO="NONE"srv_descfmt does not use the format field. For information on which fields in the CS_DATAFMT a routine uses, see that routine's reference page.REMAP="BO--Body"A CS_DATAFMT structure is defined as follows:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"typedef struct _cs_datafmtREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_CHAR       nameMOREINFO="NONE"[CS_MAX_NAME];   /* Name of data.        */      CS_INT        namelen;MOREINFO="NONE"             /* Length of name.     */      CS_INT        datatype;MOREINFO="NONE"            /* Datatype of data.   */      CS_INT        format;MOREINFO="NONE"              /* Format symbols.     */      CS_INT        maxlength;MOREINFO="NONE"           /* Max length of data. */      CS_INT        scale;       MOREINFO="NONE"        /* Scale of data.      */      CS_INT        precision;       MOREINFO="NONE"    /* Precision of data.  */      CS_INT        status;MOREINFO="NONE"              /* Status symbols.     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*      ** The following field is not used in Open Server.      ** It must be set to 1 or 0.      */      CS_INT     count;MOREINFO="NONE"                 REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*      ** These fields are used to support user-defined      ** datatypes and international datatypes:      */      CS_INT    usertype;MOREINFO="NONE"            /* User-defined type.*/      CS_LOCALE *locale;             MOREINFO="NONE"/* Locale information. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"} CS_DATAFMT;REMAP="BO--Body"Where:REMAP="RI--RefIndent"name is the name of the data, that is, the column or parameter name.namelen is the length, in bytes, of name. Set namelen to CS_NULLTERM to indicate a null terminated name. Set namelen to 0 if name is NULL.datatype is the datatype of the data. This is one of the Open Server datatypes listed on the MOREINFO="NONE"Types topics page. REMAP="UN--Under"Do not confuse the datatype field with the usertype field. datatype is always used to describe the Open Server datatype of the data. usertype is only used if the data has an application-defined datatype in addition to an Open Server datatype.REMAP="UN--Under"For example, the following SQL Server command creates the SQL Server user-defined type birthday:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"sp_addtype birthday, datetimeREMAP="UN--Under"and this command creates a table containing a column of the new type:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"create table birthdaysREMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"(         name         varchar(30),         happyday     birthday)REMAP="UN--Under"An Open Server application that supported user-defined datatypes would return this information to the client by setting the CS_DATAFMT datatype field to CS_DATETIME_TYPE and the usertype field to the user-defined ID for the type birthday.format describes the destination format of character or binary data. format is a bit mask of the following symbols, OR'd together. The following table summarizes the legal values for formatTOCENTRY="1"LBL="Table 2-7: "Values for format (CS_DATAFMT) COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="114*"COLNAME="C2" COLWIDTH="166*"COLNAME="C3" COLWIDTH="79*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Symbol:COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"To Indicate:COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Notes:VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FMT_NULLTERMCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The data should be null 
terminated.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"For character 
or text dataCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FMT_PADBLANKCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The data should be padded with 
blanks to the full length of the 
destination variable.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"For character 
or text dataCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FMT_PADNULLCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The data should be padded with 
NULLs to the full length of the 
destination variable.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"For binary, 
image, 
character, or 
text dataCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FMT_UNUSEDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Neither padding nor null 
termination is applicable to the 
datatype.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"For all 
datatypes:maxlength can represent various lengths, depending on which Open Server routine is using the CS_DATAFMT. The following table describes the various lengths maxlength can represent:TOCENTRY="1"LBL="Table 2-8: "Meaning of maxlength (CS_DATAFMT)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="101*"COLNAME="C2" COLWIDTH="259*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server 
routine:COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"maxlength is:VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"srv_bindCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The length of the bind variableCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"srv_descfmtCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The maximum possible length of the column or 
parameter being describedCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"cs_convertCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The length of the source data and the length of the 
destination buffer spacescale is the scale of the data. scale is used only with decimal or numeric datatypes.REMAP="UN--Under"Legal values for scale are from CS_MIN_SCALE to CS_MAX_SCALE. The default scale is CS_DEF_SCALE. REMAP="UN--Under"To indicate that destination data should use the same scale as the source data, set scale to CS_SRC_VALUE.REMAP="UN--Under"scale must be less than or equal to precision.precision is the precision of the data. precision is used only with decimal or numeric datatypes. REMAP="UN--Under"Legal values for precision are from CS_MIN_PREC to CS_MAX_PREC. The default precision is CS_DEF_PREC. REMAP="UN--Under"To indicate that destination data should use the same precision as the source data, set precision to CS_SRC_VALUE.REMAP="UN--Under"precision must be greater than or equal to scale.status is a bit mask used to indicate various types of information. The following table summarizes the types of information that status can contain:TOCENTRY="1"LBL="Table 2-9: "Values for status (CS_DATAFMT)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="136*"COLNAME="C2" COLWIDTH="169*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Symbolic Value:COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"To Indicate:VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CANBENULLCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The column can contain NULL.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DESCINCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The CS_DATAFMT structure 
describes a Dynamic SQL input 
parameter.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DESCOUTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The CS_DATAFMT structure 
describes a Dynamic SQL output 
parameter.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_HIDDENCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The column is a "hidden" column 
that has been exposed. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_INPUTVALUECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The parameter is an input 
parameter value for a cursor open 
command or a non-return RPC 
parameter.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_KEYCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The column is a key column.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_RETURNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The parameter is a return 
parameter to an RPC command.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TIMESTAMPCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The column is a timestamp column. 
An application uses timestamp 
columns when performing browse-
mode updates.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_UPDATABLECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The column is an updatable cursor 
column.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_UPDATECOLCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The parameter is the name of a 
column in the update clause of a 
cursor declare command.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_VERSION_KEYCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The column is part of the version 
key for the row.SQL Server uses version keys for 
positioning.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_NODEFAULTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"There is no default specified for the 
parameter.count is not supported in Open Server. It should always be set to 0 or 1.usertype is the user-defined datatype, if any, of data returned. locale is a pointer to a CS_LOCALE structure containing localization information. Set locale to NULL if localization information is not required.ID="IN4220346742"CS_DATAFMT structure
ID="IN4219317043"CS_IODESC structureID="X51586" RENDERAS="SECT1"CS_IODESC StructureREMAP="BO--Body"A CS_IODESC, also called an "I/O descriptor structure," describes text or image data. REMAP="BO--Body"An Open Server application calls MOREINFO="NONE"srv_text_info with a cmd argument of CS_GET when processing text or image data from a client. Only the total_textlen field of the CS_IODESC argument is filled in by this call.REMAP="BO--Body"If the application is sending columns of data to a client, it calls MOREINFO="NONE"srv_text_info with a cmd argument of CS_SET. In this scenario, the CS_IODESC argument describes a text or image column being sent. A CS_IODESC is defined as follows:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"typedef struct _cs_iodescREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{     CS_INT    iotype;MOREINFO="NONE"                  /* CS_IODATA           */     CS_INT    datatype;MOREINFO="NONE"                /* Text or image.      */     CS_LOCALE *locale;MOREINFO="NONE"                 /* Locale information. */     CS_INT    usertype;                MOREINFO="NONE"/* User-defined type.  */     CS_INT    total_txtlen;MOREINFO="NONE"            /* Total data length.  */     CS_INT    offset;MOREINFO="NONE"                  /* Reserved.           */     CS_BOOL   log_on_update;MOREINFO="NONE"           /* Log the insert.     */     CS_CHAR   name[CS_OBJ_NAME];MOREINFO="NONE"       /* Name of data object.*/     CS_INT    namelen;                 MOREINFO="NONE"/* Length of name.     */     CS_BYTE   timestamp[CS_TS_SIZE];MOREINFO="NONE"   /* SQL Server id.      */     CS_INT    timestamplen;MOREINFO="NONE"            /* Length of timestamp.*/     CS_BYTE   textptr[CS_TP_SIZE];MOREINFO="NONE"     /* SQL Server ptr.     */     CS_INT    textptrlen;              MOREINFO="NONE"/* Length of textptr.  */} CS_IODESC;REMAP="BO--Body"where:REMAP="RI--RefIndent"iotype indicates the type of I/O to perform. For text and image operations, iotype always has the value CS_IODATA.datatype is the datatype
 of the data object. The only legal values for datatype are CS_TEXT_TYPE and CS_IMAGE_TYPE.locale is a pointer to a CS_LOCALE structure containing localization information for the text or image value. Set locale to NULL if localization information is not required.REMAP="UN--Under"Before using a CS_IODESC structure, make sure that locale is valid by setting it either to NULL or to the address of a valid CS_LOCALE structure.usertype is not used in Open Server.total_textlen is the total length, in
bytes, of the text or image value.offset is reserved for future use.REMAP="RI--RefIndent"log_on_update describes whether to log the update to this text or image value.name is the name of the text or image column.namelen is the length, in bytes, of name, or CS_NULLTERM to indicate a null terminated name.timestamp is the text timestamp of the column. A text timestamp marks the time of a text or image column's last modification.timestamplen is the length, in bytes, of timestamp.textptr is a text pointer for the column. textptrlen is the length, in bytes, of textptr.ID="IN4219287344"CS_IODESC structure
ID="IN4210277445"CS-LibraryID="X61449" RENDERAS="SECT1"CS-LibraryID="IN4210277446"CS-Librarydefinition ofRENDERAS="SECT2"What Is CS-Library?REMAP="BO--Body"The 10.0 family of interoperability tools includes CS-Library
, a collection of utility routines and structures useful or necessary to both Open Server and Client-Library applications. In past releases, Server-Library and Open Client provided such utility routines and structures separately, resulting in unnecessary duplication. RENDERAS="SECT2"Common RoutinesREMAP="BO--Body"CS-Library includes routines to support:MARK="BULL" REMAP="BU--Bullet"Datatype conversionArithmetic operationsCharacter set
 conversionDatetime operationsSort order
 operationsLocalization routinesREMAP="BO--Body"CS-Library also includes routines to allocate CS-Library structures.REMAP="BO--Body"Although it is possible to write a standalone CS-Library application, the library's primary function is to provide common utilities to Client-Library and Open Server applications.REMAP="BO--Body"Some of these routines offer functionality provided by existing Server-Library routines. While it is not yet necessary to replace the Server-Library routines with their CS-Library counterparts, it may be in the future. For a discussion of future coding requirements, see  the LINKEND="X12698"Preparing for Future Open Server Releases
 topics page.RENDERAS="SECT2"Common Data StructuresREMAP="BO--Body"In addition to common routines, CS-Library provides data structures useful to both Open Client and Open Server applications. Among these is a CS_CONTEXT structure, which contains information about an application programming environment, or "context."REMAP="BO--Body"An Open Server application programmer can tailor an application's behavior by setting global application attributes stored in this structure. The MOREINFO="NONE"Tailoring Your Open Server topics page discusses this in detail.REMAP="BO--Body"Other CS-Library structures contain information about data passed between Open Client and Open Server applications.Because Client-Library and Server-Library programs require a context structure, which can only be allocated using CS-Library, all Client-Library and Server-Library programs must include at least two calls to CS-Library-one to allocate a CS_CONTEXT and one to de-allocate it.ID="IN4210277447"CS-Libraryhandling CS-Library errorsRENDERAS="SECT2"Error HandlingREMAP="BO--Body"An Open Server application should install a message callback routine
 with the MOREINFO="NONE"cs_config routine to report CS-Library errors. A standard Open Server error handler installed with MOREINFO="NONE"srv_props will not catch CS-Library errors, such as data conversion errors generated in a call to MOREINFO="NONE"cs_convert.REMAP="BO--Body"If an Open Server application has not installed a CS-Library handler, Open Server installs a default handler when the application calls MOREINFO="NONE"srv_version. This default handler writes CS-Library errors to the Open Server log.REMAP="BO--Body"For details on handling CS-Library errors and for more general information about CS-Library, see Chapters 1 and 2 of the ID="IN4210267548"CS-Library
Open Client and Open Server Common Libraries Reference Manual.ID="IN4222237849"CS_SERVERMSG structureID="X99328" RENDERAS="SECT1"CS_SERVERMSG StructureREMAP="BO--Body"A CS_SERVERMSG structure contains information about a server error message.REMAP="BO--Body"Open Server uses a CS_SERVERMSG structure to send error messages to a client, via the MOREINFO="NONE"srv_sendinfo routine.REMAP="BO--Body"A CS_SERVERMSG structure is defined as follows:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"/*** CS_SERVERMSG** The server message structure.*/REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"typedef struct _cs_servermsg{    CS_INT   msgnumber;    CS_INT   state;    CS_INT   severity;    CS_CHAR  text[CS_MAX_MSG];    CS_INT   textlen;    CS_CHAR  srvname[CS_MAX_MSG];    CS_INT   srvnlen;REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"    /*    ** If the error involved a stored procedure,    ** the following fields contain information    ** about the procedure:    */    CS_CHAR  proc[CS_MAX_MSG];    CS_INT   proclen;    CS_INT   line;REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"    /*    ** Other information.    */    CS_INT   status;    CS_BYTE  sqlstate[CS_SQLSTATE_SIZE];    CS_INT   sqlstatelen;} CS_SERVERMSG;REMAP="BO--Body"where:REMAP="RI--RefIndent"msgnumber is the Open Server or application message number
 to report to the client.state is the state in which the message was generated. The application defines this. severity is the severity of the message.text is the text of the message.textlen is the length, in bytes, of text.srvname is the name of the server that generated the message. This value can be the name of the Open Server running currently, or a different name.srvnlen is the length, in bytes, of srvname.proc is the name of the stored procedure
 (if any) that caused the message.proclen is the length, in bytes, of proc.line is the line number within the stored procedure (if any) that caused the message.status contains message status information, such as whether or not extended error data is included with the message. The following table describes the legal values for status:TOCENTRY="1"LBL="Table 2-10: "Values for status Field of CS_SERVERMSG StructureCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="154*"COLNAME="C2" COLWIDTH="142*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_HASEEDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"There is extended error data 
associated with the message.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FIRST_CHUNKCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The message text contained 
in text is the first chunk of the 
message.If CS_FIRST_CHUNK and 
CS_LAST_CHUNK are both 
on, then text contains the 
entire message.If neither 
CS_FIRST_CHUNK nor 
CS_LAST_CHUNK is on, 
then text contains a middle 
chunk of the message.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_LAST_CHUNKCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The message text contained 
in text is the last chunk of the 
message.If CS_FIRST_CHUNK and 
CS_LAST_CHUNK are both 
on, then text contains the 
entire message.If neither 
CS_FIRST_CHUNK nor 
CS_LAST_CHUNK is on, 
then text contains a middle 
chunk of the message.sqlstate is a byte string describing the error.REMAP="UN--Under"Not all server messages have SQL state values associated with them. If no SQL state value is associated with a message, sqlstate has the value "ZZZZZ".sqlstatelen is the length, in bytes, of the sqlstate string.ID="IN4222208150"CS_SERVERMSG structureREMAP="BO--Body"For more information on sending a message in chunks, see the LINKEND="X83099"Client Command Errors
 topics page.ID="IN427198251"CursorsID="X47274" RENDERAS="SECT1"CursorsREMAP="BO--Body"Cursors are implemented in SQL Server and supported by Server-Library and Client-Library.REMAP="BO--Body"For information on how cursors are implemented in SQL Server, see the SYBASE SQL Server Reference Manual.REMAP="BO--Body"For information on how cursors are supported by Client-Library, see the Open Client Client-Library/C Reference Manual.ID="IN427198252"Cursorsdefinition ofRENDERAS="SECT2"What Is a Cursor?REMAP="BO--Body"A cursor is a symbolic name that is linked with a SQL statement. Declaring a cursor establishes this link. The SQL statement can be:MARK="BULL" REMAP="BU--Bullet"A SQL MOREINFO="NONE"select statementA Transact-SQL MOREINFO="NONE"execute statementA Dynamic SQL prepared statementREMAP="BO--Body"The SQL statement associated with a cursor is called the body of the cursor. When a client opens a cursor, it executes the body of the cursor, generating a result set. The Open Server application is responsible for detecting cursor requests and passing cursor results back to the client. ID="IN427198253"Cursorsbenefits of usingRENDERAS="SECT2"What Are Cursors Good For?REMAP="BO--Body"Cursors allow a client application to retrieve and change data in a powerful, flexible manner. They allow applications to access and move around in a set of data rows, rather than merely retrieve a complete result set.REMAP="BO--Body"Moreover, a single connection can have multiple cursors open at the same time. All of the cursor result sets are simultaneously available to the application, which can fetch them at will. This is in direct contrast to other types of result sets, which must be handled one row at a time, in a sequential fashion.REMAP="BO--Body"Further, a client application can update underlying database tables while actively fetching rows in a cursor result set. RENDERAS="SECT2"Open Server Applications and CursorsREMAP="BO--Body"This section contains basic information on Open Server cursor support. For specific information on how to structure a SRV_CURSOR event handler, see LINKEND="X99579""How to Respond to Specific Requests"
.RENDERAS="SECT3"How Are Cursor Requests Generated?REMAP="BO--Body"A cursor request occurs when a client application sends a cursor command to an Open Server application. REMAP="BO--Body"A client application calls the Client-Library command MOREINFO="NONE"ct_cursor to initiate a cursor command. For more information on MOREINFO="NONE"ct_cursor, see the Open Client Client-Library/C Reference Manual. REMAP="BO--Body"A cursor request causes Open Server to generate a SRV_CURSOR event. In order to respond to cursor requests, an Open Server application must include a SRV_CURSOR event handler. RENDERAS="SECT3"ID="IN427198254"Cursorstypes of cursor commands
Types of Cursor CommandsREMAP="BO--Body"The following table summarizes the types of cursor commands a client can issue:TOCENTRY="1"ID="X96543" LBL="Table 2-11: "Summary of Cursor CommandsCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="154*"COLNAME="C2" COLWIDTH="142*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Type of CommandCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"What It DoesVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DeclareCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Associates a cursor name 
with the body of the cursor.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Executes the body of the 
cursor, generates a cursor 
result set.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"InformationCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Reports the status of the 
cursor, or sets the cursor row 
fetch count.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FetchCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Fetches rows from the cursor 
result set.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Update or DeleteCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Updates or deletes the 
contents of the current cursor 
row.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CloseCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Makes the cursor result set 
unavailable. Re-opening a 
cursor regenerates the cursor 
result set.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DeallocateCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Renders the cursor non-
existent. A cursor that has 
been deallocated cannot be 
re-opened.REMAP="BO--Body"A typical client application issues cursor commands in the order in which they are listed in LINKEND="X96543"Table 2-11: Summary of Cursor Commands
, but the order can vary. For example, a client might fetch against a cursor, close the cursor, then re-open and fetch it again.RENDERAS="SECT3"How Is Cursor Information Exchanged with a Client?REMAP="BO--Body"A SRV_CURSOR event handler uses the MOREINFO="NONE"srv_cursor_props routine and the SRV_CURDESC structure to exchange cursor information with a client. MOREINFO="NONE"srv_cursor_props sends current information to a client and retrieves cursor information from a client. In order to do this, MOREINFO="NONE"srv_cursor_props accesses a SRV_CURSDESC structure. REMAP="BO--Body"For more information on the MOREINFO="NONE"srv_cursor_props routine, see the LINKEND="X19525"srv_cursor_props
 reference page. REMAP="BO--Body"Because a client and server can exchange information about multiple cursors in a single connection session, they need a means of uniquely identifying each cursor. An Open Server application responds to a cursor declaration by sending back a unique cursor ID. The client and the server refer to the cursor by this ID for the cursor's lifetime. RENDERAS="SECT3"ID="IN4221168555"SRV_CURDESC structure
SRV_CURDESC StructureREMAP="BO--Body"A SRV_CURDESC structure contains information about a cursor, including:MARK="BULL" REMAP="BU--Bullet"the cursor's unique IDthe type of cursor command most recently issued by the clientthe status of the cursor.REMAP="BO--Body"ID="IN427138856"CursorsCursorsand the SRV_CURDESC structureSRV_CURDESC structure
A SRV_CURDESC structure is defined as follows:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"/*** SRV_CURDESC** The Open Server cursor description** structure.*/typedef struct srv_curdesc{    CS_INT       curid;    CS_INT       numupcols;    CS_INT       fetchcnt;    CS_INT       curstatus;    CS_INT       curcmd;    CS_INT       cmdoptions;    CS_INT       fetchtype;    CS_INT       rowoffset;    CS_INT       curnamelen;    CS_CHAR      curname[CS_MAX_CHAR];    CS_INT       tabnamelen;    CS_CHAR      tabname[CS_MAX_CHAR];    CS_VOID      *userdata;} SRV_CURDESC;REMAP="BO--Body"The following table describes each field in a SRV_CURDESC structure:TOCENTRY="1"LBL="Table 2-12: "Fields in a SRV_CURDESC StructureCOLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="69*"COLNAME="C2" COLWIDTH="128*"COLNAME="C3" COLWIDTH="198*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Field NameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Description COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NotesVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"curidCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The current cursor 
identifierCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The Open Server application must set 
curid when responding to a 
CS_CURSOR_DECLARE command from 
the client. Any subsequent commands 
from the client that pertain to the declared 
cursor use curid as an identifier. curid is set 
to 0 if there is no current cursor identifier 
or if the client is requesting the status of 
all available cursors.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"numupcolsCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of columns in 
a cursor update clauseCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"numupcols is set to 0 if there are no update 
columns. This information is available at 
declare time.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"fetchcntCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The current row fetch 
count for this cursor- 
that is, the number of 
rows that will be sent to 
the client in response to a 
CS_CURSOR_FETCH 
commandCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"fetchcnt is described when a 
CS_CURSOR_INFO command is 
received from the client, or sent to the 
client in response to such a command. 
fetchcnt is set to 1 if the client has not 
explicitly set a row fetch count. If the 
Open Server application cannot support 
the requested fetch count, it can set this 
field to a different value before 
responding.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"curstatusCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The status of the current 
cursorCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server sets the cursor status in 
response to the cursor command received 
from the client. See below, "Values for 
curstatus", for a list of legal values.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"curcmdCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The current cursor 
command typeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"See Table 2-14: Values for curcmd 
(SRV_CURDESC) for a list of legal values.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"cmdoptionsCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Any options associated 
with the cursor commandCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Not all commands have associated 
options. The value of cmdoptions 
depends on the cursor command. Table 2-
14: Values for curcmd (SRV_CURDESC) 
describes the possible values for 
cmdoptions, by command.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"fetchtypeCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The type of fetch 
requested by a clientCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"fetchtype is described when a 
CS_CURSOR_FETCH command is 
received from the client. The valid fetch 
types and their meanings are as follows:CS_NEXT - next rowCS_PREV - previous rowCS_FIRST - first rowCS_LAST - last rowCS_ABSOLUTE - row identified in the 
rowoffset fieldCS_RELATIVE - current row plus or 
minus value in the rowoffset field.Requests to a SQL Server will always have 
a fetchtype of CS_NEXT.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"rowoffsetCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The row position for 
CS_ABSOLUTE or 
CS_RELATIVE fetchesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"rowoffset is undefined for all other fetch 
types. rowoffset is described when a 
CS_CURSOR_FETCH command is 
received from the client.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"curnamelenCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The length of the cursor 
name in curnameCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"curnamelen is CS_UNUSED if curname is 
not valid. curnamelen is CS_NULLTERM if 
curname is a null terminated character 
string.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"curnameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The name of the current 
cursorCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"tabnamelenCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The length of the table 
name in tabnameCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"tabnamelen is CS_UNUSED if tabname is 
not valid. tabnamelen is CS_NULLTERM if 
tabname is a null terminated character 
string. tabnamelen is described when a 
CS_CURSOR_UPDATE or 
CS_CURSOR_DELETE command is 
received from the client.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"tabnameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The table name 
associated with a cursor 
update or delete 
commandCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"tabname is the table name associated with 
a cursor update or delete command. 
tabname is described when a 
CS_CURSOR_UPDATE or 
CS_CURSOR_DELETE command is 
received from the client.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"userdataCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to private data 
spaceCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"This allows applications to associate data 
with a particular cursor without using 
global or static variables. Open Server 
does not manipulate userdata; it is 
provided only for the convenience of 
Open Server application programmers.RENDERAS="SECT3"Values for curstatusREMAP="BO--Body"The curstatus field of the SRV_CURDESC structure is a bit mask that can take any combination of the following values:TOCENTRY="1"LBL="Table 2-13: "Values for curstatus (SRV_CURDESC)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="144*"COLNAME="C2" COLWIDTH="155*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CURSTAT_DECLAREDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The cursor has been declared. 
This status is reset after the next 
cursor command has been 
processed.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CURSTAT_OPENCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The cursor has been opened.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CURSTAT_ROWCNTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The cursor has specified the 
number of rows that should be 
returned for the 
CS_CURSOR_FETCH 
command.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CURSTAT_RDONLYCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The cursor is read only; it 
cannot be updated. The Open 
Server application should return 
an error to the client if a 
CS_CURSOR_UPDATE or 
CS_CURSOR_DELETE is 
received for this cursor.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CURSTAT_UPDATABLECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The cursor can be updated.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CURSTAT_CLOSEDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The cursor was closed, but not 
deallocated. It can be opened 
again later. This status is also set 
upon declaration of a cursor. 
Open Server clears it when a 
CS_CURSOR_OPEN is received 
and resets it when a 
CS_CURSOR_CLOSE is 
received. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CURSTAT_DEALLOCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The cursor was closed and 
deallocated. No other status 
flags should be set at this time.RENDERAS="SECT3"Values for curcmdREMAP="BO--Body"The curcmd field of the SRV_CURDESC structure can take one of the values described in the table below. The table also lists the relevant cmdoptions values.TOCENTRY="1"LBL="Table 2-14: "Values for curcmd (SRV_CURDESC)COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="144*"COLNAME="C2" COLWIDTH="155*"COLNAME="C3" COLWIDTH="155*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Legal values for cmdoptionsVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CURSOR_CLOSECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Cursor close command. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CUR_DEALLOC or 
SRV_CUR_UNUSED. 
SRV_CUR_DEALLOC indicates 
that the cursor will never be re-
opened. The Open Server 
application should delete all 
associated cursor resources. The 
cursor ID number can be reused.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CURSOR_DECLARECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Cursor declare command. The 
application can obtain the actual 
text of the cursor statement via 
MOREINFO="NONE"srv_langlen and MOREINFO="NONE"srv_langcpy.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CUR_UPDATABLE, 
SRV_CUR_RDONLY, or 
SRV_CUR_DYNAMIC. 
SRV_CUR_DYNAMIC 
indicates that the client is 
declaring the cursor against a 
dynamically prepared SQL 
statement; in this case, the text 
of the cursor statement is 
actually the name of the 
prepared statement. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CURSOR_DELETECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Cursor delete command. 
Performs a positional row delete 
through a cursor. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"There are no valid options for 
this command. cmdoptions will 
always have the value 
SRV_CUR_UNUSED.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CURSOR_FETCHCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Cursor fetch command. 
Performs a row fetch through a 
cursor. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"There are no valid options for 
this command. cmdoptions will 
always have the value 
SRV_CUR_UNUSED.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CURSOR_INFOCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Cursor information command. 
The client sends this command 
to the Open Server application 
to set the cursor row fetch count 
or to request cursor status 
information. The Open Server 
application sends this command 
to the client in response to any 
cursor command (including 
CS_CURSOR_INFO itself) to 
describe the current cursor.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CUR_SETROWS when the 
client is describing the current 
row fetch count. The fetchcnt field contains the requested 
fetch count. SRV_CUR_ASKSTATUS when 
the client is requesting status 
information about the current 
cursor. This generally occurs 
when the client has sent an 
attention and wants to see 
which cursors are still available 
afterwards. The curid field 
contains 0. The Open Server 
application should send back a 
CS_CURSOR_INFO response 
for each cursor currently 
available. SRV_CUR_INFORMSTATUS 
when the Open Server 
application is responding to a 
CS_CURSOR_INFO command. 
The curstatus field contains the 
cursor status. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CURSOR_OPENCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Cursor open command.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CUR_HASARGS or 
SRV_CUR_UNUSED.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CURSOR_UPDATECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Cursor update command. 
Performs a positional row 
update through a cursor. The 
Open Server application can 
obtain the actual text of the 
cursor update statement by 
calling MOREINFO="NONE"srv_langlen and 
MOREINFO="NONE"srv_langcpy. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CUR_HASARGS or 
SRV_CUR_UNUSED.ID="IN427128957"Cursorshandling cursor requestsRENDERAS="SECT2"Handling Cursor RequestsREMAP="BO--Body"ID="IN427109158"CursorsCursorsand the SRV_CURSOR event handlerSRV_CURSOR event handler
An Open Server application uses a SRV_CURSOR event handler to handle cursor requests. The handler includes code to detect which of the cursor commands has been issued and respond with the appropriate information.REMAP="BO--Body"The first task inside the event handler is to determine the current cursor, and the cursor command that triggered the SRV_CURSOR event. It does this by calling MOREINFO="NONE"srv_cursor_props with the cmd argument set to CS_GET. Open Server will fill the curcmd field of the Open Server application's SRV_CURDESC structure with the command type.REMAP="BO--Body"The application can then decide what other information it needs to retrieve, if any, as well as what data to send back to the client. In some cases, it may need to retrieve parameter formats and parameters; in others, it may want to know the status of the current cursor and the number of rows to fetch. In some cases, it may only need to send back a CS_CURSOR_INFO command; in others, it may need to send back result data or return parameters. ID="X99579" RENDERAS="SECT3"How to Respond to Specific RequestsREMAP="BO--Body"This section contains information on how a SRV_CURSOR event handler should respond to specific types of cursor requests.REMAP="BO--Body"The table below summarizes the valid exchange of cursor requests and responses between a client and an Open Server application. The forward arrow ("name='rArrow' font='symbol' code='174'  charset='fontspecific'
") indicates that cmd is set tm CS_GET-the application is retrieving information from the client. The backward arrow ("name='lArrow' font='symbol' code='172'  charset='fontspecific'
") indicates that cmd is set to CS_SET-the application is sending information to the client.REMAP="BO--Body"Prior to calling MOREINFO="NONE"srv_cursor_props with cmd set to CS_SET, an Open Server application must always set the curid field, and any other pertinent fields, in the SRV_CURDESC structure.TOCENTRY="1"LBL="Table 2-15: "Valid Cursor Requests and ResponsesCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="148*"COLNAME="C2" COLWIDTH="322*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Client ActionCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server Application ResponseVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Declares a cursor.(curcmd field of 
SRV_CURDESC contains 
CS_CURSOR_DECLARE)COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"name='rArrow' font='symbol' code='174'  charset='fontspecific' Retrieve curcmd value from SRV_CURDESC.(MOREINFO="NONE"srv_cursor_props)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve number of cursor parameters, if any.(MOREINFO="NONE"srv_numparams)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve format of cursor parameters, if any.(MOREINFO="NONE"srv_descfmt with type argument set to SRV_CURDATA)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve update column information, if any.(MOREINFO="NONE"srv_descfmt with type argument set toSRV_UPCOLDATA)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve actual text of cursor command.(MOREINFO="NONE"srv_langlen and MOREINFO="NONE"srv_langcpy)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Set cursor ID. Set curcmd field to CS_CURSOR_INFO and curid field 
to unique cursor ID.(MOREINFO="NONE"srv_cursor_props)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Send a DONE packet.(MOREINFO="NONE"srv_senddone with status argument set to SRV_DONE_FINAL)COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Requests the status of the 
current cursor or sends a fetch 
count.(curcmd field of 
SRV_CURDESC contains 
CS_CURSOR_INFO)COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"name='rArrow' font='symbol' code='174'  charset='fontspecific'Retrieve curcmd, curid, and cmdoptions values from SRV_CURDESC 
structure.(MOREINFO="NONE"srv_cursor_props)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Send number of rows to be returned per fetch, if client set 
cmdoptions field to SRV_CUR_SETROWS.(MOREINFO="NONE"srv_cursor_props with curcmd set to CS_CURSOR_INFO)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Send status of all available cursors, if client set cmdoptions field to 
SRV_CUR_ASKSTATUS. Set curcmd field to CS_CURSOR_INFO, and 
curid field to cursor ID.(MOREINFO="NONE"srv_cursor_props once for each active-declared, opened or closed-
cursor)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Send a DONE packet.(MOREINFO="NONE"srv_senddone with status argument set to SRV_DONE_FINAL)COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Opens a cursor.(curcmd field of 
SRV_CURDESC contains 
CS_CURSOR_OPEN)COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0" name='rArrow' font='symbol' code='174'  charset='fontspecific'
Retrieve curcmd and curid values from SRV_CURDESC structure.(MOREINFO="NONE"srv_cursor_props)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve number of cursor parameters, if any.(MOREINFO="NONE"srv_numparams)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve format of cursor parameters and actual parameters, if any.(MOREINFO="NONE"srv_descfmt, srv_bind, srv_xferdata with type argument set to 
SRV_CURDATA)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Send cursor status. Set curid to current cursor ID and curcmd to 
CS_CURSOR_INFO.(MOREINFO="NONE"srv_cursor_props)name='lArrow' font='symbol' code='172'  charset='fontspecific'
Describe result row formats.(MOREINFO="NONE"srv_descfmt with type argument set to SRV_ROWDATA)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Send a DONE packet.(MOREINFO="NONE"srv_senddone with status argument set to SRV_DONE_FINAL)COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Fetches rows.(curcmd field of 
SRV_CURDESC contains 
CS_CURSOR_FETCH)COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"name='rArrow' font='symbol' code='174'  charset='fontspecific' Retrieve curcmd and curid values from SRV_CURDESC structure.(MOREINFO="NONE"srv_cursor_props)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Send result rows, fetchcnt times.(MOREINFO="NONE"srv_bind, srv_xferdata with type argument set to SRV_ROWDATA)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Send a DONE packet.(MOREINFO="NONE"srv_senddone with status argument set to SRV_DONE_FINAL)COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Issues cursor update 
command.(curcmd field of 
SRV_CURDESC contains 
CS_CURSOR_UPDATE)or Issues cursor delete command.(curcmd field of 
SRV_CURDESC contains 
CS_CURSOR_DELETE)COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"name='rArrow' font='symbol' code='174'  charset='fontspecific' Retrieve curcmd and curid values from SRV_CURDESC structure.(MOREINFO="NONE"srv_cursor_props)}name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve key columns for current row.(MOREINFO="NONE"srv_descfmt, MOREINFO="NONE"srv_bind, MOREINFO="NONE"srv_xferdata with type argument set to 
SRV_KEYDATA)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve number of update values, if curcmd is 
CS_CURSOR_UPDATE.(MOREINFO="NONE"srv_numparams)Retrieve actual text of update statement, if curcmd is 
CS_CURSOR_UPDATE.(MOREINFO="NONE"srv_langlen and MOREINFO="NONE"srv_langcpy)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve update values, if curcmd is CS_CUSOR_UPDATE. (MOREINFO="NONE"srv_descfmt, MOREINFO="NONE"srv_bind, MOREINFO="NONE"srv_xferdata, with type argument set to 
SRV_CURDATA)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Send a DONE packet.(MOREINFO="NONE"srv_senddone with status argument set to SRV_DONE_FINAL)COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Sends a cursor close 
command.(curcmd field of 
SRV_CURDESC contains 
CS_CURSOR_CLOSE)COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"name='rArrow' font='symbol' code='174'  charset='fontspecific' Retrieve curcmd and curid values from SRV_CURDESC structure.(MOREINFO="NONE"srv_cursor_props)name='lArrow' font='symbol' code='172'  charset='fontspecific' 
Send cursor status.(MOREINFO="NONE"srv_cursor_props)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Send a DONE packet.(MOREINFO="NONE"srv_senddone with status argument set to SRV_DONE_FINAL)REMAP="BO--Body"Note that:MARK="BULL" REMAP="BU--Bullet"The Open Server application's response to a cursor command always concludes with a call to MOREINFO="NONE"srv_senddone with a status argument of "SRV_DONE_FINAL". Once the Open Server application issues the first MOREINFO="NONE"srv_cursor_props command with cmd set to "SET", any further information the application sends will apply to this cursor until a MOREINFO="NONE"srv_senddone with a status argument of SRV_DONE_FINAL is issued. Internally, Open Server replaces the parameter formats received when the client declares a cursor with those received when the client opens a cursor. This is necessary in case the format of the parameter passed in is not exactly the same as that of the parameter declaration. For example, a parameter may be declared as a CS_INT, but the parameter being passed in when the cursor is opened may be of type CS_SMALLINT.MOREINFO="NONE"srv_xferdata sends a single row of data, and should be called as many times as the number in the current cursor's row fetch count, in response to a CS_CURSOR_FETCH command.ID="IN42799259"Cursorshandling cursor requests
ID="IN42769560"CursorsCursorsand the SRV_CURDESC structureSRV_CURDESC structure
ID="IN42769561"CursorsCursorsand key datakey dataRENDERAS="SECT2"Key DataREMAP="BO--Body"A key is a subset of row data that uniquely identifies a row. Key data uniquely describes the "current row
" in an open cursor. It is used in processing CS_CURSOR_DELETE or CS_CURSOR_UPDATE commands. If a column is a key column, the status field of the CS_DATAFMT structure that describes the column has its CS_KEY bit mask set.ID="IN42769562"Cursorsupdate columnsRENDERAS="SECT2"Update ColumnsREMAP="BO--Body"If a client has declared a cursor as being "for update," the cmdoptions field of the SRV_CURDESC structure is set to CS_FOR_UPDATE and the numupcols field is set to the number of update columns associated with the cursor.RENDERAS="SECT2"ExampleREMAP="BO--Body"The online sample ctosdemo.c includes code illustrating cursor command processing.ID="IN42759663"Cursors
ID="IN42829964"MessagesSee Datastream messagesID="X13599" RENDERAS="SECT1"Datastream MessagesRENDERAS="SECT2"What Are Datastream Messages?REMAP="BO--Body"ID="IN421929965"Datastream messagesdefinition of
Datastream messages provide a way for clients and Open Server applications to exchange information. REMAP="BO--Body"RPC's provide similar functionality, but in the clientname='rArrow' font='symbol' code='174'  charset='fontspecific'
server direction only. Messages work in both directions, making them suitable for a wide variety of communications purposes. For example, Sybase uses messages to perform security handshaking at login time.REMAP="BO--Body"A message consists of a ID="IN421929966"Datastream messagesDatastream messagesand message idsmessage ids
ID="IN4213010167"SRV_MSG event
message ID and zero or more parameters. The client and Open Server application must be programmed to agree on the meaning of each message ID.REMAP="BO--Body"User-defined message ids must be greater than or equal to CS_USER_MSGID and less than or equal to CS_USER_MAX_MSGID. Message ids SRV_MINRESMSG through SRV_MAXRESMSG are reserved for internal Sybase use.REMAP="BO--Body"A client application sends a message by calling MOREINFO="NONE"ct_command with type set to CS_MSG_CMD. This triggers a SRV_MSG event in the Open Server application.RENDERAS="SECT2"ID="IN4219010168"Datastream messagesretrieving from client
Retrieving Client Datastream MessagesREMAP="BO--Body"A message datastream triggers an Open Server application's SRV_MSG event handler. Inside this handler, the application can retrieve the client message. To do this, the application:NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"Calls MOREINFO="NONE"srv_msg with cmd set to CS_GET and msgidp pointing to the buffer in which Open Server should place the message ID.REMAP="UN--Under"MOREINFO="NONE"srv_msg sets the statusp parameter to SRV_HASPARMS if the message has parameters.REMAP="UN--Under"For more information on the MOREINFO="NONE"srv_msg routine, see its reference page.Calls MOREINFO="NONE"srv_numparams, if necessary, to retrieve the number of parameters.Calls MOREINFO="NONE"srv_descfmt, MOREINFO="NONE"srv_bind, and MOREINFO="NONE"srv_xferdata to describe and retrieve each parameter. For more information on how to process parameters, see the LINKEND="X25021"Processing Parameter and Row Data
topics page.REMAP="BO--Body"An Open Server application can only retrieve messages from inside its SRV_MSG event handler.RENDERAS="SECT2"ID="IN4219010169"Datastream messagessending to client
Sending Datastream Messages to a ClientREMAP="BO--Body"An Open Server application can send a message to a client. To do this, the application:NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"Calls MOREINFO="NONE"srv_msg with cmd set to CS_SET and msgidp pointing to the buffer containing the message ID.REMAP="UN--Under"A *statusp value of SRV_HASPARAMS indicates that the message has parameters. A value of SRV_NOPARAMS indicates that the message has no parameters.REMAP="UN--Under"For more information on the MOREINFO="NONE"srv_msg routine, see its reference page.Calls MOREINFO="NONE"srv_descfmt, MOREINFO="NONE"srv_bind, and MOREINFO="NONE"srv_xferdata to describe and send each parameter. REMAP="BO--Body"An Open Server application can send messages from inside any event handler except the SRV_ATTENTION, SRV_CONNECT, SRV_DISCONNECT, SRV_URGDISCONNECT, and SRV_START handlers.ID="IN4211-110270"Dynamic SQLID="X26626" RENDERAS="SECT1"Dynamic SQLREMAP="BO--Body"Dynamic SQL allows a client application to execute SQL statements containing variables whose values are determined at run-time. It is primarily useful for precompiler support.REMAP="BO--Body"A client application prepares a Dynamic SQL statement by associating a SQL statement containing placeholders with an identifier and sending the statement to an Open Server application to be partially compiled and stored. The statement is then known as a prepared  statement. REMAP="BO--Body"When a client application is ready to execute a prepared statement, it defines values to substitute for the SQL statement's placeholders and sends a command to execute the statement. These values become the command's input parameters. REMAP="BO--Body"Once the statement has executed the desired number of times, the client application deallocates the statement.ID="IN4211-110271"Dynamic SQLuses for
ID="IN4211-110272"Dynamic SQLbenefits of usingRENDERAS="SECT2"What Is Dynamic SQL Good For? REMAP="BO--Body"Dynamic SQL permits a client application to act interactively, passing different information at different times to the Open Server application, as it gets that information from the user. The Open Server application can then fill in the missing pieces in the SQL query with the data the user provides. REMAP="BO--Body"For more information on how client applications use Dynamic SQL, see the Embedded SQL Programmer's Guide.ID="IN4211-310473"Dynamic SQLDynamic SQLand the SRV_DYNAMIC event handlerSRV_DYNAMIC event handlerRENDERAS="SECT2"Handling Dynamic SQL RequestsREMAP="BO--Body"When a client issues a dynamic command, Open Server raises a SRV_DYNAMIC event. If an Open Server application will be returning Dynamic SQL results, it must include a SRV_DYNAMIC event handler to respond to Dynamic SQL requests.RENDERAS="SECT3"ID="IN4211-510674"Dynamic SQLDynamic SQLand the srv_dynamic routinesrv_dynamic routine
The MOREINFO="NONE"srv_dynamic RoutineREMAP="BO--Body"Inside its SRV_DYNAMIC event handler, an Open Server application uses the MOREINFO="NONE"srv_dynamic routine, in conjunction with other Server-Library routines, to retrieve a client's Dynamic SQL command and respond to it. For more information on the MOREINFO="NONE"srv_dynamic routine, see  its reference page. Each client command type-preparation, execution, deallocation-requires a particular response on the part of the Open Server application.RENDERAS="SECT3"Detecting A Command TypeREMAP="BO--Body"An application's first task inside the SRV_DYNAMIC event handler is to retrieve the type of dynamic command the client issued, and in some cases, the dynamic statement's ID and text. It must store the information and refer back to it later when it responds to client requests. ID="IN4211-510675"Dynamic SQLresponding to client Dynamic SQL commandsRENDERAS="SECT3"Responding to Client Dynamic SQL CommandsREMAP="BO--Body"The table below summarizes the valid exchange of Dynamic SQL requests and responses between the client and the Open Server application. The forward arrow ("name='rArrow' font='symbol' code='174'  charset='fontspecific'
") indicates that cmd is set to CS_GET-the application is retrieving information from the client. The backward arrow ("name='lArrow' font='symbol' code='172'  charset='fontspecific'
") indicates that cmd is set to CS_SET-the application is sending information to the client.TOCENTRY="1"LBL="Table 2-16: "Valid Dynamic SQL Requests and ResponsesCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="131*"COLNAME="C2" COLWIDTH="310*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Client actionCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server Application ResponseVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Issues a prepare request.(Operation type is 
CS_PREPARE.)COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"name='rArrow' font='symbol' code='174'  charset='fontspecific' Retrieve the operation type.(MOREINFO="NONE"srv_dynamic)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve the statement ID length.(MOREINFO="NONE"srv_dynamic)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve the statement ID.(MOREINFO="NONE"srv_dynamic)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve the statement length.(MOREINFO="NONE"srv_dynamic)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve the statement.(MOREINFO="NONE"srv_dynamic)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Acknowledge the client command.(MOREINFO="NONE"srv_dynamic)name='lArrow' font='symbol' code='172'  charset='fontspecific' 
 Send the statement ID length.(MOREINFO="NONE"srv_dynamic)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Send the statement ID.(MOREINFO="NONE"srv_dynamic)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Send a DONE packet.(MOREINFO="NONE"srv_senddone with status argument set to SRV_DONE_FINAL)COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Requests a description of 
the statement's input 
parameters.(Operation type is 
CS_DESCRIBE_INPUT.)COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"name='rArrow' font='symbol' code='174'  charset='fontspecific' Retrieve the operation type.(MOREINFO="NONE"srv_dynamic)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve the statement ID length.(MOREINFO="NONE"srv_dynamic)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve the statement ID.(MOREINFO="NONE"srv_dynamic)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Acknowledge the client command.(MOREINFO="NONE"srv_dynamic)name='lArrow' font='symbol' code='172'  charset='fontspecific' 
 Send the statement ID length.(MOREINFO="NONE"srv_dynamic)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Send the statement ID.(MOREINFO="NONE"srv_dynamic)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Send the format of the input parameters.(MOREINFO="NONE"srv_descfmt and MOREINFO="NONE"srv_xferdata with type argument set to 
SRV_DYNDATA. There is no need to call MOREINFO="NONE"srv_bind, as the application 
is sending formats but no actual data. The status field of the 
CS_DATAFMT structure must be OR'd with CS_DESCIN prior to 
calling MOREINFO="NONE"srv_descfmt.)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Send a DONE packet.(MOREINFO="NONE"srv_senddone with status argument set to SRV_DONE_FINAL)COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Requests a description of 
the statement's output 
parameters.
(Operation type is 
CS_DESCRIBE_OUTPUT.)COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"name='rArrow' font='symbol' code='174'  charset='fontspecific' Retrieve the operation type.(MOREINFO="NONE"srv_dynamic)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve the statement ID length.(MOREINFO="NONE"srv_dynamic)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve the statement ID.(MOREINFO="NONE"srv_dynamic)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Acknowledge the client command.(MOREINFO="NONE"srv_dynamic)name='lArrow' font='symbol' code='172'  charset='fontspecific' 
Send the statement ID length.(MOREINFO="NONE"srv_dynamic)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Send the statement ID.(MOREINFO="NONE"srv_dynamic)name='lArrow' font='symbol' code='172'  charset='fontspecific' 
Send the result row formats.(MOREINFO="NONE"srv_descfmt and MOREINFO="NONE"srv_xferdata with type argument set to 
SRV_DYNDATA. There is no need to call MOREINFO="NONE"srv_bind, as the application 
is sending formats but no actual data. The status field of the 
CS_DATAFMT structure must be OR'd with CS_DESCOUT prior to 
calling MOREINFO="NONE"srv_descfmt)name='lArrow' font='symbol' code='172'  charset='fontspecific' 
 Send a DONE packet.(MOREINFO="NONE"srv_senddone with status argument set to SRV_DONE_FINAL)COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Client issues an execute 
request.(Operation type is 
CS_EXECUTE.)COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"name='rArrow' font='symbol' code='174'  charset='fontspecific' Retrieve the operation type.(MOREINFO="NONE"srv_dynamic)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve the statement ID length.(MOREINFO="NONE"srv_dynamic)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve the statement ID.(MOREINFO="NONE"srv_dynamic)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve the number of dynamic parameters.(MOREINFO="NONE"srv_numparams)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve the input parameter values.(MOREINFO="NONE"srv_descfmt, srv_bind, srv_xferdata with type argument set to 
SRV_DYNDATA.)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Acknowledge the client command.(MOREINFO="NONE"srv_dynamic)name='lArrow' font='symbol' code='172'  charset='fontspecific' 
Send the statement ID length.(MOREINFO="NONE"srv_dynamic)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Send the statement ID.(MOREINFO="NONE"srv_dynamic)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Send result rows.(MOREINFO="NONE"srv_descfmt, MOREINFO="NONE"srv_bind, MOREINFO="NONE"srv_xferdata, with type argument set to 
SRV_ROWDATA)name='lArrow' font='symbol' code='172'  charset='fontspecific' 
 Send a DONE packet.(MOREINFO="NONE"srv_senddone with status argument set to SRV_DONE_FINAL)COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Issues an execute-
immediate request(Operation type is 
CS_EXEC_IMMEDIATE).COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"name='rArrow' font='symbol' code='174'  charset='fontspecific' Retrieve the operation type.(MOREINFO="NONE"srv_dynamic)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve the statement ID length. It should be 0.(MOREINFO="NONE"srv_dynamic)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve the statement length.(MOREINFO="NONE"srv_dynamic)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve the statement.(MOREINFO="NONE"srv_dynamic)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Acknowledge the client command.(MOREINFO="NONE"srv_dynamic)name='lArrow' font='symbol' code='172'  charset='fontspecific' 
 Send a DONE packet.(MOREINFO="NONE"srv_senddone with status argument set to SRV_DONE_FINAL)COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Issues a deallocation 
request.
(Operation type is 
CS_DEALLOC.)COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"name='rArrow' font='symbol' code='174'  charset='fontspecific' Retrieve the operation type.(MOREINFO="NONE"srv_dynamic)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve the statement ID length.(MOREINFO="NONE"srv_dynamic)name='rArrow' font='symbol' code='174'  charset='fontspecific'
 Retrieve the statement ID.(MOREINFO="NONE"srv_dynamic)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Acknowledge the client command.(MOREINFO="NONE"srv_dynamic)name='lArrow' font='symbol' code='172'  charset='fontspecific' 
Send the statement ID length.(MOREINFO="NONE"srv_dynamic)name='lArrow' font='symbol' code='172'  charset='fontspecific'
 Send the statement ID.(MOREINFO="NONE"srv_dynamic)name='lArrow' font='symbol' code='172'  charset='fontspecific' 
 Send a DONE packet.(MOREINFO="NONE"srv_senddone with status argument set to SRV_DONE_FINAL)RENDERAS="SECT2"ExampleREMAP="BO--Body"The online sample ctosdemo.c includes code illustrating Dynamic SQL command processing.ID="IN4211-610776"Dynamic SQL
ID="IN426-710877"ErrorsID="X24762" RENDERAS="SECT1"ErrorsREMAP="BO--Body"Open Server's default response to errors is to write error messages to the log file. An application can tailor this response by installing an error handling routine.REMAP="BO--Body"Typically, an error handler detects the type and severity of an error, and takes a specific action based on these values. For example, an application may want to send particular errors to a client via the MOREINFO="NONE"srv_sendinfo routine, while writing others to a log file.REMAP="BO--Body"An error handler is installed using the MOREINFO="NONE"srv_props routine with the property argument set to SRV_S_ERRHANDLE. An application should install its error handler just after calling MOREINFO="NONE"srv_version in order to catch all types of errors. When an error occurs, Open Server invokes the error handling routine that was most recently installed. REMAP="BO--Body"For more information on MOREINFO="NONE"srv_props, see its reference page. ID="IN426-710878"Errorstypes ofRENDERAS="SECT2"Types of ErrorsREMAP="BO--Body"An Open Server application, a client application, and the Open Server itself can each provoke Open Server errors. The following is a description of each category:MARK="BULL" REMAP="BU--Bullet"Open Server application  errors.This type of error occurs because of a mistake in application code. For example, if an application attempted to send a row of data to a client without first describing the format of the data, Open Server would raise an error.Client command errors. This type of error occurs when a client has sent an incomplete or nonsensical request. Requests can be incomplete or meaningless because of faulty client code or because of a network problem. An Open Server application should handle these errors in the event handler for the client request, usually by sending the appropriate error messages to the client with MOREINFO="NONE"srv_sendinfo. See the LINKEND="X83099"Client Command Errors
topics page, for more details.The application can also set the status parameter in MOREINFO="NONE"srv_senddone to SRV_DONE_ERROR to indicate that a client request provoked an error. Open Server resource errors. This type of error originates with the Open Server itself. It typically occurs because of a lack of some resource, like memory or user connections.ID="IN426-710879"Errorsseverity ofRENDERAS="SECT2"Severity of ErrorsREMAP="BO--Body"Each Open Server error is associated with a number, a severity, and a message.REMAP="BO--Body"When an error occurs, the currently installed error handler function is called with the error number, error severity, and text of the message. If no error handler has been installed, this same information is written to the Open Server's log file. An application can also explicitly write to the log file with a call to MOREINFO="NONE"srv_log.REMAP="BO--Body"An Open Server application can set the log file's maximum size using MOREINFO="NONE"srv_props with the property argument set to SRV_S_LOGSIZE.REMAP="BO--Body"Error numbers and severities are defined in the header file oserror.h. An application that wants to use the defined error values must include oserror.h.REMAP="BO--Body"The following table summarizes Open Server error severities:TOCENTRY="1"LBL="Table 2-17: "Severity of ErrorsCOLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="72*"COLNAME="C2" COLWIDTH="242*"COLNAME="C3" COLWIDTH="148*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SeverityCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Applicable Error TypeVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_INFOCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"An informational error. Most errors are of this 
severity. This severity indicates that an error has 
occurred but that it is not fatal. It is most often 
generated by an incorrect invocation of a Server-
Library function. Calling MOREINFO="NONE"srv_xferdata to send a row 
before describing all the columns with MOREINFO="NONE"srv_descfmt 
would generate a SRV_INFO error.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server application errorClient command errorCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_FATAL_
PROCESSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A fatal thread error. The thread that got the error has 
an internal error from which it cannot recover. For 
example, the application may have returned from 
an event without calling MOREINFO="NONE"srv_senddone. An error of 
this severity causes Open Server to queue a 
SRV_DISCONNECT event for the thread, if the 
thread is a client thread, a SUB-PROC, or a site-
handler. Open Server then kills the thread.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server resource errorCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_FATAL_
SERVERCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A fatal server error. Open Server has detected an 
internal error from which it cannot recover. This 
causes Open Server to queue a SRV_STOP event for 
the Open Server application, which causes MOREINFO="NONE"srv_run to 
return CS_FAIL.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server resource errorRENDERAS="SECT3"Operating System ErrorsREMAP="BO--Body"When an operating system error occurs, the operating system error number will be different than SRV_ENO_OS_ERR and the operating system error text will contain the description of the operating system error. An example of this would be if MOREINFO="NONE"srv_init were unable to open the interfaces file because of an operating system permissions error.RENDERAS="SECT2"Error Numbers and Corresponding Message TextREMAP="BO--Body"See the on-line header file, oserror.h for a complete list of error numbers.RENDERAS="SECT2"ExampleREMAP="BO--Body"All on-line sample programs include an Open Server error handler.ID="IN426-810980"Errors
ID="IN426-911081"EventsID="X78566" RENDERAS="SECT1"EventsID="IN426-911082"Eventsdefinition ofRENDERAS="SECT2"What Is an Event?REMAP="BO--Body"An Open Server responds to requests from clients. Some of these requests trigger an event in the Open Server.REMAP="BO--Body"Not all events are provoked by client activity. The application itself queues programmer-defined events and the SRV_DISCONNECT, SRV_URGDISCONNECT, and SRV_STOP events by calling the MOREINFO="NONE"srv_event or MOREINFO="NONE"srv_event_deferred routine. For more information on using the MOREINFO="NONE"srv_event routine to raise events, see its reference page. Open Server can also trigger a SRV_STOP event in response to a fatal server error. Open Server raises a SRV_START event automatically, as part of the server's start-up process. REMAP="BO--Body"An event occurs in a specific context; it corresponds to a particular category of activity. For example, a connection attempt from a client or remote server triggers a SRV_CONNECT event, while a client's bulk copy request causes Open Server to raise a SRV_BULK event. REMAP="BO--Body"There are two kinds of events in Open Server: standard and programmer-defined. Standard events are defined internally in Open Server. Programmer-defined events are, as the name suggests, defined within the application. For more details on both kinds of events, see below,LINKEND="X43694""Standard Events" 
 ,  and LINKEND="X56943""Programmer-Defined Events" 
.ID="IN4214-911083"Event handlersdefinition ofRENDERAS="SECT2"What Is an Event Handler?REMAP="BO--Body"When Open Server triggers an event, it places the event in the active thread's event queue. The thread then executes a routine that processes the event. This routine is called an event handler.RENDERAS="SECT3"Default and Custom ID="IN4214-911084"Event handlersdefault versus custom
HandlersREMAP="BO--Body"Open Server has a default event handler routine for each standard event, as well as for programmer-defined events. The default handlers are placeholders for the custom event handlers the application programmer installs with the MOREINFO="NONE"srv_handle routine. An application that does not want to use the default handlers must define and install each custom event-handling routine. For more information on installing handlers, see  the MOREINFO="NONE"srv_handle reference page.REMAP="BO--Body"Event handlers can be installed dynamically. The new event handler is called the next time the event is raised. Event handlers should always return CS_SUCCEED on success, and CS_FAIL on failure. Currently, the SRV_START handler is the only event handler whose return code Open Server checks. Returning CS_FAIL from a SRV_START handler causes MOREINFO="NONE"srv_run to return CS_FAIL to the application without starting Open Server.RENDERAS="SECT3"Coding Custom ID="IN4214-911085"Event handlerscoding custom handlers
HandlersREMAP="BO--Body"It is the application programmer's responsibility to decide how to respond to an event, and to code the event handler accordingly. Event handlers typically include a standard set of calls to process the event data. Any code in addition to this is application-specific. For example, a SRV_MSG event handler should include code to retrieve the text of the message as well as any parameters. But an application can include additional code in the SRV_MSG event handler to send mail to users if a particular message is retrieved.ID="IN426-1011186"Eventslist of standardID="X43694" RENDERAS="SECT2"Standard EventsREMAP="BO--Body"The table below describes each standard Open Server event and the argument the corresponding custom event handler should take. It also describes what the corresponding default event handler does.TOCENTRY="1"LBL="Table 2-18: "Description of EventsCOLS="4" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="141*"COLNAME="C2" COLWIDTH="149*"COLNAME="C3" COLWIDTH="96*"COLNAME="C4" COLWIDTH="118*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"EventCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Argument to 
HandlerCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Default Event HandlerVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_ATTENTIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"An attention has been 
received. This usually occurs 
when a client calls MOREINFO="NONE"ct_cancel to 
stop results processing 
prematurely. 
SRV_ATTENTION is an 
immediate event; Open Server 
services it as soon as it occurs 
rather than adding it to the 
client's event queue. A 
SRV_ATTENTION event 
executes at interrupt level.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_PROC*COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The default handler 
takes no additional 
action.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_BULKCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A client has issued a bulk copy 
request.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_PROC*COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The default handler 
sends the message "No 
bulk handler installed" 
to the client. Open 
Server discards the bulk 
data and returns a 
DONE ERROR to the 
client.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CONNECTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A Client-Library client has 
called MOREINFO="NONE"ct_connect.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_PROC*COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The default handler 
accepts the connection.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CURSORCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A client has sent a cursor 
request.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_PROC*COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The default handler 
sends the message "No 
SRV_CURSOR handler 
installed" to the client. 
Open Server returns a 
DONE ERROR to the 
client.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DISCONNECTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A request to disconnect a client 
connection has been made. 
This is triggered by a client 
disconnecting from a server, an 
Open Server fatal thread error, 
a SRV_STOP event, or a call to 
MOREINFO="NONE"srv_event made from within the 
application explicitly to 
disconnect a client.Client-Library programs call 
MOREINFO="NONE"ct_close or MOREINFO="NONE"ct_exit to log out of 
the Open Server application. 
Remote SQL Server 
connections terminate when 
the remote procedure call has 
completed. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_PROC*COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The default handler 
takes no action.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DYNAMICCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A client has sent a Dynamic 
SQL request.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_PROC*COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The default handler 
sends the message "No 
SRV_DYNAMIC 
handler installed" to the 
client. Open Server 
returns a DONE 
ERROR to the client.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_LANGUAGECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A client has sent a language 
request, such as a SQL 
statement. A Client-Library 
client submits a language 
request using MOREINFO="NONE"ct_command and 
MOREINFO="NONE"ct_send. isql and other 
interactive query tools can also 
send language requests to the 
Open Server application.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_PROC*COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The default handler 
sends the message "No 
language handler 
installed" to the client, 
along with the first few 
characters of the 
language request. 
Open Server returns a 
DONE ERROR to the 
client.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MSGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A client has sent a message.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_PROC*COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The default handler 
sends the message "No 
SRV_MSG handler 
installed" to the client. 
Open Server returns a 
DONE ERROR to the 
client.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_OPTIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A client has sent an option 
command.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_PROC*COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The default handler 
sends the message "No 
SRV_OPTION handler 
installed" to the client. 
Open Server returns a 
DONE ERROR to the 
client.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_RPCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A client or a remote SQL 
Server has issued a remote 
procedure call.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_PROC*COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The default handler 
sends the message 
"RPC < rpcname > 
received. No remote 
procedure call handler 
installed" to the client. 
Open Server returns a 
DONE ERROR to the 
client.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_STARTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A call to MOREINFO="NONE"srv_run triggers a 
SRV_START event. The Open 
Server application is up and 
running. The SRV_START 
event handler is a good place 
to initialize server resources 
and to spawn service threads.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_SERVER*COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The default handler 
takes no action. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_STOPCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A request to stop the Open 
Server application has been 
made, triggered by a call to 
MOREINFO="NONE"srv_event or by an Open Server 
fatal server error. The Open 
Server application is stopped. 
MOREINFO="NONE"srv_run returns CS_SUCCEED 
if the application requested a 
SRV_STOP event or CS_FAIL if 
a fatal server error provoked 
the SRV_STOP event. A custom handler for this 
event can perform any 
necessary cleanup before the 
Open Server application shuts 
down.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_SERVER*COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The default handler 
takes no action.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_URGDISCONNECTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"This event is only triggered by 
an Open Server application 
calling MOREINFO="NONE"srv_event. In response to 
this event, Open Server calls a 
threads SRV_DISCONNECT 
event handler. Open Server 
places the event at the top of 
the threads event queue, so 
that it is processed as the next 
event. An application should raise 
this event if it wants to 
terminate a thread 
immediately, bypassing other 
events in the queue. When a 
SRV_URGDISCONNECT 
event is raised, the I/O 
channel associated with the 
thread is marked dead.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_PROC*COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The default handler 
takes no action.ID="IN426-1011187"Eventsprogrammer-definedID="X56943" RENDERAS="SECT2"Programmer-Defined Events REMAP="UN--Under"An application defines programmer-defined events with MOREINFO="NONE"srv_define_event and installs them with MOREINFO="NONE"srv_handle. The application must call MOREINFO="NONE"srv_event or MOREINFO="NONE"srv_event_deferred to place the new event on the client's event queue.REMAP="UN--Under"The default programmer-defined event handler sends a message to the client stating that there is no handler installed. The message includes the event number and name. REMAP="UN--Under"Programmer-defined events can be used to provide services to other threads in the Open Server. For example, such an event could allow threads to log transactions in a disk file. To set up this service, the application would define the event with MOREINFO="NONE"srv_define_event, install a handler routine that writes to the disk file, and create a service thread to which the events are queued. The service thread would provide the transaction
-logging code. RENDERAS="SECT2"ExampleREMAP="UN--Under"The on-line sample lang.c illustrates a simple SRV_LANGUAGE event handler.ID="IN426-1111288"EventsREMAP="BO--Body"ID="X70123" RENDERAS="SECT1"Gateway ApplicationsREMAP="BO--Body"An Open Server application that acts as both a client and a server is called a gateway application. Gateway applications often act as intermediaries for clients and servers that cannot communicate directly. REMAP="BO--Body"For example, a SYBASE Open Client application cannot communicate directly with an Oracle database engine, but the client application can communicate with an Open Server application that is serving as a gateway. In this case, the gateway acts as a server to the Open Client application and as a client to the Oracle database engine. REMAP="BO--Body"Another case is one in which a SYBASE client cannot directly access a remote SYBASE SQL Server because the two are running on dissimilar networks. The gateway server bridges this gap, retrieving the client data and re-packaging it to send to the remote SQL Server. SYBASE's mirror-image client and server routines make this process simple. The server and client components can even share the same data description structure; the gateway fills in a structure with information from the remote client using Server-Library calls and then extracts that same information from the structure to send along to the remote server using Client-Library or DB-Library calls.REMAP="BO--Body"Gateways that act as clients to a SYBASE SQL Server or to an Open Server application use Client-Library or DB-Library routines to fill the client role that they play.REMAP="BO--Body"Gateways that act as servers to Open Client applications use Server-Library routines to fill the server role that they play. Client-Library cannot be run in full asynchronous mode in an Open Server application.REMAP="BO--Body"The on-line sample program ctosdemo.c is an example of a "virtual SQL Server" gateway. The gateway demonstrates how to pass data from a remote SQL Server to a SYBASE client.In gateway applications, the client routines execute in the context of an Open Server process, or thread. If this process (or the entire Open Server application) were to be terminated, any client routines that were still executing would yield undefined results.RENDERAS="SECT2"RENDERAS="SECT3"Pass-Through ModeREMAP="BO--Body"In the special case of an Open Server application that connects SYBASE client applications with a SQL Server, Client-Library and DB-Library provide a set of application protocol pass-through routines that allow the Open Server to pass Tabular Data Stream (TDS) packets between the client and server without interpreting the contents. This is more efficient than unpacking the TDS information as it arrives and repacking it before sending it on. The on-line sample, fullpass.c, is an example of this type of gateway. For more information on pass-through mode, see the LINKEND="X16584"Pass-Through Mode
 topics page.Pre-10.0 releases of DB-Library must not be linked into an application with Open Server Release 10.0, although they can be used in application programs that serve as clients to Open Server 10.0. RENDERAS="SECT1"ID="X27944"ID="IN42129921"Localization
International ID="IN42219652"International supportSee Localization
SupportREMAP="BO--Body"10.0 Open Server provides support for international applications by:MARK="BULL" REMAP="BU--Bullet"Allowing an Open Server application to localize.REMAP="UN--Under"An Open Server application that is localized typically:MARK="DASH" REMAP="BS--BulletSub"Generates error messages in a local language and character set.Uses local datetime formatsUses a specific character set and collating sequence
 (also called "sort order") when converting or comparing stringsEnabling an Open Server application to support localized clients.REMAP="UN--Under"A localized client uses the language, datetime formats, and character set of its choice. These may differ from the Open Server application's language, datetime formats, and character set. In order to support localized clients, an Open Server application must not only translate incoming data into its own language and character set, but must also translate outgoing messages and data into the client's language and character set.REMAP="BO--Body"This topics page contains information on:MARK="BULL" REMAP="BU--Bullet"Localizing an Open Server applicationSupporting localized clientsClient requests related to localizationLocalization propertiesThe localization example programsPlatform-specific localization issues are discussed in the International Support chapter of the Open Client/Server Supplement. You must read this chapter in order to understand Server-Library's localization mechanism and how environment variables affect localization. RENDERAS="SECT2"ID="IN42129563"Localizationof an Open Server application
Localizing an Open Server ApplicationREMAP="BO--Body"An Open Server application's localization determines:MARK="BULL" REMAP="BU--Bullet"The language in which error messages are generated (provided that the SRV_S_USESRVLANG and SRV_T_USESRVLANG properties, which can be used to override a a server's language when generating error messages, are set to CS_TRUE)The character set and collating sequence used for all data operationsREMAP="BO--Body"On most platforms, Open Server uses environment variables to determine an application's default localization values. At context allocation time, Open Server stores these default values in the application's newly allocated context structure. If these default values meet an application's needs, it does not have to localize further.REMAP="BO--Body"If the default values don't meet an application's needs, the application can use a CS_LOCALEID="IN42129384"LocalizationLocalizationand the CS_LOCALE structureCS_LOCALE structure
 structure to set custom localization values in its context structure.REMAP="BO--Body"To do this, an application:NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"Calls MOREINFO="NONE"cs_loc_alloc to allocate a CS_LOCALE structure. Calls MOREINFO="NONE"cs_locale with type set to CS_LC_ALL to load the CS_LOCALE with custom localization values. A type of CS_LC_ALL ensures that the CS_LOCALE is loaded with localization values that are internally consistent.Calls MOREINFO="NONE"cs_config with property set to CS_LOC_PROP to copy the custom localization values into the application's context structure.Calls MOREINFO="NONE"cs_loc_drop to deallocate the CS_LOCALEID="IN42129295"Localizationof an Open Server application
.RENDERAS="SECT2"ID="IN421291106"Localizationsupporting localized clients
Supporting Localized ClientsREMAP="BO--Body"Open Server automatically handles some tasks associated with supporting localized clients. These include:MARK="BULL" REMAP="BU--Bullet"Performing character set translation of both incoming and outgoing data.Providing Open Server error messages in the client's language and character set (provided that the SRV_T_USESRVLANG property for the client's thread structure is set to CS_FALSE).REMAP="BO--Body"For some Open Server applications, this automatic support for localized clients is sufficient. These Open Server applications do not need to take any additional steps to support localized clients.REMAP="BO--Body"Other Open Server applications, however, need to provide additional support for localized clients. In particular, an Open Server application needs to take additional steps to support localized clients:MARK="BULL" REMAP="BU--Bullet"If it will be passing CS-Library error messages back to clients.REMAP="UN--Under"In this case, the Open Server application needs to ensure that CS-Library generates messages in the client's language and the Open Server application's character set.REMAP="UN--Under"For information on how to do this, see LINKEND="X16904""Localizing CS-Library Messages for Clients" 
.If it is acting as a gateway.REMAP="UN--Under"In this case, the Open Server application needs to ensure that a connection to a remote server uses the client's language and the Open Server's character set.REMAP="UN--Under"For information on how to do this, see LINKEND="X87704""Creating Localized Connections" 
.RENDERAS="SECT3"Providing aID="IN421289127"LocalizationLocalizationand the CS_LOCALE structureCS_LOCALE structure
 Client CS_LOCALE for Data TranslationREMAP="BO--Body"When a client connects to an Open Server application, Open Server creates a CS_LOCALE structure reflecting the client's language, character set, and sort order.REMAP="BO--Body"For example, when a french/cp850/noaccents client logs into a us_english/iso_1/binary Open Server application, the Open Server application creates a french/cp850/noaccents CS_LOCALE structure.REMAP="BO--Body"The information in this structure is available to Open Server programmers, who can call MOREINFO="NONE"cs_locale to copy the information into a newly-allocated CS_LOCALE structure.ID="X16904" RENDERAS="SECT3"Localizing CS-Library Messages for ClientsREMAP="BO--Body"If an Open Server application calls a CS-Library routine with its own context structure as a parameter, any error messages that CS-Library generates as the result of the call will be in the Open Server application's language and character set. REMAP="BO--Body"For example, if the context parameter for a MOREINFO="NONE"cs_convert call indicates us_english/iso_1, CS-Library will generate a us_english/iso_1 message if the MOREINFO="NONE"cs_convert call fails.If a CS-Library routine takes a CS_LOCALE structure as a parameter, the localization values in this structure will override the localization values in the context parameter. REMAP="BO--Body"This is fine if the Open Server application only logs the CS-Library messages or otherwise keeps them to itself. REMAP="BO--Body"However, if an Open Server application will be passing CS-Library error messages back to a client, it needs to ensure that CS-Library generates messages in the client's language and the Open Server application's character set:MARK="BULL" REMAP="BU--Bullet"The messages need to be in the client's language in order for the client to understand them.The messages need to be in the Open Server application's character set for two reasons:MARK="DASH" REMAP="BS--BulletSub"Open Server applications commonly record all messages in the log file. It is important that all logged messages use the same character set.Open Server automatically performs character set translation on outgoing data, including messages. Generating messages in Open Server's character set ensures that they will be correctly translated to the client's character set.REMAP="BO--Body"The simplest way for an application to do this is to set up a properly localized CS_CONTEXT structure for each client thread and then use these CS_CONTEXT structures when calling CS-Library routines on behalf of clients.REMAP="BO--Body"For information on how to localize a CS_CONTEXT structure, see LINKEND="X93824""Localizing a CS_CONTEXT Structure"
 below.ID="X87704" RENDERAS="SECT3"Creating ID="IN421289128"Localizationcreating localized connections
Localized ConnectionsREMAP="BO--Body"If an Open Server application is acting as a gateway, it needs to ensure that a connection to a remote server uses the client's language and the Open Server's character set.REMAP="BO--Body"The simplest way for an application to do this is to set up a properly localized CS_CONTEXT structure for each client thread and then allocate remote connections for the client thread within the localized context.ID="X93824" RENDERAS="SECT3"Localizing a ID="IN421286159"Localizationof a CS_CONTEXT structure
CS_CONTEXT StructureREMAP="BO--Body"To properly localize a CS_CONTEXT structure for a client thread, an Open Server application must:NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"Call MOREINFO="NONE"cs_ctx_alloc to allocate a CS_CONTEXT for the client thread.Call MOREINFO="NONE"cs_loc_alloc to allocate a new CS_LOCALE structure.Call MOREINFO="NONE"srv_thread_props to copy the client thread's existing CS_LOCALE structure. (This sets the new CS_LOCALE up with the client's language, character set, and sort order.)Call MOREINFO="NONE"cs_locale with type as CS_SYB_CHARSET to replace the client's character set with the Open Server's character set.Call MOREINFO="NONE"cs_config with property as CS_LOC_PROP to copy the localization information from the CS_LOCALE into the CS_CONTEXT.Call MOREINFO="NONE"cs_loc_drop to deallocate the CS_LOCALE, if desired. An application can also re-use a CS_LOCALE structure, calling MOREINFO="NONE"cs_localeID="IN4212831810"Localizationof a CS_CONTEXT structure
ID="IN4212821911"Localizationsupporting localized clients
, if necessary, to change its localization values.RENDERAS="SECT2"Responding to Client RequestsREMAP="BO--Body"Clients can:MARK="BULL" REMAP="BU--Bullet"Request to change their language and character setRequest localization informationRENDERAS="SECT3"Requests to Change Language and Character SetREMAP="BO--Body"When a client connects to an Open Server, it specifies a language and character set in the login record. Open Server uses this information to set up a CS_LOCALE and character set conversion
 routines for the client thread.REMAP="BO--Body"Open Server handles this automatically; an Open Server does not need to take any steps to handle localized clients at log-in time.REMAP="BO--Body"However, after logging in, clients can change their language and character set. If a client sends an Open Server application a request to change its language or character set, the Open Server application needs to take specific steps to handle this request.ID="IN4217821912"National languageprocessing client request to changeREMAP="BO--Body" A client can request a change of language in two ways:MARK="BULL" REMAP="BU--Bullet"Via a language-based option command. This type of command triggers a SRV_LANGUAGE event, so the Open Server application processes the request inside a SRV_LANGUAGE event handler.Via an option command. This type of command triggers a SRV_OPTION event, so the Open Server application processes the request inside a SRV_OPTION event handler.REMAP="BO--Body"In both cases, the Open Server application responds by:NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"Setting up a CS_LOCALE structure with the new languageCalling the MOREINFO="NONE"srv_thread_props routine with property set to SRV_T_LOCALE to change the national language for the thread connectionID="IN4213821913"Character set processing client request to changeREMAP="BO--Body"A client can request a change of character set in two ways:MARK="BULL" REMAP="BU--Bullet"Via a language-based option command. This type of command triggers a SRV_LANGUAGE event, so the Open Server application will process the request inside a SRV_LANGUAGE event handler. Via an option command. This type of command triggers a SRV_OPTION event, so the Open Server application will process the request inside a SRV_OPTION event handler.REMAP="BO--Body"In both cases, the Open Server application responds by:NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"Setting up a CS_LOCALE structure with the new character setCalling the MOREINFO="NONE"srv_thread_props routine with property set to SRV_T_LOCALE to change the character set for the thread connectionRENDERAS="SECT3"Requests for Localiszation Information ID="IN4213782317"sp_serverinforesponding to sp_serverinfo requests
ID="IN4212821914"Localizationreturning localization information to clients
ID="IN4213821915"Character setreturning information about
ID="IN4210821916"Sort orderreturning information aboutREMAP="BO--Body"After logging in, a client can ask for:MARK="BULL" REMAP="BU--Bullet"The name of the server's character setThe name of the server's sort orderThe character set definition for the client's character setThe sort order definition for the client's sort orderREMAP="BO--Body"Clients make these requests via the ID="IN4212762518"LocalizationLocalizationand sp_serverinfo sp_serverinfo
MOREINFO="NONE"sp_serverinfo system registered procedure, using RPC commands.REMAP="BO--Body"In response, Open Server automatically returns the requested information by means of theMOREINFO="NONE" sp_serverinfo system registered procedure. The Open Server application does not need to take any action at this point, and, in fact, is not aware that the request ever occurred.REMAP="BO--Body"For more information on these routines see LINKEND="X80111"Registered Procedures.RENDERAS="SECT2"LocalizationID="IN4212752619"Localizationproperties related to
 PropertiesREMAP="BO--Body"Two properties are related to localization:MARK="BULL" REMAP="BU--Bullet"SRV_S_USESRVLANG SRV_T_USESRVLANG REMAP="BO--Body"These properties determine whether Open Server generates error messages in the Open Server application's language or a client's language.REMAP="BO--Body"SRV_S_USESRVLANG is a server-wide property, set via MOREINFO="NONE"srv_props. Its value serves as the default value for SRV_T_USESRVLANG.REMAP="BO--Body"SRV_T_USESRVLANG is a thread property, set via MOREINFO="NONE"srv_thread_props. When a new thread structure is allocated, SRV_T_USESRVLANG picks up a default value from SRV_S_USESRVLANG.REMAP="BO--Body"If SRV_T_USESRVLANG is CS_TRUE, Open Server generates error messages in the server's language.REMAP="BO--Body"If SRV_T_USESRVLANG is CS_FALSE, Open Server generates error messages in the client's language.REMAP="BO--Body"For more information on setting properties, see LINKEND="X41578""Tailoring Your Open Server" 
ID="IN4212742720"Localizationproperties related to
 and LINKEND="X51278""Thread Properties" 
.RENDERAS="SECT2"Localization ExamplesREMAP="BO--Body"The on-line example ctosdemo.c demonstrates one method of customizing a CS_LOCALE structure. The on-line example intlchar.cID="IN4212732821"Localization
 handles character set and national language configuration and queries.REMAP="BO--Body"REMAP="BO--Body"RENDERAS="SECT1"Language CallsID="IN42189832"SRV_LANGUAGE eventREMAP="BO--Body"Open Server provides functionality for processing language events in a flexible manner. A SRV_LANGUAGE event is triggered when a client application sends information via MOREINFO="NONE"ct_command with the type argument set to CS_LANG_CMD. Whereas an RPC stream is composed of discrete elements-a name and parameters-language information arrives in a stream of undifferentiated characters. A SRV_LANGUAGE event handler must include code to parse the stream into its meaningful components. An SQL query is an example of a language stream.REMAP="BO--Body"This functionality is useful for applications that want to accept information in a natural language. For example, consider a clothing store application that lets users query an SQL database in English. A sales clerk could type in the question "How many shirts in blue?" The front end client application could send this to a gateway application via a call to MOREINFO="NONE"ct_command. The SRV_LANGUAGE handler could parse this text, construct the Transact-SQL query select quantity from inventory_tab where color = "blue" and type = "shirt", and send the query to a remote database.REMAP="BO--Body"A SRV_LANGUAGE event handler must process language data in the following steps:NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"Call MOREINFO="NONE"srv_langlen to retrieve the length of the language request buffer. Allocate a local application buffer as large as the length returned by MOREINFO="NONE"srv_langlen, plus 1 for the null termination byte. Call MOREINFO="NONE"srv_langcpy to copy all or part of the request data into the local buffer.Process the contents of the local buffer.ID="IN4289833"Messagestypes of in Open ServerRENDERAS="SECT1"MessagesREMAP="BO--Body"The term "message" is used in three ways in Open Server:MARK="BULL" REMAP="BU--Bullet"Clients and servers can use "datastream messages" to exchange information. Threads can use "thread messages" to exchange information.Open Server reports error conditions by means of "error messages".REMAP="BO--Body"For information on datastream messages, see   the LINKEND="X13599"Datastream Messages
 topics page.REMAP="BO--Body"For information on thread messages, see   the LINKEND="X61092"Multithread Programming
 topics page.REMAP="BO--Body"For information on error messages, see   the LINKEND="X24762"Errors
 topics page.ID="IN4299564"Upgrading See Migration from 2.0 to 10.0 
ID="IN42269475"Migration from 2.0 to 10.0ID="X16149" RENDERAS="SECT1"Migration from 2.0 to 10.0REMAP="BO--Body"2.0 Open Server applications require very few changes to run in a 10.0 Open Server environment. This topics page delineates those changes. REMAP="BO--Body"Making a 2.0 application run in a post-10.0 Open Server environment, however, will require more substantial changes. The MOREINFO="NONE"Preparing for Future Open Server Releases topics page discusses the necessary steps. It also describes minor changes in error messages.RENDERAS="SECT2"Changes to Source CodeREMAP="BO--Body"2.0 application code must add three new routine calls to run in a 10.0 environment. It may require additional changes if it calls certain routines that have now changed or directly manipulated formerly exposed internal control structures that are now hidden.RENDERAS="SECT3"ID="IN42269476"Migration from 2.0 to 10.0new routines required for
New RoutinesREMAP="BO--Body"An existing 2.0 application requires two additional calls in the initialization section of the code and one additional call in the server-termination portion. REMAP="BO--Body"All Open Server applications must begin with the new CS-Library call, MOREINFO="NONE"cs_ctx_alloc, followed immediately by the new Open Server call, MOREINFO="NONE"srv_version.REMAP="BO--Body"The MOREINFO="NONE"cs_ctx_alloc routine allocates a CS-Library CS_CONTEXT structure.This "context structure" has associated with it a CS_LOCALE structure, which contains application-wide information about the Open Server application's default localization information.REMAP="BO--Body"The MOREINFO="NONE"srv_version routine defines the version of Open Server in effect, as well as the context structure. REMAP="BO--Body"After invoking these routines, the application can then complete the initialization by calling MOREINFO="NONE"srv_init.REMAP="BO--Body"The application should deallocate the context structure just prior to server-termination; that is, just after the call to MOREINFO="NONE"srv_run. The new CS-Library routine, MOREINFO="NONE"cs_ctx_drop, deallocates the context structure.REMAP="BO--Body"The following code fragment illustrates the correct placement of the new calls:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CONTEXT    *cp;         /* Context structure.         */CS_CHAR       *servername; /* Open Server name.          */CS_BOOL       ok;          /* Error control flag.        */SRV_SERVER    *ssp;        /* Server control structure.  */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* Initialization. */ok = CS_TRUE;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"servername = "myserver";REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*** New calls start here.*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*** Allocate a CS-Library context structure to define the** default localization information.  Open Server will also** store global state information in this structure during** initialization.*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"if(cs_ctx_alloc(CS_VERSION_100, &cp) != CS_SUCCEED){      (CS_VOID)fprintf(stderr, "%s: cs_ctx_alloc failed",                           servername);          exit(1);}REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*** Default Open Server localization information can be** changed here before calling srv_version, using cs_config** and cs_locale.*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*** Set the Open Server version and context information.*/if(srv_version(cp, CS_VERSION_100) != CS_SUCCEED){     /*     ** Release the context structure already allocated.     */     (CS_VOID)cs_ctx_drop(cp);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     (CS_VOID)fprintf(stderr, "%s: srv_version failed",                  servername);     exit(1);}REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/***New calls end here.*//*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Initialize Open Server. */if(srv_init((SRV_CONFIG *)NULL, servername,CS_NULLTERM)== (SRV_SERVER *)NULL){     /*     ** Release the context structure already allocated     */     (CS_VOID)cs_ctx_drop(cp);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     (CS_VOID)fprintf(stderr, "%s: srv_init failed\n",                 servername);     exit(1);}REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*** Start the Open Server application running.*/if(srv_run((SRV_SERVER *)NULL) == CS_FAIL){     (CS_VOID)fprintf(stderr, "%s: srv_run failed\n",              servername);     ok = CS_FALSE;}REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*** Release all allocated control structures and exit.*/(CS_VOID)cs_ctx_drop(cp);exit(ok ? 0 : 1);}REMAP="BO--Body"For more information on context structures and properties, see the LINKEND="X61449"CS-Library
 and LINKEND="X41578"Tailoring Your Open Server
 topics pages, respectively. REMAP="BO--Body"For more information on the LINKEND="X94448"srv_version
 routine, see  its reference page.ID="IN42269477"Migration from 2.0 to 10.0changes to existing routinesRENDERAS="SECT3"Changes to Existing RoutinesREMAP="BO--Body"The MOREINFO="NONE"sp_regwatch routine now accepts four values for the options argument. They are:MARK="BULL" REMAP="BU--Bullet"CS_NOTIFY_ONCECS_NOTIFY_ALWAYSCS_NOTIFY_WAITCS_NOTIFY_NOWAITREMAP="BO--Body"The MOREINFO="NONE"srv_run routine now returns CS_SUCCEED or CS_FAIL, rather than SRV_STOP. ID="IN42269478"Migration from 2.0 to 10.0structure changesRENDERAS="SECT3"Hidden StructuresREMAP="BO--Body"Certain structures that were exposed in the srv.h header file are hidden or no longer in use in 10.0 Open Server. Any code that relies on direct manipulation of these structures must change. These structures are:MARK="BULL" REMAP="BU--Bullet"SRV_PROCSRV_SERVERSRV_CONFIGID="IN42269479"Migration from 2.0 to 10.0datatype changesRENDERAS="SECT3"Datatype ChangesREMAP="BO--Body"10.0 Open Server introduces a new set of datatypes: the CS-Library datatypes. These datatypes have names that begin with "CS_". They are described in detail on the MOREINFO="NONE"Types topics page.REMAP="BO--Body"Routines dating back to the 2.0 version of Open Server that have equivalent new 10.0 calls expect the existing datatypes, whose names begin with "SRV_". Routines introduced in 10.0 Open Server expect the new CS-Library datatypes. Eventually, Open Server routines will expect only CS-Library datatypes. The MOREINFO="NONE"Preparing for Future Open Server Releases topics page maps the old datatypes to the new.All native C datatypes have been replaced with CS-Library type definitions. This should not cause any problems in your existing application until a full ANSI compiler is used.ID="IN422694710"Migration from 2.0 to 10.0makefile changes required forRENDERAS="SECT2"Changes to MakefilesREMAP="BO--Body"Open Server 10.0 introduces Net-Library support, which provides multiple transport protocol support through a driver model. Consequently, Open Server applications must now link in separate libraries that provide network services to Open Server. Open Server applications also need to link in libintl.a, libcs.a, and libcomn.a. These two libraries provide internationalization and other services to Open Server. REMAP="BO--Body"The following is a sample 10.0 Open Server link line. See the Open Client/Server Supplement for you platform for specific link line information. REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"cc my_server.c -I$SYBASE/include -L$SYBASE/lib \ -lsrv -lcs -ltcl -linsck -lcomn -lintl \-lm -o my_serverREMAP="BO--Body"The "lsrv" argument links in Open Server, "lcs" links in CS-Library, "ltcl" links in Transport Control Library, and "linsck" links in the internet socket Net-Library driver. The "lcomn" argument links in an internal shared utility library. The "lintl" argument links in routines providing internationalization support. The "lm" argument links in the standard UNIX math libraries. ID="IN422693811"Migration from 2.0 to 10.0changes in error messagesRENDERAS="SECT2"Changes in Error MessagesREMAP="BO--Body"When an error occurs in certain 2.0 routines and macros, the error message may refer to a new routine in the 10.0 release. Each of these routines or macros internally calls a corresponding new routine. If an error occurs in calling the old routine or macro, Open Server will raise the new routine's error. The following table describes the correspondences between the 2.0 routines and macros, and the error message references:TOCENTRY="1"LBL="Table 2-19: "Routines and Macros and Corresponding Error Message ReferencesCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="140*"COLNAME="C2" COLWIDTH="183*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"2.0 Routine or MacroCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Error Message Refers To:VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_configCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_convertCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"cs_convertCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CURPROCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_describeCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_descfmt/srv_bindCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_errhandleCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_EVENTDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_thread_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_getuserdataCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_thread_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_GETVERSIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_GOT_ATTENTIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_thread_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_IODEADCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_thread_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MASK macrosCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_maskCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_paramdataCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_bind/srv_xferdataCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_paramlenCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_descfmtCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_parammaxlenCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_descfmtCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_paramnameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_descfmtCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_paramsetCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_bindCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_paramstatusCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_descfmtCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_paramtypeCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_descfmtCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_pfieldCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_thread_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_returnvalCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_descfmt/srv_bind/srv_xferdataCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_rpcparamsCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_numparamsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_sendmsgCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_sendinfoCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_sendrowCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_xferdataCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_setcoldataCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_bindCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_setcollenCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_bindCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_setifileCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_setuserdataCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_thread_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_sfieldCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_sigvecCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_signalCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_SITEPROCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_thread_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_VERSIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_thread_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TRACECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TRACEOFFCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TRACEONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_willconvertCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"cs_willconvertREMAP="BO--Body"In future releases, the new routine will replace the 2.0 routine altogether. For more details, see the LINKEND="X12698"Preparing for Future Open Server Releases
 topics page.RENDERAS="SECT2"Server Properties and Error MessagesREMAP="BO--Body"Just as certain 2.0 routines map to new 10.0 routines, 2.0 server configuration options, set via MOREINFO="NONE"srv_config, map to 10.0 server properties, set via MOREINFO="NONE"srv_props. If an error occurs in configuring the old option, Open Server will raise an error that makes reference to the corresponding new server property. The following table maps 2.0 configuration options to 10.0 server propertiesTOCENTRY="1"LBL="Table 2-20: "Mapping of Configuration Options to Server PropertiesCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="140*"COLNAME="C2" COLWIDTH="183*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"2.0 Configuration OptionCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"10.0 Server PropertyVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CONNECTIONSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMCONNECTIONSCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_LOGFILECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_LOGFILECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAXNETBUFCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NETBUFSIZECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MSGPOOLCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_MSGPOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MSGQUEUESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMMSGQUEUESCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MUTEXESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMMUTEXESCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_PREEMPTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_PREEMPTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_REMPREREADCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMREMBUFCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_REMSITESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMREMSITESCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_SRVPROCSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMTHREADSCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_STACKSIZECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_STACKSIZECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TIMESLICECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_TIMESLICECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_USEREVENTSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMUSEREVENTSCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_VIRTCLKRATECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_VIRCLKRATECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_VIRTTIMERCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_VIRTTIMERREMAP="BO--Body"In future releases, the 2.0 configuration properties will disappear along with the MOREINFO="NONE"srv_config routine. For more information on server properties, see  the LINKEND="X41578"Tailoring Your Open Server
ID="IN422692912"Migration from 2.0 to 10.0
ID="IN4226911013"Migration from 2.0 to 10.0changes in error messages
 topics page.ID="IN4210911014"CS-Libraryhandling CS-Library errorsRENDERAS="SECT2"Error HandlingREMAP="BO--Body"An Open Server application should install a message callback routine with the MOREINFO="NONE"cs_config routine to report CS-Library errors. A standard Open Server error handler installed with MOREINFO="NONE"srv_props will not catch CS-Library errors, such as data conversion errors generated in a call to MOREINFO="NONE"cs_convert.REMAP="BO--Body"For details on handling CS-Library errors and for more general information about CS-Library, see Chapters 1 and 2 of the Open Client and Open Server Common Libraries Reference Manual.ID="IN427881315"ThreadsSee alsoMultithread programming
ID="IN4223871416"Multithread programmingID="X61092" RENDERAS="SECT1"Multithread ProgrammingREMAP="BO--Body"Open Server has a multithreaded architecture. A multithreaded server is a collection of threads, each executing routines to accomplish its specific task. ID="IN4223871417"Multithread programmingdefinition of threadRENDERAS="SECT2"What Is a Thread?REMAP="BO--Body"A thread can be thought of as a particular path of execution through the Open Server application code. Each client has a thread to manage its connection and execute the event handlers and procedures that fulfill its requests. The Open Server run-time system has several threads that manage server activities such as delivering messages, handling server-to-server communications, and scheduling tasks in the server. An application can spawn server threads for other application-specific activities.REMAP="BO--Body"As a multithreaded system, an Open Server application must schedule the variety of activities the threads perform, negotiate the threads' access to shared resources, and provide a means by which the threads communicate with each other. For more information, see LINKEND="X66047""Scheduling" 
, and LINKEND="X62958""Tools and Techniques" 
.ID="IN4223861518"Multithread programmingtypes of threadsRENDERAS="SECT2"Thread Types   REMAP="BO--Body"Open Server has three kinds of threads: event-driven, service, and site-handler. RENDERAS="SECT3"Event-Driven Threads   REMAP="BO--Body"Threads that control client connections are event-driven. A request for action triggers a server event. See  the LINKEND="X78566"Events
 topics page, for details on events. REMAP="BO--Body"When a client event occurs, Open Server places the event in the thread's event queue. The next time the thread executes, it reads the next event request from the event queue. Open Server calls the event handler associated with this event. When the handler returns, the thread attempts to read the next event on the queue. If there is no event, the thread sleeps.REMAP="BO--Body"For example, when a client application attempts to log into the server, Open Server creates a thread to handle the connection and puts the SRV_CONNECT event on the threads queue. When the thread runs, it executes the routine installed to handle the SRV_CONNECT event. The default handler simply accepts the connection. You could install a custom SRV_CONNECT handler that checks the login name
 and password, and, if both are valid, allows the user to log in. REMAP="BO--Body"Event-driven threads exist primarily to handle client requests, but can also be used with programmer-defined events to execute service routines within the server.RENDERAS="SECT3"Service Threads   REMAP="BO--Body"You can create Open Server threads that run independently from any client connection. They are called service threads because the routines they execute usually perform services for event-driven client threads. Unlike a client thread, a service thread is not activated by events. Instead, you supply a routine for the thread to execute when you create it. The server puts it on the run queue immediately. A service thread disappears when the routine it was created to execute returns. REMAP="BO--Body"An application can use service threads to accomplish a variety of tasks in an Open Server application. In fact, the Open Server run-time system is composed of service threads running server management routines. Service threads cannot be used to perform client I/O-that is, to read in client commands and return results.REMAP="BO--Body"Open Server schedules event code to run when an event is triggered. By contrast, an application must explicitly schedule service thread code using the MOREINFO="NONE"srv_wakeup, MOREINFO="NONE"srv_sleep, MOREINFO="NONE"srv_yield routines, and must schedule message queues when not running in preemptive mode.RENDERAS="SECT3"Site-Handler ThreadsREMAP="BO--Body"Open Server has a third type of thread, known as a site-handler thread. Open Server creates a site-handler thread when a SQL Server connects to an Open Server application.REMAP="BO--Body"Open Server creates a SUB-PROC when the Open Server application receives a server-to-server RPC. A SUB-PROC disappears when the server-to-server RPC completes. A site-handler thread disappears when the SQL Server closes its connection to the Open Server application. REMAP="BO--Body"An Open Server application only accesses a site-handler thread inside its SRV_CONNECT or SRV_DISCONNECT event handler. Site-handler threads are otherwise purely internal.ID="IN4223851619"Multithread programmingtypes of threads
ID="IN4218841720"Scheduling threads
ID="IN4223831821"Multithread programmingthread schedulingID="X66047" RENDERAS="SECT2"SchedulingREMAP="BO--Body"Open Server provides concurrency by periodically suspending the running thread and resuming another. This context switch can occur frequently and quickly so that, from the point of view of an Open Server client, threads run continuously. REMAP="BO--Body"The scheduler is the run-time system thread that performs context switches. A thread has an execution context that includes its stack and machine register environment. The scheduler saves the execution context of the running thread, selects the thread to resume, restores its context, and runs it. Although the scheduler works invisibly, to write Open Server code you should understand: MARK="BULL" REMAP="BU--Bullet"How the scheduler is called (the scheduling method), and How the scheduler selects a thread to resume. RENDERAS="SECT3"Scheduling Methods   ID="IN4221831822"Preemptive schedulingdefinition of
ID="IN4225831823"Non-preemptive schedulingdefinition ofREMAP="BO--Body"The scheduling method determines when control is transferred from one running thread to another. An Open Server application uses one of two scheduling methods: non-preemptive or ID="IN4220812024"Coroutine schedulingSee Non-preemptive scheduling
preemptive. Non-preemptive is the default method, and the only method available on most platforms. REMAP="BO--Body"With non-preemptive scheduling, context switches are predictable. They can occur only when one of the following events occurs: MARK="BULL" REMAP="BU--Bullet"A thread calls a Server-Library or Client-Library routine that performs network I/O. REMAP="UN--Under"When a thread reads from or writes to a network connection, the run-time system suspends execution of the given thread. Network I/O is relatively slow, and the server can use the time more efficiently by allowing other threads to run while the I/O completes. A thread sleeps while waiting for something to happen. REMAP="UN--Under"For example, a thread should wait for another thread to finish updating a data object in shared memory before accessing the object.   A thread can sleep either by calling MOREINFO="NONE"srv_sleep directly, or by calling one of the Server-Library routines that sleeps while waiting for something to happen, such as MOREINFO="NONE"srv_getmsgq non-preemptive orMOREINFO="NONE" srv_lockmutex.A thread calls MOREINFO="NONE"srv_yield to intentionally suspend itself and allow other threads to run. The thread remains runnable and resumes execution later at the statement after the MOREINFO="NONE"srv_yield call. MARK="DASH" REMAP="BS--BulletSub"If you write a time-consuming routine that does not perform network I/O or sleep, you should call MOREINFO="NONE"srv_yield occasionally to prevent the routine from monopolizing the server. REMAP="BO--Body"With preemptive scheduling, a context switch can occur when any of the above events occurs, and also when the system interrupts the running thread. Preemptive scheduling depends upon the thread management facilities of the operating system, so system-initiated context switches are not predictable. Operating systems often employ sophisticated algorithms that ensure that execution time is distributed among threads optimally. REMAP="BO--Body"An application chooses preemptive scheduling using the MOREINFO="NONE"srv_props routine with property set to SRV_S_PREEMPT. Preemptive scheduling is not available on every platform. Call MOREINFO="NONE"srv_capability to determine whether it is available on your application's platform.RENDERAS="SECT3"Selecting a Thread to Resume   REMAP="BO--Body"Open Server maintains a set of run queues-lists of threads that are suspended but not sleeping. Each queue contains threads with the same execution priority. The scheduler restores the thread that has remained the longest on the highest priority queue. Threads normally run at the same priority level, so this selection method distributes execution time first-in, first-out. REMAP="BO--Body"You can adjust the priority of a thread so that the scheduler runs it before other threads on the run queue, or only when there are no other threads to run. For example, a thread that reads real-time data could have a higher priority so that it runs whenever there is data to process. Be careful when adjusting priorities, however. As long as a thread has a higher priority than any other and is able to run, the scheduler will continue to run it. If the priority stays high and the thread never sleeps, threads with lower priorities can MOREINFO="NONE""starve." They will never have a chance to run. See the LINKEND="X23761"srv_setpri
 reference page, for information on adjusting a thread's priority.ID="IN4223802125"Multithread programmingthread schedulingREMAP="BO--Body"Execution priority is only an issue in Open Server applications that run in non-preemptive mode.ID="IN4218792226"Scheduling threads
ID="IN4223782327"Multithread programmingtools and techniques forID="X62958" RENDERAS="SECT2"Tools and TechniquesREMAP="BO--Body"Writing programs in a multithread environment requires constant attention to the interaction between threads. There are programming tools and methods that are especially useful in this environment. Open Server provides mutual exclusion semaphores (mutexes) to control access to shared resources, and message queues to allow threads to coordinate and communicate with one another. ID="IN427782328"Mutexesdefinition ofRENDERAS="SECT3"MutexesID="IN4223782329"Multithread programmingMultithread programmingand mutexesmutexesREMAP="BO--Body"A mutual exclusion semaphore, or mutex
, is a logical object that Open Server allows one thread, at most, to lock. It is useful for protecting shared resources and for building more sophisticated tools. REMAP="BO--Body"To understand how a mutex can be used, consider the following problem: REMAP="BO--Body"The standard input and output is the same for every thread in an Open Server application running on a UNIX platform. If threads regularly write to the standard output, the application code needs to take steps to avoid mixing the output of several threads on the standard output. REMAP="BO--Body"One way to prevent threads from mixing their output is to associate a mutex with the stdout device and require a thread to lock the mutex before writing to stdout. Since only one thread can lock the mutex at a time, only one thread can write on stdout at a time. Other threads have to wait (sleep) until they are able to lock the mutex. REMAP="BO--Body"See the LINKEND="X69149"srv_createmutex
, LINKEND="X55165"srv_lockmutex
, LINKEND="X37215"srv_unlockmutex
 and LINKEND="X30072"srv_deletemutex
 reference pages  for programming details.ID="IN4214782330"Message queuesdefinition ofRENDERAS="SECT3"Message QueuesID="IN4223782331"Multithread programmingMultithread programmingand message queuesmessage queuesREMAP="BO--Body"Messages queues enable threads to communicate with each other. Message queues are often used to send data to spawned service threads that perform services for other threads. For example, you could create a message queue into which all threads put data destined for the log file. A spawned thread could read the messages from the queue and write them, in the order received, to the log file. REMAP="BO--Body"The message in a message queue is a four-byte value, usually a pointer that addresses data somewhere in memory shared by the sending and receiving thread. The thread that puts a message into a queue and the threads that read the message must agree on the message format. REMAP="BO--Body"If the message references data elsewhere, you must make sure that the thread that reads the message finishes with the data before the thread that sent the message updates or releases the data area. To prevent the sending routine from overwriting or freeing the message before it is received, the routine that writes messages, MOREINFO="NONE"srv_putmsgq, has an option that causes the sending thread to sleep until the message is read from the queue. REMAP="BO--Body"See the LINKEND="X63435"srv_createmsgq
, LINKEND="X32227"srv_putmsgq
, LINKEND="X70696"srv_getmsgq
, and LINKEND="X72703"srv_deletemsgq
 reference pages  for programming details.RENDERAS="SECT3"Protecting Critical Sections   REMAP="BO--Body"ID="IN4223762532"Multithread programmingMultithread programmingand srv_setpri srv_setpri
To prevent the Open Server from suspending a thread, you can temporarily raise the priority of the thread by calling ID="IN4210742733"srv_setpriin multithread programming
MOREINFO="NONE"srv_setpri. Server threads all start at the same priority level, which is represented by the SRV_C_DEFAULTPRI constant defined in ospublic.h. Thread priorities range from SRV_C_LOWPRIORITY to SRV_C_MAXPRIORITY with SRV_C_DEFAULTPRI in the middle.REMAP="BO--Body"Open Server always resumes the runnable thread that has the highest priority. If more than one runnable thread has the same priority, Open Server chooses the one that became runnable first. If you raise the priority of a thread above that of any other thread, Open Server will continue to execute the thread until it is no longer runnable or its priority is lowered. This prevents other threads from executing. REMAP="BO--Body"While raising the priority of a thread is an effective way to guarantee that no other thread can interfere during a critical section, it can have a detrimental effect on concurrency. Raising the priority permits a single thread to take over the server. Even the threads that make up the Open Server run-time system are prevented from running if you raise the priority of a thread above SRV_C_DEFAULTPRI. To minimize the effects, delay raising the priority until absolutely necessary, and lower it again as soon as possible. Don't put unnecessary code inside the critical section. ID="IN4216742734"Callback handlerinstalling for a threadRENDERAS="SECT3"Callback RoutinesID="IN4223732835"Multithread programmingMultithread programmingand callback handlerscallback handlers
 REMAP="BO--Body"The ID="IN4212703136"srv_callbackin multithread programming
MOREINFO="NONE"srv_callback routine allows you to install a callback handler for a thread. Open Server calls your routine whenever the state of the thread changes to the state you specify. For example, you can install a SRV_C_SUSPEND callback handler that executes whenever the thread is suspended. The ability to install and execute callback handlers is platform-dependent. Use MOREINFO="NONE"srv_capability to find out if a callback handler can be installed for a particular state transition on the current platform. REMAP="BO--Body"The following table summarizes the state transitions for which MOREINFO="NONE"srv_callback can install callback handlers: TOCENTRY="1"LBL="Table 2-21: "State TransitionsCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="104*"COLNAME="C2" COLWIDTH="364*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"State TransitionCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_EXITCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The thread has finished executing the routine it was spawned to execute, or it is 
associated with a disconnected client. The handler executes in the context of the 
exiting thread. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_PROCEXECCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server calls this callback when a registered procedure is about to execute. 
The handler executes in the context of the thread that requested the registered 
procedure. As a result, the SRV_C_PROCEXEC callback handler executes 
whenever a client attempts any registered procedure operation. You can install a 
callback handler that restricts clients' abilities to create, delete, or execute 
registered procedures. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_RESUMECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The thread is resuming. The handler executes in the context of the scheduler 
thread and uses the scheduler's stack. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_SUSPENDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The thread is suspending. The handler executes in the context of the thread that is 
suspending and uses its stack. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_TIMESLICECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A thread has executed for a period of time (time slice) determined by the 
SRV_TIMESLICE, SRV_VIRTCLKRATE and SRV_VIRTTIMER configuration 
parameters. You can use this handler to signal a long-running thread to call 
MOREINFO="NONE"srv_yield so that other threads can run. 
ID="IN4223693237"Multithread programmingspecial programming considerationsRENDERAS="SECT2"Programming Considerations   REMAP="BO--Body"Although Open Server threads are threads of execution having their own stack and register environments, they do share the resources of the operating system process that is executing the Open Server run-time system. REMAP="BO--Body"Here are some multithread programming considerations: MARK="BULL" REMAP="BU--Bullet"Shared resources must be protected. This includes global data, file handles, and devices. REMAP="UN--Under"While you are updating a shared global data item, do not call a routine that could suspend the thread unless you have taken steps to prevent other threads from accessing the data. Otherwise, another thread could be working with inconsistent data. REMAP="UN--Under"Watch for program logic that assumes it has sole access to a resource. An example is a routine that performs part of a calculation using a value from a global variable, then suspends, allowing other threads to alter the global variable. This can cause serial consistency problems. The calculation may be incorrect before it is even complete. Avoid static variables in routines that more than one thread can execute. REMAP="UN--Under"If a routine alters a static variable, and multiple threads can call the routine, you must ensure that multiple instances of the routine do not conflict. There is a greater probability of inconsistent data if the routine returns a pointer to a static variable, since the contents of the variable can be altered while a thread is suspended. It is safer to use automatic variables, because each thread has a stack of its own. The application should provide memory and copy the result there. When you must use static variables, protect them with the techniques discussed above.SRV_ATTENTION events can be executed at interrupt level. If SRV_ATTENTION handlers manipulate application structures that are also changed or tested in non-interrupt level code, such as other event handlers or service threads, the results of the change or test are unpredictable. It is best to use attention-level wakeups and sleeps to coordinate between interrupt-level SRV_ATTENTION handlers and non-interrupt level code.ID="IN4223683338"Multithread programmingspecial programming considerations
 RENDERAS="SECT2"ExampleREMAP="BO--Body"The on-line sample, multthrd.c, illustrates various aspects of multithreaded programming.ID="IN4223673439"Multithread programming
 ID="IN4219663540"Negotiated behaviorID="X18461" RENDERAS="SECT1"Negotiated BehaviorREMAP="BO--Body"An Open Server application negotiates with a client to determine the application's behavior in a number of areas. Some negotiation takes place when the client logs in. Other negotiations can occur on an ad hoc basis during the lifetime of the Open Server run-time system.ID="IN4224643741"Negotiations with clientin the SRV_CONNECT event handlerRENDERAS="SECT2"Login NegotiationsREMAP="BO--Body"Several issues are negotiated at login time. Some are negotiated transparently by Open Server and require no action on the part of the Open Server application. Others are handled explicitly with application calls. Login negotiations always take place inside a SRV_CONNECT event handler.RENDERAS="SECT3"Transparent NegotiationREMAP="BO--Body"Issues resolved that are transparent to the application include the following: MARK="BULL" REMAP="BU--Bullet"The character set in which character data will appear. When a client logs in, it provides, among other information, its desired character set. If the server's character set differs from the client's, Open Server converts the data to the client's character set.The national language in which Open Server error messages will appear.Byte ordering. This is platform-dependent.The TDS protocol level.Floating point representation. This is platform-dependent.REMAP="BO--Body"The server's default national language and character set are established during initialization of the server.REMAP="BO--Body"A client can renegotiate the character set and national language at a later time. See LINKEND="X61268""Ad Hoc Negotiations"
 below, for more information.RENDERAS="SECT3"Explicit NegotiationREMAP="BO--Body"The application itself negotiates with clients to resolve the following issues:MARK="BULL" REMAP="BU--Bullet"The kinds of requests the client can make and the kinds of responses the Open Server application can return, if the application does not want the defaults.The security level at which the client and server will communicate.REMAP="BO--Body"A client sends capabilities information after sending a login record. A client and the Open Server application must agree upon the set of possible requests and responses that can be sent on their particular connection. This must be established before any further requests or responses are sent. See the LINKEND="X89653"Capabilities
 topics page, for details on capabilities.ID="IN4215643742"Security levelsnegotiation of
ID="IN4217643743"Secure connectionnegotiating with a client to establishRENDERAS="SECT3"Negotiating a Secure ConnectionREMAP="BO--Body"An Open Server application may want to establish a secure connection with a client. A secure connection is one which is established after a rigorous authentication of the client's identity and verification of its password. An application may perform this check using one, some, or all of the following methods:MARK="BULL" REMAP="BU--Bullet"Send the client a challenge, which challenges the client to respond with the matching response.Send the client an "encryption key." The client should respond with an encrypted password, which the application may then decrypt and verify.Send the client a request for security labels, which the client sends to establish the level of security for the connection. Initiate an application-defined login handshake.REMAP="BO--Body"An application negotiates a secure login using the MOREINFO="NONE"srv_negotiate routine inside the SRV_CONNECT event handler.ID="IN4224643744"Negotiations with clientvia options commands or language commandsID="X61268" RENDERAS="SECT2"Ad Hoc NegotiationsREMAP="BO--Body"An application may negotiate or renegotiate several issues with a client at any point during the time the server is up and running. Ad hoc negotiations take place inside a SRV_LANGUAGE event handler or a SRV_OPTION event handler. A client may want to:MARK="BULL" REMAP="BU--Bullet"Renegotiate the character set and national language. A client does this via either a Transact-SQL language command or an option command. Determine aspects of query processing behavior. A client does this via a Transact-SQL language command or an option command. Clients can request that options be set or cleared, as well as requesting the current status of a particular option.REMAP="BO--Body"For a discussion of the SRV_OPTION event and a list of options, see the LINKEND="X46017"Options
 topics page. REMAP="BO--Body"TheMOREINFO="NONE" International Support topics page covers negotiation of national language and character set in detail.REMAP="BO--Body"For more information on identifying and authenticating users in a secure database system, see the SYBASE SQL Server Reference ManualID="IN4219633845"Negotiated behavior
.RENDERAS="SECT2"ExampleREMAP="BO--Body"The online sample ctosdemo.c includes code illustrating a negotiated login.ID="IN427623946"OptionsID="X46017" RENDERAS="SECT1"OptionsREMAP="BO--Body"SQL Server permits clients to decide how it should handle query processing. It provides a variety of settable options that govern aspects of query processing behavior. For more information on SQL Server query-processing options, see theMOREINFO="NONE" set command in the SYBASE SQL Server Reference Manual.REMAP="BO--Body"10.0 Open Server allows an Open Server application to respond to client requests about query processing options. REMAP="BO--Body"A client application can set, clear, and request the current value of SQL Server query-processing options in one of two ways:MARK="BULL" REMAP="BU--Bullet"Through a Transact-SQL language commandBy issuing an option commandREMAP="BO--Body"If an application expects a client to issue language commands to make option requests that the application needs to process, it must include code to parse such requests in its SRV_LANGUAGE event handler. REMAP="BO--Body"Client option commands trigger a SRV_OPTION event. An application responds to such requests inside its SRV_OPTION event handler, using the MOREINFO="NONE"srv_options command.ID="IN427614047"Optionssetting and retrievingRENDERAS="SECT2"Inside the SRV_OPTION Event HandlerREMAP="BO--Body"A client can request that an option be set or cleared, or that its current value be returned. Any of these commands triggers a SRV_OPTION event. Inside the SRV_OPTION event handler, the application should:NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"Call MOREINFO="NONE"srv_options with the cmd argument set to CS_GET. The type of command the client issued (SRV_SETOPTION, SRV_CLEAROPTION, or SRV_GETOPTION) will be returned in optcmdp. The option itself will be returned in optionp. *bufp will contain all legal values associated with the option. REMAP="UN--Under"For example, if the client has requested that SQL Server not report the number of rows affected by the query, optcmdp will contain SRV_SETOPTION, *optionp will contain CS_OPT_NOCOUNT, and *bufp will contain CS_TRUE.If optcmdp is either SRV_SETOPTION or SRV_CLEAROPTION, the application should clear or set the option accordingly, if this is a standalone Open Server application. If this is a gateway application, it should send the appropriate client calls to manipulate the remote server's option.If optcmdp is SRV_GETOPTION, the application should call MOREINFO="NONE"srv_options with cmd set to CS_SET, optcmd set to SRV_SENDOPTION, optionp set to the option the client seeks the value of, and bufp containing the current value.ID="IN427604148"Optionssetting and retrieving
ID="IN427594249"Optionsdefault values for
ID="IN427584350"Optionsdescription ofRENDERAS="SECT2"Option Descriptions and Default ValuesREMAP="BO--Body"The following table describes the options a client may set, retrieve, or clear, and each option's default value.TOCENTRY="1"LBL="Table 2-22: "Symbolic Constants for Server OptionsCOLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="152*"COLNAME="C2" COLWIDTH="213*"COLNAME="C3" COLWIDTH="102*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Symbolic Constant:COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"What the Option Does:COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Default Value:VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_ANSINULLCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If this option is set to CS_TRUE, SQL Server 
enforces the ANSI behavior that "=NULL" 
and "is NULL" are not equivalent. In 
standard Transact SQL, "=NULL" and "is 
NULL" are treated as equivalent.This option affects "<> NULL" and "is not 
NULL" behavior in a similar fashion.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_ANSIPERMCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If this option is set to CS_TRUE, SQL Server 
will be ANSI compliant in its permission 
checks on UPDATE and DELETE statements.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_ARITHABORTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If this option is set to CS_TRUE, SQL Server 
aborts a query when an arithmetic exception 
occurs during its execution.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_ARITHIGNORECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If this option is set, SQL Server substitutes 
NULL for selected or updated values when 
an arithmetic exception occurs during query 
execution. SQL Server will not return a 
warning message. If neither 
CS_OPT_ARITHABORT nor 
CS_OPT_ARITHIGNORE is set, SQL Server 
will substitute NULL and print a warning 
message after the query has been executed.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_AUTHOFFCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Turns the specified authorization level off for 
the current server session. When a user logs 
in, all authorizations granted to that user are 
automatically turned on. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Not applicable.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_AUTHONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Turns the specified authorization level on for 
the current server session. When a user logs 
in, all authorizations granted to that user are 
automatically turned on.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Not applicable.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_CHAINXACTSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If this option is set to CS_TRUE, SQL Server 
uses chained transaction behavior.Chained transaction behavior means that 
each server command is considered to be a 
distinct transaction.Unchained transaction behavior requires an 
explicit MOREINFO="NONE"commit transaction statement to define 
a transaction.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSE, 
meaning unchained 
transaction 
behavior.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_CURCLOSEONXACTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If this option is set to CS_TRUE, all cursors 
opened within a transaction space are closed 
when the transaction completes.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_CURRREADCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Sets a security label specifying the current 
read level.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NULLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_CURWRITECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Sets a security label specifying the current 
write level.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NULLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_DATEFIRSTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"This option sets the day considered to be the 
"first" day of the week.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"For us_english, the 
default is 
CS_OPT_SUNDAY.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_DATEFORMATCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"This option sets the order of the date parts 
month/day/year for entering datetime or 
smalldatetime data. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"For us_english, the 
default is 
CS_OPT_FMTMDY.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_FIPSFLAGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If this option is set to CS_TRUE, SQL Server 
flags any non-standard SQL commands that 
are sent. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_FORCEPLANCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If this option is set to CS_TRUE, SQL Server 
joins tables in the order in which the tables 
are listed in the "from" clause of the query.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_FORMATONLYCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If this option is set to CS_TRUE, SQL Server 
will send back a description of the data rather 
than the data itself, in response to a MOREINFO="NONE"select 
query.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_GETDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If this option is set to CS_TRUE, then SQL 
Server returns information on every MOREINFO="NONE"insert, 
MOREINFO="NONE"delete, or MOREINFO="NONE"update. SQL Server returns this 
information in the form of a message result 
set and parameters that an application can 
use to construct the name of the temporary 
table that will contain the rows that will be 
inserted and/or deleted. An update consists 
of insertions and deletions.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_IDENTITYOFFCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Disables inserts into a table`s identity column. 
For more information, see the MOREINFO="NONE"set command in 
your SQL Server documentation.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Not applicableCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_IDENTITYONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Enables inserts into a table`s identity column. 
For more information, see the MOREINFO="NONE"set command in 
your SQL Server documentation.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Not applicableCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_ISOLATIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"This option is used to specify a transaction 
isolation level. Legal levels are 
CS_OPT_LEVEL1 and CS_OPT_LEVEL3. 
Setting CS_OPT_ISOLATION to 
CS_OPT_LEVEL3 causes all pages of tables 
specified in a MOREINFO="NONE"select query inside a transaction 
to be locked for the duration of the 
transaction.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_LEVEL1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_NOCOUNTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"This option causes SQL Server to stop 
sending back information about the number 
of rows affected by each SQL statement.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_NOEXECCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If this option is set to CS_TRUE, SQL Server 
processes queries through the compile step 
but does not execute them. This option is 
used with CS_OPT_SHOWPLAN.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_PARSEONLYCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If this option is set, the server checks the 
syntax of queries, returning error messages as 
necessary, but does not execute the queries.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_QUOTED_IDENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If this option is set to CS_TRUE, SQL Server 
treats all strings enclosed in double quotes as 
identifiers.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_RESTREESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If this option is set, SQL Server checks the 
syntax of queries but does not execute them, 
returning parse resolution trees (in the form 
of image columns in a regular row result set) 
and error messages as needed, to the client.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_ROWCOUNTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If this option is set, SQL Server will return 
only a maximum specified number of regular 
rows for MOREINFO="NONE"select statements. This option does 
not limit the number of compute rows 
returned. CS_OPT_ROWCOUNT works somewhat 
differently from most options. It is always set 
on, never off. Setting CS_OPT_ROWCOUNT 
to 0 sets it back to the default, which is to 
return all the rows generated by a MOREINFO="NONE"select 
statement. Therefore, the way to turn 
CS_OPT_ROWCOUNT off is to set it on with 
a count of 0.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0, meaning all rows 
are returnedCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_SHOWPLANCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If this option is set to CS_TRUE, SQL Server 
will generate a description of its processing 
plan after compilation and continue 
executing the query.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_STATS_IOCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"This option determines whether SQL Server 
internal I/O statistics are returned to the 
client after each query. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_STATS_TIMECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"This option determines whether SQL Server 
parsing, compilation, and execution time 
statistics are returned to the client after each 
query.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_STR_RTRUNCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If this option is set to CS_TRUE, SQL Server 
will be ANSI compliant with regard to right 
truncation of character data.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_TEXTSIZECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"This option changes the value of the SQL 
Server global variable @@textsize, which 
limits the size of text or image values that 
SQL Server returns. When setting this option, 
you supply a parameter which is the length, 
in bytes, of the longest text or image value 
that SQL Server should return. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"32,768 bytesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_TRUNCIGNORECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If this option is set to CS_TRUE, SQL Server 
ignores truncation errors. This is standard 
ANSI behavior.If this option is set to CS_FALSE, SQL Server 
raises an error when conversion results in 
truncation.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSEREMAP="BO--Body"The MOREINFO="NONE"srv_options reference page in Chapter 3 lists the legal values and datatype for each option.ID="IN427574451"Optionsdescription of
ID="IN427564552"Optionsdefault values forRENDERAS="SECT2"ExampleREMAP="BO--Body"The on-line sample, ctosdemo.c, includes code for processing client option commands.ID="IN427554653"OptionsREMAP="BO--Body"ID="X16584" RENDERAS="SECT1"Pass-Through ModeREMAP="BO--Body"An Open Server application that is acting as a gateway between an Open Client application and a SQL Server can pass TDS packets between the client and the server without examining their contents. An Open Server that is handling TDS packets in this way is said to be in pass-through mode.REMAP="BO--Body"Because the Open Server gateway application does not have to unpack the TDS information as it arrives from the client and repack it before sending it to the SQL Server, pass-through mode is very efficient.REMAP="BO--Body"Client-Library, DB-Library, and Server-Library provide routines to support pass-through mode.ID="IN42179654"Pass-through modenegotiating the TDS level inRENDERAS="SECT2"RENDERAS="SECT3"Negotiating the TDS Protocol Level in Pass-Through ModeREMAP="BO--Body"When SYBASE clients and servers connect, they first agree upon the TDS protocol level they will use, usually the latest version of the protocol that both programs recognize. See the LINKEND="X18461"Negotiated Behavior
topics page, for more information on initial protocol negotiation. REMAP="BO--Body"When an Open Server gateway application uses TDS pass through, the TDS packets are created and interpreted by the remote SYBASE client and SQL Server-not by the gateway. Therefore, the TDS negotiation occurs between the two remote programs. The gateway must facilitate this negotiation by relaying responses between the two parties. The TDS negotiation process must occur inside a SRV_CONNECT event handler and involves the following steps: NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"MOREINFO="NONE"srv_getloginfo - Allocate a CS_LOGINFO structure and fill it with login information from the client thread. MOREINFO="NONE"ct_setloginfo - Prepare a CS_LOGINFO structure with the login information retrieved in step 1, then log into the remote server with ct_connect. MOREINFO="NONE"ct_getloginfo - Transfer login response information from a CS_CONNECTION structure to the newly-allocated CS_LOGINFO structure. MOREINFO="NONE"srv_setloginfo - Send the remote server's response, retrieved in step 3, to the client, then release the CS_LOGINFO structure. ID="IN42179655"Pass-through moderoutines used inRENDERAS="SECT3"Using TDS Pass-Through Mode   REMAP="BO--Body"TDS pass through takes place inside any event handler, except SRV_ATTENTION, SRV_CONNECT, SRV_DISCONNECT, SRV_START, or SRV_STOP.REMAP="BO--Body" Client requests arrive in a stream of one or more TDS packets. The handler repeatedly calls MOREINFO="NONE"srv_recvpassthru as long as the info argument remains set to SRV_I_PASSTHRU_MORE. As each packet is received, the handler calls MOREINFO="NONE"ct_sendpassthru to pass the packet on to the remote SQL Server or Open Server. The remote server receives exactly the same TDS stream it would receive from a directly connected client.The latest version of TDS introduces multiple commands in a single batch. Only the first command will trigger an event handler. Open Server will not call event handlers for the remaining commands.REMAP="BO--Body"Returning results to a client in TDS pass-through mode is just the opposite of sending language requests and remote procedure calls
. REMAP="BO--Body"A Client-Library routine, MOREINFO="NONE"ct_recvpassthru, receives the TDS packets as they arrive at the connection. The MOREINFO="NONE"srv_sendpassthru Server-Library routine sends the packet on to the client.MOREINFO="NONE" ct_recvpassthru retrieves another TDS packet as long as it returns CS_PASSTHRU_MORE. REMAP="BO--Body"DB-Library also provides pass-through mode calls. See the Open Client DB-Library/C Reference Manual for details.RENDERAS="SECT2"ExampleREMAP="BO--Body"The on-line sample, fullpass.cID="IN42179566"Pass-through mode
, illustrates a pass-through mode gateway.ID="IN42419477"Preparing for future Open Server releasesID="X12698" RENDERAS="SECT1"Preparing for Future Open Server ReleasesREMAP="BO--Body"2.0 Open Server applications require very few changes to run in a 10.0 Open Server environment. The MOREINFO="NONE"Migration from 2.0 to 10.0 topics page delineates those changes. REMAP="BO--Body"Making a 2.0 application run in a post-10.0 Open Server environment, however, will require more substantial changes. Specifically, future applications will require new type definitions and datatypes, and a subset of 2.0 routines will become obsolete. All macros will become obsolete as well. These new type definitions and datatypes, as well as replacement routines for the macros and routines going away, are introduced in this release. REMAP="BO--Body"You can either make these changes now, while readying your existing application for the 10.0 environment, or delay the re-coding until the next major release.REMAP="BO--Body"The MOREINFO="NONE"Types topics page provides a detailed description of each new type definition and datatype.ID="IN42129388"Header filesfuture changes inRENDERAS="SECT2"Header File ChangesREMAP="BO--Body"10.0 Open Server introduces three new header files: ospublic.h, oserror.h, and oscompat.h. The following table describes each file, and lists the 2.0-level header file each replaces:TOCENTRY="1"LBL="Table 2-23: " ID="X61933"Description of 10.0 Header FilesCOLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="114*"COLNAME="C2" COLWIDTH="105*"COLNAME="C3" COLWIDTH="104*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Header File NameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ContentsCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Header File It 
ReplacesVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ospublic.hCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Public Open Server 
structures, type 
definitions, defines, 
and function 
prototypesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv.hCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"oserror.hCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Error message 
numbers and textCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srverror.hCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"oscompat.hCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Mappings of old 
type definitions to 
new, old datatypes 
to new, and old 
routines to new, old 
constants to new; 
and old function 
prototypes to newCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"N/AREMAP="BO--Body"Existing Open Server applications need not include the new files in order to run in a 10.0 environment, as Open Server includes the new files automatically. In future Open Server releases, however, applications must specifically include ospublic.h and oserror.h. REMAP="BO--Body"Moreover, all type definitions, datatypes, routines, constants, and prototypes mappings included in oscompat.h will be removed before the next major release, so applications must explicitly code in the new ones. The contents of oscompat.h are summarized in more detail in the three sections that immediately follow. Applications should not explicitly include oscompat.h, as it is included in ID="IN42129299"Header filesfuture changes in
ospublic.h.ID="IN421692910"Type definitionsnew in 10.0
ID="IN4216911011"Type definitionsfuture changes inRENDERAS="SECT2"New Type DefinitionsREMAP="BO--Body"The following table lists each new type definition and the old type definition it replaces:TOCENTRY="1"LBL="Table 2-24: "Updated Type DefinitionsCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="140*"COLNAME="C2" COLWIDTH="129*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"New Type DefinitionCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Old Type DefinitionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TINYINTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DBTINYINTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SMALLINTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DBSMALLINTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_INTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DBINTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CHARCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DBCHARCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_BINARYCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DBBINARYCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_BITCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DBBITCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATETIMECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DBDATETIMECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATETIME4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DBDATETIME4COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_MONEYCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DBMONEYCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_MONEY4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DBMONEY4COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FLOATCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DBFLT8COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REALCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DBREALCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_BYTECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"BYTECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_BOOLCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DBBOOL, BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"unsigned short.COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DBUSMALLINTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_NULLTERMCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NULLTERMCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_RETCODECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"RETCODECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FAILCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FAILCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SUCCEEDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SUCCEEDCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SUCCEEDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CONTINUECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_LOGINFOCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DBLOGINFOCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_NOTIFY_ONCECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NOTIFY_ONCECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_NOTIFY_ALWAYSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NOTIFY_ALWAYSCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TRUEID="IN429901112"Datatypeschanges inRENDERAS="SECT2"New DatatypesREMAP="BO--Body"Pre-10.0 routines can still use the pre-10.0 datatypes, but will not be able to in future releases. Open Server routines use datatypes defined in CS-Library. For a description of each CS-Library datatype, see the LINKEND="X87730"Types
 topics page.REMAP="BO--Body"The table below lists each new datatype and the datatype it replaces. Nullable datatypes are marked with an asterisk. The CS_DATAFMT structure describing a nullable datatype must have the CS_CANBENULL status bit set. Note that the 2.0 Open Server datatypes SRVINTN, SRVDATETIMEN, SRVMONEYN and SRVFLTN will not be supported in future Open Server releases, as a datatype's null characteristic will be indicated in this new fashion. TOCENTRY="1"LBL="Table 2-25: "Updated DatatypesCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="140*"COLNAME="C2" COLWIDTH="129*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"New DatatypeCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Old DatatypeVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CHAR_TYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVCHARCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CHAR_TYPE*COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVVARCHARCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_BINARY_TYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVBINARYCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_BINARY_TYPE*COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVVARBINARYCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TINYINT_TYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVINT1COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SMALLINT_TYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVINT2COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_INT_TYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVINT4COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_INT_TYPE*COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVINTNCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REAL_TYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVREALCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FLOAT_TYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVFLT8COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FLOAT_TYPE*COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVFLTNCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_BIT_TYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVBITCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATETIME_TYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVDATETIMECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATETIME4_TYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVDATETIME4COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATETIME_TYPE*COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVDATETIMENCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_MONEY_TYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVMONEYCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_MONEY4_TYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVMONEY4COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_MONEY_TYPE*COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVMONEYNCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No longer supported.COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVVOIDID="IN428891213"Routinesobsolete in futureRENDERAS="SECT2"Routines Going Away in Future Open Server ReleasesREMAP="BO--Body"The table below lists each routine or macro that will become obsolete in future releases of Open Server, and the new or existing routine, if any, that provides the same functionality. In some cases, a new routine replaces several old routines or macros, or several new routines replace a single old one. For details, see the individual reference pages for the macros and routines, in Chapter 3.TOCENTRY="1"LBL="Table 2-26: "Updated Routines and MacrosCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="140*"COLNAME="C2" COLWIDTH="183*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"2.0 Routine or MacroCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Replacement RoutineVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_configCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_config_allocCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No longer needed.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_convertCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"cs_convertCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CURPROCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_describeCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_descfmt/srv_bindCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_errhandleCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_EVENTDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_thread_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_GETCONFIGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No longer needed.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_GETSERVERCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No longer needed.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_getuserdataCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_thread_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_GETVERSIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_GOT_ATTENTIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_thread_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_IODEADCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_thread_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_langptrCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_langcpyCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MASK macrosCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_maskCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_paramdataCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_bind/srv_xferdataCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_paramlenCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_descfmtCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_parammaxlenCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_descfmtCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_paramnameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_descfmtCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_paramsetCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_bindCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_paramstatusCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_descfmtCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_paramtypeCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_descfmtCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_pfieldCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_thread_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_returnvalCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_descfmt/srv_bind/srv_xferdataCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_rpcparamsCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_numparamsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_sendmsgCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_sendinfoCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_sendrowCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_xferdataCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_setcoldataCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_bindCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_setcollenCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_bindCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_setifileCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_setuserdataCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_thread_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_sfieldCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_sigvecCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_signalCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_SITEPROCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_thread_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_VERSIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_thread_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TRACECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TRACEOFFCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TRACEONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_propsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_willconvertCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"cs_willconvertREMAP="BO--Body"Note that two of the new routines are part of the new CS-Library rather than part of Server-Library. See the Open Client and Open Server Common Libraries Reference ManualID="IN4241881314"Preparing for future Open Server releases
ID="IN428871415"Routinesobsolete in future
 for more information about these routines. ID="IN4233871416"Processing parameter and row dataID="X25021" RENDERAS="SECT1"Processing Parameter and Row DataRENDERAS="SECT2"A Note on TerminologyREMAP="BO--Body"The term parameter data refers to parameters retrieved from or returned to a client. Some can be input parameters, while others can be output or return parameters. Return parameters are processed in two steps: they are partially processed when the Open Server application reads them into program variables. The processing is completed when they are sent back to the client. RENDERAS="SECT2"The Open Server Data Processing ModelREMAP="BO--Body"In 10.0 Open Server, three routines work together to retrieve parameter data and formats from a client and send row data, return parameters and their formats to a client. These routines are MOREINFO="NONE"srv_descfmt, MOREINFO="NONE"srv_bind, and MOREINFO="NONE"srv_xferdata. REMAP="BO--Body"An application uses these routines to process any client command that provides parameters or requests results. RPC commands, language commands, cursor commands, Dynamic SQL commands, message commands, and negotiated login commands fall into this category. REMAP="BO--Body"Each of the three routines takes a type argument, which indicates the type of data being described, bound or transferred. For example, when describing the format of cursor command input parameters, type would be set to SRV_CURDATA, whereas type would be set to SRV_ROWDATA when processing result rows. For a list of legal type values, see each routine's reference page in Chapter 3. REMAP="BO--Body"All three routines take a cmd argument as well, which indicates the direction of data flow. A value of CS_GET indicates that the Open Server application is retrieving information from the client, while CS_SET means that the application is returning results to a client.REMAP="BO--Body"An application can use these routines to:MARK="BULL" REMAP="BU--Bullet"Retrieve input and return parameter information inside a SRV_RPC, SRV_CURSOR, SRV_DYNAMIC, SRV_MSG, or SRV_CONNECT event handler.Send back result row information inside a SRV_RPC, SRV_CURSOR, SRV_DYNAMIC, SRV-LANGUAGE, or SRV_MSG event handler. Send back return parameter information inside a SRV_LANGUAGE or SRV_RPC handler. Do not mix routines from the 2.0 binding model with routines from the 10.0 binding model. For example, do not call MOREINFO="NONE"srv_describe followed by MOREINFO="NONE"srv_bind and MOREINFO="NONE"srv_xferdata.ID="IN4210871417"Parametersretrieving from a clientRENDERAS="SECT2"Retrieving ParametersREMAP="BO--Body"To process parameters, an application must:NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"Call MOREINFO="NONE"srv_numparams to determine how many parameters, if any, the command includes. Call MOREINFO="NONE"srv_descfmt to obtain a description of each parameter. Among other things, the description will indicate if the parameter is a return parameter. If it is, the retrieval process stops here. If the parameter is an input parameter, the application must continue with steps 3 and 4. Call MOREINFO="NONE"srv_bind to provide program variables in which to store the parameter data coming over the network from the client.Call MOREINFO="NONE"srv_xferdata to transfer the client data into the application program variables specified in step 3.REMAP="BO--Body"Return parameters contain no valid data when retrieved from a client. The application fills valid data in when it returns them to the client. Open Server transparently converts the return parameter format from the program variable format to the client format. REMAP="BO--Body"Note that, inside a SRV_LANGUAGE handler, an application can "construct" return parameters out of an undifferentiated language stream without having first retrieved actual parameters. See below, LINKEND="X31657""Returning Parameters in a Language Datastream"
, for further explanation.REMAP="BO--Body"MOREINFO="NONE"srv_descfmt and MOREINFO="NONE"srv_bind are called once for each parameter, while MOREINFO="NONE"srv_xferdata is called once for the entire parameter stream. An application must not call MOREINFO="NONE"srv_xferdata until all parameters have been described and bound. REMAP="BO--Body"An application must invoke the three routines with their cmd arguments set to CS_GET, as the application is retrieving information from the client.ID="IN424871418"RowsprocessingRENDERAS="SECT2"Returning RowsREMAP="BO--Body"The processing of row data requires three basic steps:NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"Describe each column in the row by calling MOREINFO="NONE"srv_descfmt.Indicate where the application has stored the row data and what format it is in, by calling MOREINFO="NONE"srv_bind.Transfer the data from the application program variables specified in step 2 over the network to the client, by calling MOREINFO="NONE"srv_xferdata.REMAP="BO--Body"The MOREINFO="NONE"srv_descfmt and MOREINFO="NONE"srv_bind routines must be called once for each column in a row, while MOREINFO="NONE"srv_xferdata is called as many times as there are result rows. An application must not call MOREINFO="NONE"srv_xferdata until all columns have been described and bound.REMAP="BO--Body"An application must invoke the three routines with their cmd arguments set to CS_SET, as the application is returning results to the client.ID="IN4217871419"Return parametersprocessingRENDERAS="SECT2"Returning Return ParametersREMAP="BO--Body"The processing of return parameters requires two basic steps:NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"Indicate where the application has stored the return parameter data and what format it is in, by calling MOREINFO="NONE"srv_bind.Transfer the return parameter data from the application program variables specified in step 2 over the network to the client, by calling MOREINFO="NONE"srv_xferdata.REMAP="BO--Body"An application must invoke the two routines with their cmd arguments set to CS_SET, as the application is returning results to the client.REMAP="BO--Body"If return parameters have been "constructed" out of a text stream, they will need to be described, in addition to being bound and transferred. See below,LINKEND="X31657""Returning Parameters in a Language Datastream"
, for further explanation.ID="IN424871420"Datadescribing, binding, transferring ofRENDERAS="SECT2"A Closer Look at Describing, Binding, and TransferringRENDERAS="SECT3"DescribingREMAP="BO--Body"The MOREINFO="NONE"srv_descfmt routine gives an Open Server application the information it needs to send back data to the client in the format the client expects. Conceptually, it conveys information about how the client saw (CS_GET) or will see the data (CS_SET).The MOREINFO="NONE"srv_descfmt routine retrieves or sets a variety of parameter and row column characteristics. REMAP="BO--Body"These characteristics include, among other information:MARK="BULL" REMAP="BU--Bullet"The parameter or column nameThe parameter or column name lengthThe parameter or column number, where the first parameter or column in a stream is numbered 1The parameter or column datatype Whether the parameter or column is nullableWhether a parameter is a return parameterREMAP="BO--Body"The clfmtp argument to MOREINFO="NONE"srv_descfmt points to a MOREINFO="NONE"CS_DATAFMT structure containing this information. For a detailed explanation of the LINKEND="X78182"CS_DATAFMT Structure
 , see its topics page.RENDERAS="SECT3"BindingREMAP="BO--Body"In order to examine data it receives from clients, an Open Server application must store the data in local program variables. When an application calls MOREINFO="NONE"srv_bind, it associates parameter or column data with a local application program variable and describes the format of that variable.REMAP="BO--Body"A call to MOREINFO="NONE"srv_bind with cmd set to CS_GET tells Open Server where to put the data coming from the client. A call to MOREINFO="NONE"srv_bind with cmd set to CS_SET tells Open Server where to find the data it is sending back to the client.REMAP="BO--Body"The osfmtp argument to MOREINFO="NONE"srv_bind points to a MOREINFO="NONE"CS_DATAFMT structure containing format information about the local program variables.RENDERAS="SECT3"TransferringREMAP="BO--Body"The MOREINFO="NONE"srv_xferdata routine moves data in and out of the local program variables named in a MOREINFO="NONE"srv_bind call. When cmd is set to CS_GET, a call to MOREINFO="NONE"srv_xferdata moves input parameter data from the client into the variables. When cmd is set to CS_SET, the routine pulls column and return parameter data out of the local program variables and sends it to the client. Although MOREINFO="NONE"srv_senddone currently flushes formats and column information to the network, it will not in future releases. Applications should always use MOREINFO="NONE"srv_xferdata to flush information to the network. REMAP="BO--Body"For more information on LINKEND="X30757"srv_bind
, LINKEND="X33058"srv_descfmt
, and LINKEND="X52699"srv_xferdata
, see their respective reference pages.RENDERAS="SECT3"Automatic ConversionREMAP="BO--Body"When an application retrieves data, Open Server converts the data to the local format if the format the client sent the data in differs from the format of the application's local program variables. If the same situation arises when an application is sending data back to a client, Open Server converts the data to the client format.ID="IN4217851621"Return parametersprocessing in a SRV_LANGUAGE event handlerID="X31657" RENDERAS="SECT2"Returning Parameters in a Language DatastreamREMAP="BO--Body"There is no notion of parameters in a language datastream. An Open Server application equipped to parse a text stream, however, can "construct" return parameters from the incoming stream. It can then load them up with data and send them back using the describe/bind/transfer triad. REMAP="BO--Body"For example, a client can send a Transact-SQL stored procedure query that includes return parameters. An Open Server application expecting this can parse for the string "output = @var" (where var is the placeholder for the return parameter) and send back format information and data for var.REMAP="BO--Body"An application can call MOREINFO="NONE"srv_descfmt with cmd set to CS_SET and type set to SRV_RPCDATA inside a language event handler only.RENDERAS="SECT2"ExampleREMAP="BO--Body"The on-line sample, ctosdemo.c, processes parameter and column data using the describe/bind/transfer series of calls.ID="X80111" RENDERAS="SECT1"Registered ProceduresID="IN4221851622"Registered proceduresdefinition ofRENDERAS="SECT2"What Is A registered Procedure?REMAP="BO--Body"A registered procedure is a piece of code identified by a name. When an application registers a procedure, it maps the procedure name to a routine, so that when Open Server detects this procedure name in an incoming RPC datastream, it can call a specific routine immediately without raising a SRV_RPC event.REMAP="BO--Body"When an Open Server receives an RPC, Open Server looks up the procedure name in the list of registered procedures. If the name is registered, the run-time system executes the routine associated with the registered procedure if there is one. If the procedure name is not found in the list of registered procedures, Open Server calls the SRV_RPC event handler. RENDERAS="SECT3"ID="IN4221851623"Registered procedurescontrasted with remote procedure calls
Contrasted with Standard Remote Procedure CallsREMAP="BO--Body"An Open Server application processes a conventional RPC inside the application's SRV_RPC event handler. The handler code must parse the RPC datastream, retrieving the RPC name, the number of parameters, the parameter formats, and the parameter values. The handler can then take actions based on these values. A SRV_RPC event handler must be coded for all possible RPCs the application programmer anticipates will come over the network.ID="IN4221851624"Registered proceduresbenefits ofRENDERAS="SECT2"What Are Registered Procedures Good For?REMAP="BO--Body"Registered procedures simplify RPC handling in an Open Server application, for the following reasons:MARK="BULL" REMAP="BU--Bullet"Registered procedures consolidate code in one place. They are executable objects that an Open Server application can call from other event handlers in addition to the SRV_RPC event handler.Registered procedures can be created at any time when the server is running, via Server-Library calls or external Client-Library or DB-Library calls. The SRV_RPC event handler, by contrast, must be coded in advance of starting up the server.Registered procedures provide automatic datatype checking and require no parsing on the part of the Open Server application code. Clients can ask to be notified when a registered procedure executes. The "notification" consists of:MARK="DASH" REMAP="BS--BulletSub"the name of the registered procedurethe parameter values associated with this execution of the registered procedureThe notification request can be made internally with Server-Library calls, or externally with Client-Library or DB-Library calls. Clients can request a list of registered procedures or a list of the procedures for which they have requested notifications.ID="IN4223851625"Notification proceduresRENDERAS="SECT2"Notification Procedures   REMAP="BO--Body"Registered procedures are not required to have an executable routine in the Open Server application. In fact, registered procedures created by DB-Library or Client-Library calls cannot call a routine in Open Server. A registered procedure that has no executable routine associated with it is called a "notification procedure" because its sole purpose is to notify clients watching for it to execute. REMAP="BO--Body"It is useful to have a means of notifying a client when a registered procedure executes. Without any programmer-supplied code, an Open Server application allows Client-Library or DB-Library clients to create registered procedures, execute them, and receive notification when they execute. This allows client applications to communicate with each other via any Open Server application. Although you do not need to write any code to enable this feature, you may want to install a callback handler to disable or regulate the use of registered procedures. See below, LINKEND="X65789"Using Callback Handlers with Registered Procedures, for details.RENDERAS="SECT2"Who Creates Registered Procedures?REMAP="BO--Body"Open Server applications can create both standard registered procedures and notification procedures. Client-Library and DB-Library applications can create notification procedures. For information on how to create registered procedures using Client- Library routines, see the Open Client Client-Library/C Reference Manual.RENDERAS="SECT2"The Mechanics of Registered ProceduresRENDERAS="SECT3"ID="IN4221851626"Registered proceduressteps to register
Registering ProceduresREMAP="BO--Body"Registering a procedure via Open Server calls requires several steps. They are as follows:NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"Call MOREINFO="NONE"srv_regdefine to define the procedure name and map the name to the function to be called when the procedure is executed. Call MOREINFO="NONE"srv_regparam to describe the parameter or parameters for the procedure being defined. Call MOREINFO="NONE"srv_regcreate to complete the registration of a procedure.Call MOREINFO="NONE"srv_regdrop to unregister a procedure.RENDERAS="SECT3"Executing ID="IN4221851627"Registered proceduresexecuting
Registered ProceduresREMAP="BO--Body"Open Server executes registered procedures in response to a client or remote SQL Server RPC call, if the RPC has been registered. An Open Server application, however, can explicitly execute a registered procedure without it being in response to an RPC. For example, an application may want to synchronize the activity of multiple clients by executing a particular notification procedure at a particular point in the application. REMAP="BO--Body"Explicitly executing a registered procedure also requires several steps. They are as follows:NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"Call MOREINFO="NONE"srv_reginit to begin executing a registered procedure. This routine specifies the name of the registered procedure to be executed. The Open Server application also uses this routine to dictate whether one or all of the client threads on the notification list will be notified.Call MOREINFO="NONE"srv_regparam to supply the parameter data for the execution. Call MOREINFO="NONE"srv_regexec to actually execute the registered procedure.RENDERAS="SECT3"ID="IN4221851628"Registered proceduresmaintaining lists of 
Maintaining ListsREMAP="BO--Body"An Open Server application maintains lists of all procedures registered and which clients to notify when a particular registered procedure executes. This notification happens automatically. The following routines pertain to list maintenance:MARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_reglist returns a list of all the procedures registered in the Open Server application.MOREINFO="NONE"srv_regwatchlist returns a list of all registered procedures for which the named client thread has notification requests pending.MOREINFO="NONE"srv_regwatch adds a thread to the notification list for a registered procedure.MOREINFO="NONE"srv_regnowatch removes a client from the notification list for a specified registered procedure.MOREINFO="NONE"srv_reglistfree frees a SRV_PROCLIST structure previously allocated by MOREINFO="NONE"srv_reglist or MOREINFO="NONE"srv_regwatchlist.ID="IN4228851629"System registered proceduresdefinition ofRENDERAS="SECT2"System Registered Procedures   REMAP="BO--Body"Every Open Server has built-in registered procedures, called system registered procedures. The run-time system creates them when the server starts up. The system registered procedures are described in Chapter 4. Some of these procedures are useful for administering an Open Server application interactively. For example, you can use MOREINFO="NONE"sp_who and MOREINFO="NONE"sp_ps to list active server processes and MOREINFO="NONE"sp_terminate to destroy a process.REMAP="BO--Body"Client applications that want to:MARK="BULL" REMAP="BU--Bullet"get a list of registered proceduresexecute a registered procedurerequest notification of a registered procedure's executionREMAP="BO--Body"orMARK="BULL" REMAP="BU--Bullet"get a list of notification requestsREMAP="BO--Body"can do so by executing the system registered procedures.REMAP="BO--Body"Most system registered procedures map to an equivalent Open Server routine. An Open Server application and a client can request the same kind of information via distinct routines.REMAP="BO--Body"The following table matches each system registered procedure to the Server-Library routine that performs the same function, where applicable:TOCENTRY="1"ID="X22971" LBL="Table 2-27: "System Registered Procedures and Corresponding Server-Library 
RoutinesCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="163*"COLNAME="C2" COLWIDTH="150*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"System Registered ProcedureCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Server-Library RoutineVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"sp_psCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"N/ACOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"sp_regcreateCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_regcreate/srv_regdefineCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"sp_regdropCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_regdropCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"sp_reglistCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_reglistCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"sp_regnowatchCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_regnowatchCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"sp_regwatchCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_regwatchCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"sp_regwatchlistCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_regwatchlistCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"sp_serverinfoCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"N/ACOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"sp_terminateCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_termprocCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"sp_whoCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"N/AID="IN4221851630"Registered proceduresusing callback handlers withRENDERAS="SECT2"ID="X65789"Using Callback Handlers with Registered ProceduresREMAP="BO--Body"As noted in LINKEND="X22971"Table 2-27
, several of the built-in registered procedures are parallels of the Server-Library and DB-Library routines that create, delete, and execute registered procedures. These procedures make it possible to implement a security system for registered procedures by installing a callback handler that executes whenever a registered procedure is about to execute. When a client application executes a system registered procedure or one of the parallel Client-Library or DB-Library routines, the callback handler executes. If it returns SRV_S_INHIBIT, the registered procedure will not execute. REMAP="BO--Body"For example, to prevent clients other than "sa" from executing a procedure named "reinitialize", the registered procedure callback handler could contain the following code: REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/***   Stop users other than "sa" from executing the "reinitialize"**   registered procedure.**** Parameters:**    spp - Handle to the current client connection.**** Returns:**    CS_TRUE  Allow the user to execute**    CS_FALSE Disallow execution.*/CS_BOOL    rpc_permission(spp)SRVPROC    *spp;{      CS_INTulen;      /* User name length  */      CS_INTrlen;       /* RPC name length   */      CS_CHAR*rname;    /* Pointer to the RPC name */      CS_CHARuser[256]; /* Buffer for the user name */      /*      ** Get the name of the rpc command      */      if ((rname = srv_rpcname(spp, &rlen)) == NIL(CS_CHAR *))      {          return (CS_FALSE);      }      /*      ** Get the user name.      */      if (srv_thread_props(spp, CS_GET, SRV_T_USER,       (CS_VOID *)user,CS_SIZEOF(user), &ulen) == CS_FAIL)      {          return (CS_FALSE);      }      /*      ** If either the user name or the rpc name is NULL,      ** indicate an error.      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (rlen <= 0 || ulen <= 0)      {            error ("API error");            return (CS_FALSE);      }      /* Null terminate the user name buffer */      user[ulen] == `\0';      /*      ** Compare the RPC name and User name for permission.      */      if ((strcmp(rname, "reinitialize") == 0) &&        (strcmp(user, "sa") == 0))      {           return (CS_TRUE);      }      return (CS_FALSE);}RENDERAS="SECT2"ExampleREMAP="BO--Body"The on-line sample regproc.c illustrates an Open Server application's use of registered procedures.ID="IN423821931"RPCSee Remote procedure calls
ID="IN4222812032"Remote procedure callsRENDERAS="SECT1"Remote Procedure CallsID="IN4222812033"Remote procedure callsdefinition ofREMAP="BO--Body"A remote procedure call, or RPC, is a mechanism by which a client application communicates with an Open Server application. Typically, the client issues the RPC in order to obtain information from the Open Server application. An RPC consists of a name and often, but not always, parameters. For example, a department store application could return a customer's name and address in response to an RPC called get_cust. This RPC could take one parameter, a customer ID number.REMAP="BO--Body"When a client sends an RPC, Open Server checks to see whether the RPC is registered. A registered procedure is a special kind of RPC that Open Server recognizes and executes directly without calling an application's SRV_RPC event handler. For more information on registered procedures, see the LINKEND="X80111"Registered Procedures
topics page.REMAP="BO--Body"If the RPC is not registered, Open Server triggers a SRV_RPC event. Inside the SRV_RPC event handler, the application can retrieve the RPCs name and parameters, if any, and respond appropriately. The event handler is coded to verify the names of all possible RPCs the client could send and the number of parameters each has. The handler includes code for responding to each RPC, and returns the error information to the client if it does not recognize the RPC. ID="IN4222812034"Remote procedure callsprocessing ofREMAP="BO--Body"Once inside its SRV_RPC event handler, the application should perform the following steps:NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"Call MOREINFO="NONE"srv_rpcname to retrieve the RPC name. (An application can also choose to retrieve the RPC number, owner, and associated database, using MOREINFO="NONE"srv_rpcnumber, MOREINFO="NONE"srv_rpcowner, and MOREINFO="NONE"srv_rpcdb, respectively.) If no RPC by that name exists, or the number, owner, or database information are invalid, return error information via MOREINFO="NONE"srv_sendinfo.Verify that the appropriate number of parameters were sent, by calling MOREINFO="NONE"srv_numparams. If any of the parameter information is invalid, return error information via MOREINFO="NONE"srv_sendinfo.Process the parameters by calling MOREINFO="NONE"srv_descfmt, MOREINFO="NONE"srv_bind, and MOREINFO="NONE"srv_xferdata. For details, see the LINKEND="X25021"Processing Parameter and Row Data
 topics page.Return any data the client expects by calling MOREINFO="NONE"srv_descfmt, MOREINFO="NONE"srv_bind, and MOREINFO="NONE"srv_xferdata. For details, see LINKEND="X25021"Processing Parameter and Row Data
 topics page.REMAP="BO--Body"RPC parameters are passed either by name or by position. If the RPC is invoked with some parameters passed by name and some parameters passed positionally, an error will result.REMAP="BO--Body"An application could choose to register all its procedures and use the SRV_RPC event handler to trap errors. Open Server would only call the SRV_RPC event handler if the client sent an unregistered, and therefore invalid, RPC. The SRV_RPC event handler, then, would use MOREINFO="NONE"srv_sendinfo, to inform the client that it had issued an invalid RPC.RENDERAS="SECT2"ExampleREMAP="BO--Body"The on-line sample, regproc.c,ID="IN4222802135"Remote procedure calls
 illustrates remote procedure calls.ID="IN4221772436"Configuration optionsSee Server propertiesID="X41578" RENDERAS="SECT1"Tailoring Your Open ServerREMAP="BO--Body"Properties define how Open Server will behave in a variety of circumstances. A programmer can tailor an Open Server application's functionality by setting these attributes. In addition, an application can retrieve certain properties when it needs information.REMAP="BO--Body"Open Server properties fall into three categories:MARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"Context  propertiesMOREINFO="NONE"Server propertiesMOREINFO="NONE"Thread propertiesREMAP="BO--Body"Context and server properties pertain to the Open Server application as a whole. They govern server-wide behavior and hold true for all client-server connections. This topics page focuses on these two types of properties.REMAP="BO--Body"Thread properties pertain to client and service threads. Most are only retrievable, not settable. An application can override certain server-wide attributes on a per-connection basis by setting certain thread properties. See the LINKEND="X51278"Thread Properties
 topics page, for details. ID="IN4218772437"Context propertiesdefinition ofRENDERAS="SECT2"Context PropertiesREMAP="BO--Body"Context properties pertain both to Open Client applications and to Open Server applications. However, only certain ones are meaningful for Open Server applications. The context properties an Open Server application can set include: MARK="BULL" REMAP="BU--Bullet"The routine Open Server will call when it detects a CS-Library error.Localization information, including the Open Server's national language, character set, and sort order.The location of a pointer to application data space. This allows applications to associate control information with Open Server's context. Open Server does not use this pointer; it is provided only for the convenience of Open Server application programmers.REMAP="BO--Body"These context properties are both settable and retrievable via the MOREINFO="NONE"cs_config routine. See the Open Server and Open Client Common Libraries Reference Manual for details on this routine.ID="IN4217772438"Server propertiesdefinition ofRENDERAS="SECT2"Server PropertiesREMAP="BO--Body"Server properties determine many aspects of an Open Server application's behavior, from where it finds its memory-allocation routines, to the maximum number of physical network connections it can establish.REMAP="BO--Body"Some properties can be set and retrieved, while others are set-only or retrieve-only. The MOREINFO="NONE"srv_props reference page in Chapter 3 provides this information.REMAP="BO--Body"The following table describes each server property:TOCENTRY="1"LBL="Table 2-28: "Server PropertiesCOLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="153*"COLNAME="C2" COLWIDTH="148*"COLNAME="C3" COLWIDTH="148*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"PropertyCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NotesVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_ALLOCFUNCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The address of the routine 
Open Server will use to 
allocate memory.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_APICHKCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A Boolean indicating whether 
to enable (CS_TRUE) or 
disable (CS_FALSE) the 
validation of Server-Library 
arguments and state checking.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_ATTNREASONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The reason an Open Server 
application's attention 
handler was called. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns SRV_ATTENTION if a 
client attention triggered the 
SRV_ATTENTION event, and 
SRV_DISCONNECT if a client 
disconnect triggered the event.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_CURTHREADCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The address of the active 
thread's internal control 
structure.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_DEFQUEUESIZECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Deferred event queue size.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_DISCONNECTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Set this property to CS_TRUE 
to have an application's 
SRV_ATTENTION event 
handler called when a client 
disconnects.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The SRV_ATTENTION event 
handler can be called at 
interrupt level, if the client 
disconnect is detected at 
interrupt time.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_ERRHANDLECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The address of the Open 
Server error handler.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_FREEFUNCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The address of the routine 
Open Server will use to free 
memory.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_IFILECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The name of the interfaces file 
available for use by Open 
Server.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_LOGFILECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The name of the log file Open 
Server will write to.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_LOGSIZECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The maximum size of the log 
file. If the log exceeds this size, 
Open Server will move the 
current contents of the log file 
to another file with the name 
<currentfilename>_old and 
will truncate the current log to 
0 bytes.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_MSGPOOLCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of messages 
available to an Open Server 
application at run-time. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server applications use 
messages via MOREINFO="NONE"srv_putmsgq. A 
message remains in use until it 
is received via MOREINFO="NONE"srv_getmsgq. 
Applications should base this 
configuration parameter's 
value on their use of these two 
routines.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NETBUFSIZECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The maximum size of the 
network I/O buffer to be used 
by client connections.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The actual size of the network 
buffer used is determined at 
login time. If a smaller size is 
requested, Open Server will 
not resize the memory buffer. 
It will just leave part of it 
unused. For this reason, do not 
make this value larger than 
required or memory will be 
allocated that won't be used.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NETTRACEFILECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Net-Library tracing written to 
this file.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMCONNECTIONSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The maximum number of 
physical network connections 
the Open Sever application 
will accept.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A server-to-server connection 
is only one physical 
connection, regardless of how 
many sub-channels are used.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMMSGQUEUESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of message 
queues available to the Open 
Server application.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMMUTEXESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of mutual 
exclusion semaphores 
available to the Open Server 
application.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMREMBUFCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"This is the window size used 
on server-to-server 
connections. It indicates the 
maximum number of packets 
that can be outstanding on a 
logical subchannel before an 
acknowledgment is required.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMREMSITESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The maximum number of 
remote server site handlers 
that can be active at a given 
time. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMTHREADSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The maximum number of 
threads available to an Open 
Server application. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMUSEREVENTSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of user events an 
application can define. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_PREEMPTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A Boolean. If CS_TRUE, Open 
Server will use preemptive 
scheduling. If CS_FALSE, 
Open Server will use non-
preemptive scheduling.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Preemptive scheduling is not 
available on all platforms. Use 
MOREINFO="NONE"srv_capability to determine 
whether it is available.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_REALLOCFUNCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The address of the routine 
Open Server will use to reallocate memory.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_REQUEST_CAPCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The default client requests that 
the application accepts.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"See the MOREINFO="NONE"Capabilities topics 
page.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S__RESPONSE_CAPCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The default results that the 
application supports.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"See the MOREINFO="NONE"Capabilities topics 
page.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_SERVERNAMECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The name of the Open Server 
application. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"This is the name the Open 
Server application is known by 
when up and running. It is 
also the name used to look up 
listen address in interfaces file.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_STACKSIZECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The size of the stack allocated 
for each thread.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_TDSVERSIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The Tabular Data Stream 
protocol version to which 
Open Server will attempt to 
negotiate all client 
connections. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"See below, "Notes on 
SRV_S_TDSVERSION", for a 
list of values.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_TIMESLICECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of clock ticks an 
active thread consumes before 
the time slice callback routine 
is called.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"See the MOREINFO="NONE"srv_callback reference page for information 
on timeslice callbacks.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_TRACEFLAGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The type of tracing desired. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"See below, "Notes on 
SRV_S_TRACEFLAG", for a 
list of flags.COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_TRUNCATELOGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A Boolean. If CS_TRUE, Open 
Server truncates log file during 
startup.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_USESRVLANGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A Boolean. If CS_TRUE, the 
Open Server application's 
national language is used for 
error messages. If CS_FALSE, 
the client's national language 
is used for error messages.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_VERSIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A character string that 
contains the name, release 
data, and copyright 
information of the Open 
Server Server-Library.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_VIRTCLKRATECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The clock rate, in 
microseconds per tick.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_VIRTIMERCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A Boolean. If CS_TRUE, the 
virtual timer is enabled. If 
CS_FALSE, the virtual timer is 
disabled.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ID="IN4217742739"Server propertiesServer Properties table
ID="IN423742740"TDSnegotiating version of with clientRENDERAS="SECT3"Notes on SRV_S_TDSVERSIONREMAP="BO--Body"During the client login process, Open Server will negotiate with the client application to agree on a TDS version for all threads. The SRV_S_TDSVERSION property value determines Open Server's starting point. The client will agree to communicate at or below this starting point. Later on in the login process, the Open Server application can renegotiate the TDS version for a particular thread, using the SRV_T_TDSVERSION thread property. See the LINKEND="X51278"Thread Properties
 topics page, for details.ID="IN423742741"TDSlegal version valuesREMAP="BO--Body"The following table describes the legal values for this property:TOCENTRY="1"LBL="Table 2-29: "Values for SRV_S_TDSVERSIONCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="145*"COLNAME="C2" COLWIDTH="151*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_TDSVERSION ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDSNONECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Unknown version of TDS.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_4.0COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Negotiation starts at TDS 4.0.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_4_0_2COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Negotiation starts at TDS 4.0.2.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_4_2COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Negotiation starts at TDS 4.2.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_4_6COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Negotiation starts at TDS 4.6.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_4_9_5COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Negotiation starts at TDS 4.9.5.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_5_0COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Negotiation starts at TDS 5.0.ID="IN4211732842"Trace flagssummary of Open Server trace flagsRENDERAS="SECT3"Notes on SRV_S_TRACEFLAGREMAP="BO--Body"The SRV_S_TRACEFLAG property is a bitmap. Its flags, which can be OR'd together, are described in the following table:TOCENTRY="1"LBL="Table 2-30: "Values for SRV_TRACEFLAGCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="140*"COLNAME="C2" COLWIDTH="129*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FlagCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_ATTNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server displays 
information indicating 
whether the Open Server 
application has received 
or acknowledged an 
attention.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_DEFQUEUECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server traces event 
queue activity.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_EVENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server displays 
information about the 
events it has triggered.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_MSGQCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server traces 
message queue
 activity.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_NETDRIVERCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server traces TCL 
Net-Lib driver requests.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_NETREQCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server traces TCL 
requests.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_NETWAKECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server traces TCL 
wakeup request.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_TDSDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server displays 
TDS packet contents in 
hexadecimal and ASCII 
format. This is the actual 
TDS traffic between a 
client and the Open Server 
application. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_TDSHDRCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server displays the 
TDS protocol packet 
header information, such 
as packet type and length.ID="IN4218713043"Context propertiesconfiguring via cs_config 
ID="IN4217693244"Server propertiesconfiguring via srv_props RENDERAS="SECT2"How Do You Tailor Your Open Server?REMAP="BO--Body"Context properties are stored in a CS-Library CS_CONTEXT structure. REMAP="BO--Body"An application sets or retrieves context properties using the CS-Library routine MOREINFO="NONE"cs_config.REMAP="BO--Body"Server properties are also stored in a CS_CONTEXT structure. An application sets or retrieves server properties using the Server-Library routine MOREINFO="NONE"srv_props.REMAP="BO--Body"When an application allocates a CS_CONTEXT structure, via a call to MOREINFO="NONE"cs_ctx_alloc, CS-Library sets default context properties.RENDERAS="SECT2"When Do You Tailor Your Open Server?REMAP="BO--Body"An Open Server application configures properties in its initialization code, as part of readying the server to run. ID="IN4214693245"Initializationsetting properties duringREMAP="BO--Body"In order for server properties to take effect, an application must set them prior to initialization. Open Server will raise an error if a server property is set following initialization.ID="IN4214693246"Initializationsummary of steps inREMAP="BO--Body"An application's initialization code must include the following steps:NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"Allocate a CS_CONTEXT structure, via a call to MOREINFO="NONE"cs_ctx_alloc.Call MOREINFO="NONE"srv_version to set the Open Server release version number. MOREINFO="NONE"srv_version takes a pointer to a CS_CONTEXT structure.Call MOREINFO="NONE"srv_props to set property defaults.Call MOREINFO="NONE"srv_init to initialize the server.Start the server running with a call to MOREINFO="NONE"srv_run.REMAP="BO--Body"For more information on context properties and their associated routines and structures, see the Open Server and Open Client Common Libraries Reference Manual.REMAP="BO--Body"For more information on the LINKEND="X84669"srv_props
 routine, see its reference page. ID="IN4214683347"Text and imageID="X12233" RENDERAS="SECT1"Text and ImageREMAP="BO--Body"text and image are SQL Server datatypes designed to hold large text or image values. The text datatype will hold up to 2, 147,483,647 bytes of printable characters. The image datatype will hold up to 2,147,483,647 bytes of binary data.REMAP="BO--Body"Because they can be so large, text and image values are not actually stored in database tables. Instead, a pointer to the text or image value is stored in the table. This pointer is called a text pointer.REMAP="BO--Body"To ensure that competing applications do not wipe out one another's modifications to the database, a timestamp is associated with each text or image column. This timestamp is called a text timestamp.RENDERAS="SECT2"Processing Text and Image DataREMAP="BO--Body"Clients send text and image data as an undifferentiated datastream, known as a writetext stream. Because it is not differentiated into parameters, an Open Server application cannot rely on the routines it normally uses in processing incoming parameter data: MOREINFO="NONE"srv_descfmt MOREINFO="NONE"srv_bind, and MOREINFO="NONE"srv_xferdata. Instead, it must use a special set of text and image routines. REMAP="BO--Body"An Open Server application can send text or image data back to a client in one of two ways, depending on how many columns the return rows contain. If the return row contains just one column, and that column contains text or image data, it can be treated as an undifferentiated datastream, and its processing deviates from the norm. If, however, the row contains other columns in addition to a text or image column, the text or image data is processed using the describe/bind/transfer method. Note that both methods will have some steps in common.REMAP="BO--Body"See the LINKEND="X25021"Processing Parameter and Row Data
 topics page, for details on the describe/bind/transfer triad of calls.ID="IN4214683348"Text and imagedata:retrieving from a clientRENDERAS="SECT3"Retrieving Data from a ClientREMAP="BO--Body"A writetext stream triggers a SRV_BULK event. Text and image data retrieved from a client is considered to be a kind of bulk data. An Open Server application processes incoming text and image data from inside its bulk handler. For more information on types of bulk data see the Open Client and Open Server Common Libraries Reference Manual. REMAP="BO--Body"An application processes incoming text or image data in two steps:NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"The MOREINFO="NONE"srv_text_info routine retrieves a description of the text or image data and places the information in a CS_IODESC structure. This call returns a variety of information, the most important of which is the total length of the data. Based on the length, the application can decide whether to retrieve the data all at once or in sections, and can decide how large a buffer to allocate to store the data. MOREINFO="NONE"srv_text_info is called with the cmd argument set to CS_GET.The MOREINFO="NONE"srv_get_text routine actually brings the data over from the client in the specified section size and stores it in the specified buffer.REMAP="BO--Body"Note that a call to MOREINFO="NONE"srv_text_info must always precede a call to MOREINFO="NONE"srv_get_text. The MOREINFO="NONE"srv_get_text routine must be called until all text has been read from the client. ID="IN4214683349"Text and imagedata:sending to a clientRENDERAS="SECT3"Returning Data To a ClientREMAP="BO--Body"An application can return text or image data inside of any event handler that can return row results. An application processes outgoing text or image data in several steps that differ, depending on how many columns are in the data row. If there is just one column, and it is a text or image column, the application takes the following steps:NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"Describes the format in which the client will receive the text or image column, using MOREINFO="NONE"srv_descfmt. Calls MOREINFO="NONE"srv_text_info with cmd set to CS_SET to provide the total text length. Calls MOREINFO="NONE"srv_send_text to send the data to the client in chunks.REMAP="BO--Body"If there are other columns in addition to the text and image column or columns, the application must take the following steps:NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"Describe the format in which the client will receive the data, using MOREINFO="NONE"srv_descfmt. This is called once for each column.Describe the format and location of the local program variables in which the Open Server application is storing the information, using MOREINFO="NONE"srv_bind. This must be called once for each column.Provide text pointer and timestamp information by calling MOREINFO="NONE"srv_text_info with cmd set to CS_SET. This must be called once for each text or image column.Transfer the data using MOREINFO="NONE"srv_xferdata. This must be called as many times as there are rows.RENDERAS="SECT2"ExampleREMAP="BO--Body"The on-line sample, ctosdemo.cID="IN4214673450"Text and image
, includes code to process text and image data.ID="IN4217663551"Thread propertiesID="X51278" RENDERAS="SECT1"Thread PropertiesRENDERAS="SECT2"Thread PropertiesREMAP="BO--Body"A thread is a piece of code that executes to accomplish a specific task or set of tasks. There are several types of Open Server threads. Thread properties define aspects of a thread's behavior and set limits on its resources. REMAP="BO--Body"For more details on Open Server threads, see the LINKEND="X58007""Thread Types and SRV_T_TYPE" section, and theLINKEND="X61092"Multithread Programming 
topics page.REMAP="BO--Body"Only a few thread properties are settable, but all are retrievable. An application calls MOREINFO="NONE"srv_thread_props to retrieve and set a thread property value. Settable properties are noted as such in the MOREINFO="NONE"srv_thread_props reference page. An application can retrieve and set thread properties at any point after initialization.REMAP="BO--Body"Open Server assigns defaults for each settable thread property when it creates threads at initialization time. See the LINKEND="X51398"srv_thread_props
reference page, for a list of defaults.ID="IN4217653652"Thread propertiesdescription ofREMAP="BO--Body"The following table describes each thread property:TOCENTRY="1"LBL="Table 2-31: "Thread PropertiesCOLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="153*"COLNAME="C2" COLWIDTH="148*"COLNAME="C3" COLWIDTH="148*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"PropertyCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NotesVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_APPLNAMECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The client application's name.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_BYTEORDERCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The client's requested byte 
ordering scheme. 
SRV_LITTLE_ENDIAN 
indicates that the least 
significant byte is the high 
byte. SRV_BIG_ENDIAN 
indicates that the least 
significant byte is the low byte. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_BULKTYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The type of bulk transfer being 
sent by the client. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"See "Bulk Transfer of Data and 
SRV_T_BULKTYPE", for a list of legal 
values.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_CHARTYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The type of character data 
representation.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"See "Character Data 
Representation and 
SRV_T_CHARTYPE", for a list of legal 
values.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_CLIBCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The name of the library 
product used by the client to 
connect to the Open Server 
application.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_CLIBVERSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The version of the library 
product used by the client to 
connect to the Open Server 
application. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_CLIENTLOGOUTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A Boolean. Indicates whether 
the client completed an 
orderly or aborted logout, 
where CS_TRUE indicates an 
orderly logout. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"This property can only be 
retrieved from inside the 
SRV_DISCONNECT event 
handler. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_CONVERTSHORTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A Boolean. Indicates whether 
automatically to convert 4-
byte datetime, 4-byte floating 
point, and 4-byte money 
datatypes to their 8-byte 
counterparts.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_DUMPLOADCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A Boolean. Indicates whether 
to disallow the use of 
dump/load and bulk insert for 
this client connection.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_EVENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The Open Server event the 
thread is currently in. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"See "Event Handlers and 
SRV_T_EVENT", for a list of legal 
values.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_EVENTDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A generic data address 
associated with a particular 
event raised by the Open 
Server application.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Data address set using 
MOREINFO="NONE"srv_event.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_FLTTYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The type of floating point 
representation used by the 
client.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"See "Floating Point 
Representation and 
SRV_T_FLTTYPE", for a list of legal 
values.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_GOTATTENTIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A Boolean. Indicates whether 
the client thread has received 
an attention.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_HOSTNAMECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The name of the host machine 
from which the client 
connection originated.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_HOSTPROCIDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The process ID of the client 
program.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"This is the operating system 
process ID received in the 
client login record.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_IODEADCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A Boolean. Indicates whether 
a thread's I/O channel is valid. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUE means a thread can 
successfully do I/O, 
CS_FALSE means it cannot. 
Open Server always returns 
CS_FALSE for service threads.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_LOCALECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a CS_LOCALE 
structure allocated by the 
Open Server application.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Use this property to retrieve or 
set localization information.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_LOGINTYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The type of login record 
received. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"See "Login Types and 
SRV_T_LOGINTYPE", for a list of legal 
values.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_MACHINECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The host name of the machine 
the client thread is running on. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_NEGLOGINCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The type of negotiated login, if 
any, the client has requested.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"This property is a bit mask that 
can take any of four values. 
SRV_CHALLENGE indicates 
that the client wishes to 
negotiate via a 
challenge/response exchange, 
SRV_ENCRYPT indicates that 
the client wishes to pass an 
encrypted password, and 
SRV_SECLABEL indicates that 
the client will send security 
labels. SRV_APPDEFINED 
indicates that an application-
defined login handshake is in 
use.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_NOTIFYCHARSETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A Boolean. Indicates whether 
the client wants to be notified 
when the character set in use 
has changed.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_NOTIFYDBCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A Boolean. Indicates whether 
the client wants to be notified 
of the outcome of a use db 
Transact-SQL command.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_NOTIFYLANGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A Boolean. Indicates whether 
the client wants to be notified 
when the national language in 
use has changed.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_NUMRMTPWDSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of remote 
passwords.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_PACKETSIZECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The negotiated packet size 
used to communicate with the 
client. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The packet size is negotiated 
transparently at login time.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_PASSTHRUCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A Boolean. Indicates whether 
the client thread is operating 
in pass-through mode.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_PRIORITYCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The priority level at which 
Open Server should schedule 
the thread.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"This property is retrieve-only. 
To set a thread's priority, call 
MOREINFO="NONE"srv_setpri.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_PWDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The password string the client 
sent in the login record. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"For remote server 
connections, this property 
returns the remote server 
password.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_RMTPWDSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"An array of SRV_RMTPWDs.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"See "The SRV_RMTPWD 
Structure" for the structure's 
definition.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_RMTSERVERCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The name of the remote server, 
if the thread represents a 
remote server connection. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_ROWSENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of rows returned 
to the client in this event.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_SPIDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The thread's process identifier.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"This is the unique ID assigned 
to this thread. Thread IDs are 
reused once a thread has 
exited.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_STACKLEFTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The size of unused stack 
available to the thread.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_TDSVERSIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The version of TDS the client 
thread is using. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Settable. Setting this thread in 
the SRV_CONNECT event 
handler allows an Open Server 
application to negotiate the 
TDS version to some value 
other than Open Server's 
default for the thread. See 
"Notes on 
SRV_T_TDSVERSION" for a list of legal 
values.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_TYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The thread type. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"See "Thread Types and 
SRV_T_TYPE" for a list of legal 
types.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_USERCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The user name the client 
thread logged on with. COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_USERDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A generic data address used 
for application-specific 
purposes.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Settable.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_USESRVLANGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A Boolean. CS_TRUE if error 
message should be in the 
server's national language, 
CS_FALSE if in the client's.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Set this to override the server-
wide SRV_S_USESRVLANG 
property for a thread.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_USTATECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A string describing the current 
state of the thread.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Settable. ID="IN4223623953"Thread Properties tableID="X39713" RENDERAS="SECT3"Bulk Transfer of Data and SRV_T_BULKTYPEREMAP="BO--Body"Client applications can transfer three types of bulk data to Open Server applications: bulk copy data, text data, and image data. The SRV_T_BULKTYPE property is used to set or get the type of bulk data transfer being initiated by a client.REMAP="BO--Body"The following table describes the legal values for the SRV_T_BULKTYPE thread property:TOCENTRY="1"LBL="Table 2-32: "Values for SRV_T_BULKTYPECOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="131*"COLNAME="C2" COLWIDTH="120*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Value COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_BULKLOADCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The client is preparing 
to transfer bulk copy 
data.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TEXTLOADCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The client is preparing 
to transfer text data.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_IMAGELOADCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The client is preparing 
to transfer image data.REMAP="BO--Body"It is not possible for Open Server to determine automatically the type of bulk data stream a client is sending. The Open Server application must obtain this information and give it to Open Server in advance of the actual SRV_BULK event, using the MOREINFO="NONE"srv_thread_props routine. The application then retrieves the data inside the SRV_BULK event handler, once the actual bulk request has been made.REMAP="BO--Body"For more information on bulk copy and text and image processing, see Chapter 3 of the Open Client and Open Server Common Libraries Reference Manual, and 
, the LINKEND="X12233"Text and Image
topics page. ID="X55200" RENDERAS="SECT3"Character Data Representation and SRV_T_CHARTYPEREMAP="BO--Body"A client application will expect character data to be represented in a particular way. An Open Server application can retrieve the client's expected character data representation by calling MOREINFO="NONE"srv_thread_props with property set to SRV_T_CHARTYPE and cmd set to CS_GET. The client will return of the following values in *bufp:TOCENTRY="1"LBL="Table 2-33: "Character Data RepresentationsCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="163*"COLNAME="C2" COLWIDTH="150*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CHAR_ASCIICOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ASCII character format.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CHAR_EBCDICCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"EBCDIC character format.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CHAR_UNKNOWNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Unknown character format.ID="X23355" RENDERAS="SECT3"Event Handlers and SRV_T_EVENTREMAP="BO--Body"A thread executes a particular event handler at any one time. A thread can be said to be inside an event when executing that event handler. An Open Server application can retrieve the event a thread is in by calling MOREINFO="NONE"srv_thread_props with property set to SRV_T_EVENT and cmd set to CS_GET. This is useful if an application uses the same event handler code for multiple events.REMAP="BO--Body"Possible events include:MARK="BULL" REMAP="BU--Bullet"SRV_ATTENTIONSRV_BULKSRV_CONNECTSRV_CURSORSRV_DISCONNECTSRV_DYNAMICSRV_LANGUAGESRV_MSGSRV_OPTIONSRV_RPCSRV_STARTSRV_STOPUser-defined eventsREMAP="BO--Body"For more information on events, see  the LINKEND="X78566"Events
topics page.ID="X76666" RENDERAS="SECT3"Floating Point Data Representation and SRV_T_FLTTYPEREMAP="BO--Body"A client application will expect floating point data to be represented a particular way. An Open Server application can retrieve the client's floating point representation by calling MOREINFO="NONE"srv_thread_props with property set to SRV_T_FLTTYPE and cmd set to CS_GET. The client returns one of the following values in the address space to which bufp points.MARK="BULL" REMAP="BU--Bullet"SRV_FLT_IEEE - IEEE floating point format.SRV_FLT_ND5000 - ND5000 floating point format.SRV_FLT_ VAX - VAX `D' floating point format.SRV_FLT_UNKNOWN - Unknown floating point format.ID="X61350" RENDERAS="SECT3"Login Types and SRV_T_LOGINTYPEREMAP="BO--Body"An Open Server application can receive any of several types of login records during the login process. The SRV_T_LOGINTYPE property indicates the login type. The application can call MOREINFO="NONE"srv_thread_props with property set to SRV_T_LOGINTYPE and cmd set to CS_GET to retrieve the login type, which is returned in the buffer to which bufp points. The following table describes each login type:TOCENTRY="1"LBL="Table 2-34: "Property Values and Login TypesCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="131*"COLNAME="C2" COLWIDTH="120*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Value COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Login TypeVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_SITEHANDLERCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A site handler login 
request from a remote 
server. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_SUBCHANNELCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A site handler 
subchannel login from a 
remote server.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CLIENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A login request from a 
client application.ID="XA97955" RENDERAS="SECT3"Notes on SRV_T_TDSVERSIONREMAP="BO--Body"During the client login process, Open Server negotiates with the client application to agree on a TDS version for all threads. The SRV_S_TDSVERSION property value determines Open Server's starting point. The client will agree to communicate at or below this starting point. See the LINKEND="X41578"Tailoring Your Open Server
topics page, for details on the SRV_S_TDSVERSION property. Later on in the login process, the Open Server application can renegotiate the TDS version for a particular thread, using the SRV_T_TDSVERSION property.REMAP="BO--Body"The following table describes the legal values for this property:TOCENTRY="1"LBL="Table 2-35: "Values for SRV_T_TDSVERSIONCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="145*"COLNAME="C2" COLWIDTH="151*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_TDSVERSION ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDSNONECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Unknown version of TDS.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_4.0COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Negotiation starts at TDS 4.0.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_4_0_2COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Negotiation starts at TDS 4.0.2.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_4_2COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Negotiation starts at TDS 4.2.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_4_6COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Negotiation starts at TDS 4.6.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_4_9_5COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Negotiation starts at TDS 4.9.5.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_5_0COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Negotiation starts at TDS 5.0.ID="X58007" RENDERAS="SECT3"Thread Types and SRV_T_TYPEREMAP="BO--Body"There are several types of Open Server threads. The SRV_T_TYPE thread property indicates the type of thread. An application can retrieve the thread's type by calling MOREINFO="NONE"srv_thread_props with property set to SRV_T_TYPE and cmd set to CS_GET. REMAP="BO--Body"The following table describes the legal thread types:TOCENTRY="1"LBL="Table 2-36: "Thread TypesCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="131*"COLNAME="C2" COLWIDTH="138*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Value COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Thread TypeVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TCLIENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A client threadCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TSITECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A site handler threadCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TSUBPROCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A remote server connection 
over a site handler threadCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TSERVICECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A service threadID="X13840" RENDERAS="SECT3"The SRV_RMTPWD StructureREMAP="BO--Body"An application uses the SRV_T_RMTPWDS property to obtain name/password pairs for a remote server. The pairs are stored in a SRV_T_RMTPWD structure which is defined as follows:ID="IN4217614054"Thread propertiesREMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"typedef struct srv_rmtpwd{      CS_INT servnamelen;    CS_BYTEservname[CS_MAX_NAME];    CS_INTpwdlen;    CS_BYTEpwd[CS_MAX_NAME];} SRV_RMTPWD;ID="IN429584355"DatatypesSee also Types
ID="IN425574456"TypesID="X87730" RENDERAS="SECT1"TypesREMAP="BO--Body"Open Server supports a wide range of datatypes. These datatypes are shared with CS-Library and Open Client Client-Library. In most cases, they correspond directly to SQL Server datatypes.REMAP="BO--Body"The "Datatype Summary" chart below lists the Open Server type definitions, together with the corresponding type constants and SQL Server datatypes. More detailed information on each datatype follows the chart.ID="IN4222544757"Datatype Summary tableREMAP="BO--Body"2.0 Open Server datatypes are included in this release for the sake of backward compatibility. 2.0 Server-Library routines must use 2.0 datatypes in this release. The following table summarizes the Open Server datatypes that all routines must use in future Open Server releases:TOCENTRY="1"LBL="Table 2-37: "Datatype SummaryCOLS="5" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="75*"COLNAME="C2" COLWIDTH="165*"COLNAME="C3" COLWIDTH="105*"COLNAME="C4" COLWIDTH="115*"COLNAME="C5" COLWIDTH="76*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Client/Server Type ConstantCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Corresponding Open 
Client/Server Type 
DefinitionCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CorrespondingServer 
DatatypeVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Binary 
typesCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_BINARY_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Binary typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_BINARYCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"binary,varbinaryCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_LONGBINARY_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Long binary typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_LONGBINARYCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NONECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_VARBINARY_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Variable-length binary typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_VARBINARYCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NONECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Bit typesCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_BIT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Bit typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_BITCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Boolean COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CharactertypesCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CHAR_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Character typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CHARCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"char,varcharCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_LONGCHAR_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Long character typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_LONGCHARCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NONECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_VARCHAR_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Variable-length character typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_VARCHARCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NONECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Datetime 
typesCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATETIME_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"8-byte datetime typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATETIMECOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"datetime COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATETIME4_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4-byte datetime typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATETIME4COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"smalldatetime COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Numeric 
typesCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TINYINT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1-byte integer typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TINYINTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"tinyint COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SMALLINT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"2-byte integer typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SMALLINTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"smallint COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_INT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4-byte integer typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"int COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DECIMAL_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Decimal typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DECIMALCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"decimal COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_NUMERIC_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Numeric typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_NUMERICCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"numeric COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FLOAT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"8-byte float typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FLOATCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"float COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REAL_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4-byte float typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REALCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"real COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Money 
typesCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_MONEY_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"8-byte money typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_MONEYCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"money COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_MONEY4_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4-byte money typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_MONEY4COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"smallmoney COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Security 
typesCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_BOUNDARY_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Secure SQL Server 
boundary typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CHARCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"boundary COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SENSITIVITY_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Secure SQL Server 
sensitivity typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CHARCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"sensitivity COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Text and 
image 
typesCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TEXT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Text typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TEXTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"text COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_IMAGE_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Image typeCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_IMAGECOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"imageREMAP="BO--Body"The MOREINFO="NONE"Preparing for Future Open Server Releases topics page includes a table mapping each 2.0 Open Server datatype to the corresponding new datatype.ID="IN429544758"Datatypesroutines that manipulateRENDERAS="SECT2"Routines That Manipulate DatatypesREMAP="BO--Body"CS-Library provides several routines that are useful for manipulating datatypes. They include:MARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"cs_calc, which performs arithmetic operations on decimal, float, money, numeric, and real datatypes.MOREINFO="NONE"cs_cmp, which compares datetime, decimal, float, money, numeric, and real datatypes.MOREINFO="NONE"cs_convert, which converts a data value from one datatype to another.MOREINFO="NONE"cs_dt_crack, which converts a machine readable datetime value into a user-accessible format.MOREINFO="NONE"cs_dt_info, which retrieves datetime information for a national language.REMAP="BO--Body"These routines are documented in the Open Client and Open Server Common Libraries Reference Manual.ID="IN429544759"DatatypesRENDERAS="SECT2"Open Server DatatypesID="IN4216544760"Binary datatypesRENDERAS="SECT3"Binary TypesREMAP="BO--Body"Open Server has three binary types, CS_BINARY, CS_LONGBINARY, and CS_VARBINARY. REMAP="BO--Body"CS_BINARY corresponds to the SQL Server types binary and varbinary. That is, Server-Library interprets both the server binary and varbinary types as CS_BINARY. For example, MOREINFO="NONE"srv_descfmt returns CS_BINARY_TYPE when retrieving a description of a binary parameter from a client.REMAP="BO--Body"CS_BINARY is defined as:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"typedef unsigned char     CS_BINARY;REMAP="BO--Body"CS_LONGBINARY does not correspond to any SQL Server type, but some Open Server applications may support CS_LONGBINARY. An application can use the CS_DATA_LBIN capability to determine whether a Client-Library connection supports CS_LONGBINARY.REMAP="BO--Body"A CS_LONGBINARY value has a maximum length of 2,147,483,647 bytes. CS_LONGBINARY is defined as:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"typedef unsigned char       CS_LONGBINARY;REMAP="BO--Body"CS_VARBINARY does not correspond to any SQL Server type. For this reason, Open Server routines do not return CS_VARBINARY_TYPE. If a datatype is described as CS_VARBINARY_TYPE Open Server automatically converts it to a nullable CS_BINARY_TYPE before sending it to a client. CS_VARBINARY_TYPE can only be used when binding program variables. CS_VARBINARY is provided to enable non-C programming language veneers to be written for Open Server. Typical server applications will not use CS_VARBINARY.REMAP="BO--Body"CS_VARBINARY is defined as:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"typedef struct _cs_varybin{    CS_SMALLINT      len;     CS_BYTE          array[CS_MAX_CHAR];  } CS_VARBINARY;       REMAP="UN--Under"where:REMAP="UN--Under"len is the length of the binary array.REMAP="UN--Under"array
 is the array itself.ID="IN4212544761"Bit datatypeRENDERAS="SECT3"Bit TypeREMAP="BO--Body"Open Server supports a single bit type, CS_BIT. This type is intended to hold server bit (or Boolean) values of 0 or 1. When converting other types to bit, all non-zero values are converted to 1:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"typedef unsigned char      CS_BIT;          ID="IN4219534862"Character datatypesRENDERAS="SECT3"Character TypesREMAP="BO--Body"Open Server has three character types, CS_CHAR, CS_LONGCHAR, and CS_VARCHAR:REMAP="BO--Body"CS_CHAR corresponds to the SQL Server types char and varchar. That is, Server-Library interprets both the server char and varchar types as CS_CHAR. For example, MOREINFO="NONE"srv_descfmt returns CS_CHAR_TYPE when retrieving the description of a character parameter from a client. REMAP="BO--Body"CS_CHAR is defined as:REMAP="CO-ComputerOutput" FORMAT="LINESPECIFIC"typedef char               CS_CHAR;  REMAP="BO--Body"CS_LONGCHAR does not correspond to any SQL Server type, but some Client-Library applications may support CS_LONGCHAR. An application can use the CS_DATA_LCHAR capability to determine whether a Client-Library connection supports CS_LONGCHAR.REMAP="BO--Body"A CS_LONGCHAR value has a maximum length of
2,147,483,647 bytes. CS_LONGCHAR is defined as:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"typedef unsigned char      CS_LONGCHAR;REMAP="BO--Body"CS_VARCHAR does not correspond to any SQL Server type. For this reason, Open Server routines do not return CS_VARCHAR_TYPE. If a datatype is described as CS_VARCHAR_TYPE Open Server automatically converts it to a nullable CS_CHAR_TYPE before sending it to a client. CS_VARCHAR_TYPE can only be used when binding program variables. CS_VARCHAR is provided to enable non-C programming language veneers to be written for Open Server. Typical server applications will not use CS_VARCHAR.REMAP="BO--Body"CS_VARCHAR is defined as:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"typedef struct _cs_varchar{    CS_SMALLINT          len;     CS_BYTE              str[CS_MAX_CHAR];  } CS_VARCHAR;REMAP="UN--Under"where:REMAP="UN--Under"len is the length of the string.REMAP="UN--Under"str is the string itself. Note that strID="IN4219524963"Character datatypes
 is not a null terminated string.ID="IN4218524964"Datetime datatypesRENDERAS="SECT3"Datetime TypesREMAP="BO--Body"Open Server supports two datetime types, CS_DATETIME and CS_DATETIME4. These datatypes are intended to hold 8-byte and 4-byte datetime values, respectively. REMAP="BO--Body"An Open Server application can use the CS-Library Routine MOREINFO="NONE"cs_dt_crack to extract date parts (year, month, day, and so on) from a datetime structure.REMAP="BO--Body"CS_DATETIME corresponds to the SQL Server datetime datatype. The range of legal CS_DATETIME values is from January 1, 1753 to December 31,9999, with a precision of 1/300th of a second (3.33 milliseconds):REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"typedef struct _cs_datetime{    CS_INT               dtdays;     CS_INT               dttime; } CS_DATETIME;             REMAP="UN--Under"where:REMAP="UN--Under"dtdays is the number of days since 1/1/1900.REMAP="UN--Under"dttime is the number of 300ths of a second since midnight.REMAP="BO--Body"CS_DATETIME4 corresponds to the SQL Server smalldatetime datatype. The range of legal CS_DATETIME4 values is from January 1, 1900, to June 6, 2079, with a precision of 1 minute:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"typedef struct _cs_datetime4{    unsigned short        days;     unsigned short        minutes; } CS_DATETIME4; REMAP="UN--Under"where:REMAP="UN--Under"days is the number of days since 1/1/1900.REMAP="UN--Under"minutes is the number of minutes since midnight.ID="IN4213524965"Integer typesRENDERAS="SECT3"Integer TypesREMAP="BO--Body"Open Server supports three integer types, CS_TINYINT, CS_SMALLINT, and CS_INT.REMAP="BO--Body"On most platforms, CS_TINYINT is a 1-byte integer; CS_SMALLINT is a 2-byte integer, and CS_INT is a 4-byte integer:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"typedef unsigned char        CS_TINYINT;  typedef short                CS_SMALLINT; typedef long                 CS_INT;      RENDERAS="SECT3"RealID="IN4213524966"Real datatype, FloatID="IN4214524967"Float datatype, NumericID="IN4216524968"Numeric datatype, and DecimalID="IN4216524969"Decimal datatype
 TypesREMAP="BO--Body"CS_REAL corresponds to the SQL Server datatype real. It is implemented as a platform-dependent C-language float type:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"typedef float                CS_REAL;      REMAP="BO--Body"CS_FLOAT corresponds to the SQL Server datatype float. It is implemented as a platform-dependent C-language double type:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"typedef double               CS_FLOAT;     REMAP="BO--Body"CS_NUMERIC and CS_DECIMAL correspond to the SQL Server datatypes numeric and decimal. These types provide platform-independent support for numbers with precision and scale.REMAP="BO--Body"The SQL Server datatypes numeric and decimal are equivalent; and CS_DECIMAL is defined as CS_NUMERIC:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"typedef struct  _cs_numeric{    CS_BYTE                  precision;    CS_BYTE                  scale;    CS_BYTE                  array[CS_MAX_NUMLEN];} CS_NUMERIC;   typedef CS_NUMERIC           CS_DECIMAL; REMAP="UN--Under"where:REMAP="UN--Under"precision is the precision of the numeric value. Legal values for precision are from CS_MIN_PREC to CS_MAX_PREC. The default precision is CS_DEF_PREC. CS_MIN_PREC, CS_MAX_PREC, and CS_DEF_PREC define the minimum, maximum, and default precision values, respectively.REMAP="UN--Under"scale is the scale of the numeric value. Legal values for scale are from CS_MIN_SCALE to CS_MAX SCALE. The default scale is CS_DEF_SCALE. CS_MIN_SCALE, CS_MAX_SCALE, and CS_DEF_PREC define the minimum, maximum, and default scale values, respectively.REMAP="UN--Under"scale must be less than or equal to precision.REMAP="BO--Body"CS_DECIMAL types use the same default values for precision and scale as CS_NUMERIC types. RENDERAS="SECT3"MoneyID="IN4215524970"Money datatypes
 TypesREMAP="BO--Body"Open Server supports two money types, CS_MONEY and CS_MONEY4. These datatypes are intended to hold 8-byte and 4-byte money values, respectively.REMAP="BO--Body"CS_MONEY corresponds to the SQL Server money datatype. The range of legal CS_MONEY values is between +/- $922,337,203,685,477.5807:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"typedef struct _cs_money{    CS_INT               mnyhigh;       CS_UINT              mnylow;  } CS_MONEY;CS_MONEY4 corresponds to the SQL Server smallmoney datatype. The range of legal CS_MONEY4 values is between -$214,748.3648 and +$214,748.3647:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"typedef struct _cs_money4{    CS_INT               mny4;} CS_MONEY4;  RENDERAS="SECT3"ID="IN4218524971"Security datatypes
Security TypesREMAP="BO--Body"Open Server supports Secure SQL Server's boundary and sensitivity types by defining the type constants CS_BOUNDARY_TYPE and CS_SENSITIVITY_TYPE. REMAP="BO--Body"These type constants differ from other Open Server type constants in that they do not correspond to similarly-named type definitions. Instead, they correspond to CS_CHAR.REMAP="BO--Body"This means that although Open Server routines accept and return CS_BOUNDARY_TYPE and CS_SENSITIVITY_TYPE to describe a column or variable's datatype, any corresponding program variable must be of type CS_CHAR.REMAP="BO--Body"For example, if an application calls MOREINFO="NONE"srv_bind with the datatype field of the CS_DATAFMT structure set to CS_SENSITIVITY_TYPE, the program variable to which the data is being bound must be of type CS_CHAR.RENDERAS="SECT3"TextID="IN4213524972"Text datatype
 and ImageID="IN4214524973"Image datatype
 TypesREMAP="BO--Body"Open Server supports a text datatype, CS_TEXT, and an image datatype, CS_IMAGE.REMAP="BO--Body"CS_TEXT corresponds to the server datatype text, which describes a variable-length column containing up to 2,147,483,647 bytes of printable character data. CS_TEXT is defined as unsigned character:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"typedef unsigned char         CS_TEXT;REMAP="BO--Body"CS_IMAGE corresponds to the server datatype image, which describes a variable-length column containing up to 2,147,483,647 bytes of binary data. CS_IMAGE is defined as unsigned character:ID="IN425515074"TypesREMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"typedef unsigned char         CS_IMAGE;REMAP="BO--Body"NUMBER="3" ID="X33333"RoutinesREMAP="BO--Body"This chapter contains a reference page for each Server-Library routine.ID="X95939"srv_alloc
Allocate memory. FORMAT="LINESPECIFIC"   CS_VOID *srv_alloc(size)CS_INT        size;ParametersREMAP="RI--RefIndent"size - The number of bytes to allocate. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_alloc allocates memory dynamically. It returns a pointer to size bytes if that many bytes are available. Any memory allocated using MOREINFO="NONE"srv_alloc should be freed by calling MOREINFO="NONE"srv_free. Use MOREINFO="NONE"srv_alloc wherever the standard C memory allocation routines would be used. Currently, MOREINFO="NONE"srv_alloc calls the C routine, malloc. A 10.0 Open Server application, however, can install its own memory management routines using the new MOREINFO="NONE"srv_props routine. The parameter-passing conventions of the user-installed routines must be the same as those of malloc. If the application is not configured to use user-installed routines, Open Server will call malloc.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*** Local Prototype*/CS_RETCODE     ex_srv_alloc PROTOTYPE((CS_BYTE        **bpp,CS_INT         size));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* ** EX_SRV_ALLOC****    Example routine to allocate the specified amount of memory**    using srv_alloc.**** Arguments:**    bpp     Return pointer to allocated memory here.**    size    Amount of memory to allocate.**** Returns:****    CS_SUCCEED            Memory was allocated successfully.**    CS_FAIL               An error was detected.*/CS_RETCODE            ex_srv_alloc(bpp, size)CS_BYTE              **bpp;CS_INT               size;{    /* Initialization. */    *bpp = (CS_BYTE *)NULL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*    ** Allocate size number of bytes.    */    if((*bpp = (CS_BYTE *)srv_alloc(size)) == (CS_BYTE *)NULL)    {        return(CS_FAIL);    }    return(CS_SUCCEED);}ReturnsREMAP="BO--Body"A pointer to the newly allocated space. If size bytes cannot be allocated, a null CS_VOID pointer is returned. See AlsoLINKEND="X68633"srv_free, 
LINKEND="X84669"srv_props, 
MOREINFO="NONE", LINKEND="X58541"srv_realloc
ID="IN4399489"srv_allocID="X22782"ID="INA4412911210"srv_alt_bind
srv_alt_bind
Describe and bind the source data for a compute row column.FORMAT="LINESPECIFIC"CS_RETCODE srv_alt_bind(spp, altid, item, osfmtp,              varaddr, varlenp, indp)  SRV_PROC         *spp;CS_INT           altid;CS_INT           item;CS_DATAFMT       *osfmtp;CS_BYTE          *varaddrp;CS_INT           *varlenp;CS_SMALLINT      *indp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.altid - The unique identifier for the compute row in which this compute column is contained. The altid is defined using MOREINFO="NONE"srv_alt_header.item - The column's column number in the compute row. Compute row column numbers start at 1.osfmtp - A pointer to a CS_DATAFMT structure. This structure describes the format of the compute row column data that the application program variable contains. varaddrp - A pointer to the program variable to which the outgoing data is bound.varlenp - A pointer to the program variable containing *varaddrp's length.indp - A pointer to the buffer containing the null value indicator. The following table summarizes the values *indp can contain:TOCENTRY="1"LBL="Table 3-1: "Values for indp (srv_alt_bind)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="135*"COLNAME="C2" COLWIDTH="171*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"IndicatesVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_NULLDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Column data is null.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GOODDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Column data is not null.REMAP="UN--Under"If indp is NULL, the column data is assumed to be valid; that is, not null. CommentsMARK="BULL" REMAP="BU--Bullet"Only applications that mimic SQL Server's feature of returning compute row information will need to call MOREINFO="NONE"srv_alt_bind. MOREINFO="NONE"srv_alt_bind is most useful to applications acting as a gateway to a SQL Server. MOREINFO="NONE"srv_alt_bind describes the format of the application program variable in which a compute row column's data is stored. An application must call it once for each column in a compute row. The MOREINFO="NONE"srv_alt_bind routine reads from (CS_GET) or sets (CS_SET) the CS_DATAFMT fields listed in the table below. All other fields are undefined for MOREINFO="NONE"srv_alt_bind. (Note that "osfmtp" is a pointer to the structure.)TOCENTRY="1"LBL="Table 3-2: "CS_DATAFMT Fields Used (srv_alt_bind)COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="102*"COLNAME="C2" COLWIDTH="145*"COLNAME="C3" COLWIDTH="163*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FieldCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SETCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GETVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"osfmtpname='rArrow' font='symbol' code='174'  charset='fontspecific'
datatypeCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Datatype of application 
program variableCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Datatype of application program 
variableCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"osfmtpname='rArrow' font='symbol' code='174'  charset='fontspecific'
maxlengthCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"UnusedCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Maximum length of program 
variableCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"osfmtpname='rArrow' font='symbol' code='174'  charset='fontspecific'
countCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0 or 1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0 or 1If the format described by osfmtp differs from the client format set with MOREINFO="NONE"srv_alt_descfmt (clfmtp), Open Server automatically converts the data to the client format.A compute result set contains only one row. However, an application can return multiple result sets, each with a distinct altid. To process compute row data, an Open Server application must:REMAP="UN--Under"1. Call MOREINFO="NONE"srv_alt_header to define a compute row identifier.REMAP="UN--Under"2. Call MOREINFO="NONE"srv_alt_descfmt for each column to describe the format the column data is in when the client receives it. REMAP="UN--Under"3. Call MOREINFO="NONE"srv_alt_bind for each column to bind the data to a local program variable.REMAP="UN--Under"4. Call MOREINFO="NONE"srv_alt_xferdata to send the row to the client, once each column in the compute row has been described and its data bound to a program variable.The contents of the buffers to which varaddrp, lenp, and indp point need not be valid until MOREINFO="NONE"srv_xferdata is called.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include
<ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*** Local prototype*/CS_RETCODE             ex_srv_alt_bind PROTOTYPE((SRV_PROC               *spp,CS_INT                 altid,CS_VOID                *sump));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*** EX_SRV_ALT_BIND****    Example routine to describe and bind the source data for**    a compute row column. This example binds a value which**    is the sum of the first column of row data.**** Arguments:**    spp    - A pointer to an internal thread control structure.**             The thread must be an active client thread that **             can handle row data.****    altid    -     The id for this compute row.****    sump    -    A pointer to the variable which will contain**                 the sum of the first column of row data.**** Returns:**     CS_SUCCEED - Compute row column was successfully bound.**     CS_FAIL    - An error was detected.***/CS_RETCODE          ex_srv_alt_bind(spp, altid, sump)SRV_PROC            *spp;CS_INT              altid;CS_VOID             *sump;{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_DATAFMT      compute_colfmt;     /*     **Format for this compute column.     */     CS_INT         namelen;     /*     **Length of compute column name     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_INT        compute_colnum;    /*    **    The column number for this compute column.    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_SMALLINT     indicator;    /*    **    Null indicator.    */    CS_INT            sumlen;    /*    **    Length of the compute value    */    CS_RETCODE        result;    /*    **Return value from srv_alt_bind.    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*    ** Initialize the compute column's data format. This compute     ** column represents a sum of the first column of data.    */    namelen = 3;    srv_bmove("sum", compute_colfmt.name, namelen);    compute_colfmt.namelen = namelen;    compute_colfmt.datatype = CS_INT_TYPE;    compute_colfmt.format = CS_FMT_UNUSED;    compute_colfmt.maxlength = sizeof(CS_INT);    compute_colfmt.scale = 0;    compute_colfmt.precision = CS_DEF_PREC;    compute_colfmt.status = 0;    compute_colfmt.count = 0;    compute_colfmt.usertype = 0;    compute_colfmt.locale = (CS_LOCALE *)NULL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*    ** Perform the bind    */    compute_colnum = 1;    indicator = CS_GOODDATA;    sumlen = sizeof(CS_INT);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    result = srv_alt_bind(spp, altid, compute_colnum,           &compute_colfmt, sump, &sumlen, &indicator);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return (result);}ReturnsREMAP="BO--Body"CS_SUCCEED if the bind succeeded.REMAP="BO--Body"CS_FAIL if an error was detected.See AlsoREMAP="BO--Body"LINKEND="X83339"srv_alt_descfmt
MOREINFO="NONE", LINKEND="X91904"srv_alt_header
MOREINFO="NONE", LINKEND="X70765"srv_alt_xferdata
MOREINFO="NONE", LINKEND="X78182"CS_DATAFMT Structure
ID="INA4412881518"srv_alt_bindID="X83339"ID="INA4515851919"srv_alt_descfmt
srv_alt_descfmt
Describe the aggregate operator of a compute row column and the format of the column data returned to the client.FORMAT="LINESPECIFIC"CS_RETCODE srv_alt_descfmt(spp, altid, optype,                 operand, item, clfmtp)SRV_PROC         *spp;CS_INT           altid;CS_INT           optype;CS_TINYINT       operand;CS_INT           item;CS_DATAFMT       *clfmtp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.altid - The unique identifier for the compute row in which this compute column is contained. The altid is defined using MOREINFO="NONE"srv_alt_header.item - The column's column number in the compute row. Compute row column numbers start at 1.optype - The aggregate operator type of the compute row column. The following table lists the legal operator types:TOCENTRY="1"LBL="Table 3-3: "Values for optype (srv_alt_descfmt) COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="123*"COLNAME="C2" COLWIDTH="227*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Operator TypeCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FunctionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OP_COUNTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Count aggregate operatorCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OP_SUMCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Sum aggregate operatorCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OP_AVGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Average aggregate operatorCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OP_MINCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Minimum aggregate operatorCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OP_MAXCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Maximum aggregate operatoroperand - The select-list column the aggregate is operating on.clfmtp - A pointer to the CS_DATAFMT structure. This structure describes the format the column data is in when the client receives it.CommentsMARK="BULL" REMAP="BU--Bullet"Only applications that mimic SQL Server's feature of returning compute row information will need to call MOREINFO="NONE"srv_alt_descfmt. MOREINFO="NONE"srv_alt_descfmt is most useful to applications acting as a gateway to a SQL Server. MOREINFO="NONE"srv_alt_descfmt describes a compute row column that the application will send to the client. The application calls it once for each column in the compute row.The MOREINFO="NONE"srv_alt_descfmt routine reads from (CS_GET) or sets (CS_SET) the CS_DATAFMT fields listed in the table below. All other fields are undefined for MOREINFO="NONE"srv_alt_descfmt. (Note that "clfmtp" is a pointer to the structure.)TOCENTRY="1"LBL="Table 3-4: "CS_DATAFMT Structure Fields Used (srv_alt_descfmt)COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="110*"COLNAME="C2" COLWIDTH="130*"COLNAME="C3" COLWIDTH="157*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FieldCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SETCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GETVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"clfmtpname='rArrow' font='symbol' code='174'  charset='fontspecific'
namelenCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Length of nameCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Length of nameCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"clfmtpname='rArrow' font='symbol' code='174'  charset='fontspecific' 
statusCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Parameter/column statusCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Parameter statusCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"clfmtpname='rArrow' font='symbol' code='174'  charset='fontspecific'
nameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Parameter/column nameCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Parameter nameCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"clfmtpname='rArrow' font='symbol' code='174'  charset='fontspecific'
datatypeCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Remote datatype set hereCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Remote datatype retrieved from hereCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"clfmtpname='rArrow' font='symbol' code='174'  charset='fontspecific'
maxlengthCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Maximum length of 
remote datatype set hereCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Maximum length of remote datatype 
retrieved from hereCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"clfmtpname='rArrow' font='symbol' code='174'  charset='fontspecific'
formatCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Remote datatype formatCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Remote datatype formats If the format described by clfmtp differs from the application program variable format subsequently described with MOREINFO="NONE"srv_alt_bind (osfmtp), Open Server automatically converts the data to the clfmtp format description.To process compute row data, an Open Server application must:REMAP="UN--Under"1. Call MOREINFO="NONE"srv_alt_header to define a compute row identifier.REMAP="UN--Under"2. Call MOREINFO="NONE"srv_alt_descfmt for each column to describe the format the column data is in when the client receives it. REMAP="UN--Under"3. Call MOREINFO="NONE"srv_alt_bind for each column to bind the data to a local program variable.REMAP="UN--Under"4. Call MOREINFO="NONE"srv_alt_xferdata to send the row to the client, once each column in the compute row has been described and its data bound to a program variable.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include       <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*** Local Prototype*/CS_RETCODE      ex_srv_alt_descfmt PROTOTYPE((SRV_PROC        *sproc,CS_INT          altid,CS_DATAFMT      clfmtp[]));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*** EX_SRV_ALT_DESCFMT**   An example routine to describe the aggregate operator of 2**   compute row columns and the format of each of the two column**   data returned to the client. We will do the sum on the first**   column and average on the second column.**** Arguments:**   sproc     A pointer to an internal thread control structure.**   altid     The id for the compute row in which this compute**             column is contained. The altid is obtained by**             calling srv_alt_header.**   clfmtp    A pointer to the array of structures describing **             the format of the compute row column**             data when the client receives it.**** Returns:**   CS_SUCCEED     If the aggregate operator and the datatype of**                  the compute row columns were successfully**                  described.**   CS_FAIL        An error was detected.*/CS_RETCODE     ex_srv_alt_descfmt(sproc, altid, clfmtp)SRV_PROC       *sproc;CS_INT         altid;CS_DATAFMT     clfmtp[];{      /*     ** Describe the aggregate operator of the first compute row     ** column and the format of the column data.     */     if ( srv_alt_descfmt(sproc, altid, (CS_INT)1, CS_OP_SUM,          (CS_TINYINT)1, &clfmtp[0]) == CS_FAIL )     {          return(CS_FAIL);     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*     ** Now do the same for the second column if (srv_alt_descfmt     ** (sproc, altid, (CS_INT)2, CS_OP_AVG, (CS_TINYINT)2,     ** &clfmtp[1]) == CS_FAIL )     {          return(CS_FAIL);     }     */          return(CS_SUCCEED);}ReturnsREMAP="BO--Body"CS_SUCCEED if the aggregate operator and datatype of the compute row column were successfully described.REMAP="BO--Body"CS_FAIL if an error was detected.See AlsoREMAP="BO--Body"LINKEND="X22782"srv_alt_bind
MOREINFO="NONE", LINKEND="X91904"srv_alt_header
MOREINFO="NONE", LINKEND="X70765"srv_alt_xferdata
MOREINFO="NONE", LINKEND="X78182"CS_DATAFMT Structure
ID="IN4515822227"srv_alt_descfmtID="X91904"ID="INA4614792628"srv_alt_header
srv_alt_header
Describe a compute row's row identifier and bylist.FORMAT="LINESPECIFIC"CS_RETCODE srv_alt_header(spp, altid, numbylist,                 bylistarrayp)SRV_PROC         *spp;CS_INT           altid;CS_INT           numbylist;CS_SMALLINT      *bylistarrayp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.altid - A unique identifier for this compute rowMOREINFO="NONE". numbylist - The number of columns in the bylist of a compute row.bylistarrayp - A pointer to an array of column numbers that make up the bylist for a compute row. There are as many elements as specified in numbylist. If numbylist is 0, bylistarrayp is ignored.CommentsMARK="BULL" REMAP="BU--Bullet"Only applications that mimic SQL Server's feature of returning compute row information will need to call MOREINFO="NONE"srv_alt_header. MOREINFO="NONE"srv_alt_header is most useful to applications acting as a gateway to a SQL Server. MOREINFO="NONE"srv_alt_header assigns a unique identifier to each compute row and describes the bylist associated with each compute row. It must be called once for each compute row.In the SQL Server, compute rows result from the MOREINFO="NONE"compute clause of a Transact- SQL MOREINFO="NONE"select statement. If a Transact -SQL MOREINFO="NONE"select statement contains multiple compute clauses, separate compute rows are generated by each clause. Open Server can return rows of compute data, mimicking a SQL Server's response to a Transact- SQL MOREINFO="NONE"compute clause.A Transact -SQLMOREINFO="NONE" select statement's MOREINFO="NONE"compute clause can contain the keyword
 MOREINFO="NONE"by, followed by a list of columns. This list, known as the "bylist," divides the results into subgroups, based on changing values in the specified columns. The MOREINFO="NONE"compute clause's aggregate operators are applied to each subgroup, generating a compute row for each subgroup.The array in *bylistarrayp stores the number associated with each column in the bylist. That number is determined by the column's position in the MOREINFO="NONE"select statement. For example, if a column were the third item in the MOREINFO="NONE"select statement, it would be listed as the number 3 in the array.To process compute row data, an Open Server application must:REMAP="UN--Under"1. Call MOREINFO="NONE"srv_alt_header to define a compute row identifier.REMAP="UN--Under"2. Call MOREINFO="NONE"srv_alt_descfmt for each column to describe the format the column data is in when the client receives it. REMAP="UN--Under"3. Call MOREINFO="NONE"srv_alt_bind for each column to bind the data to a local program variable.REMAP="UN--Under"4. Call MOREINFO="NONE"srv_alt_xferdata to send the row to the client, once each column in the compute row has been described and its data bound to a program variable.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include            <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*** Local Prototype*/CS_RETCODE           ex_srv_alt_header PROTOTYPE((SRV_PROC             *spp));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* ** EX_SRV_ALT_HEADER****     Example routine to illustrate the use of srv_alt_header**     to describe a compute row's row identifier and bylist.**** Arguments:**     spp - A pointer to an internal thread control structure.**** Returns:****   CS_SUCCEED     A compute row was successfully described.**   CS_FAIL        An error was detected.*/CS_RETCODE     ex_srv_alt_header(spp)SRV_PROC     *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{     CS_INT          altid;     CS_SMALLINT     bylist[2];REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*      ** Let us describe a fictitious compute row with altid =1,      ** and bylist = [2,4].     */     altid = (CS_INT)1;     bylist[0] = (CS_SMALLINT)2;     bylist[1] = (CS_SMALLINT)4;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if (srv_alt_header(spp, altid,          sizeof(bylist)/sizeof(CS_SMALLINT),               bylist) == CS_FAIL)          return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return (CS_SUCCEED);}ReturnsREMAP="BO--Body"CS_SUCCEED if an altid was assigned to the compute row and the bylist, if any, was described.REMAP="BO--Body"CS_FAIL if an error was detected.See AlsoREMAP="BO--Body"LINKEND="X22782"srv_alt_bind
MOREINFO="NONE", LINKEND="X83339"srv_alt_descfmt
MOREINFO="NONE",LINKEND="X70765"srv_alt_xferdataID="X70765"ID="IN4716763036"srv_alt_xferdata
srv_alt_xferdata
Send a compute row to a client.FORMAT="LINESPECIFIC"CS_RETCODE srv_alt_xferdata(spp, altid)FORMAT="LINESPECIFIC"SRV_PROC     *spp;FORMAT="LINESPECIFIC"CS_INT        altid;ParametersREMAP="RI--RefIndent"spp- A pointer to an internal thread control structure.altid- The unique identifier for the compute row being sent to the client. The altid is defined using MOREINFO="NONE"srv_alt_header.CommentsMARK="BULL" REMAP="BU--Bullet"Only applications that mimic SQL Server's feature of returning compute row information will need to call MOREINFO="NONE"srv_alt_xferdata. MOREINFO="NONE"srv_alt_xferdata is most useful to applications acting as a gateway to a SQL Server. MOREINFO="NONE"srv_alt_xferdata sends a compute row to the client. It is called once for each altid. To process compute row data, an Open Server application must:REMAP="UN--Under"1. Call MOREINFO="NONE"srv_alt_header to define a compute row identifier.REMAP="UN--Under"2. Call MOREINFO="NONE"srv_alt_descfmt for each column to describe the format the column data is in when the client receives it. REMAP="UN--Under"3. Call MOREINFO="NONE"srv_alt_bind for each column to bind the data to a local program variable.REMAP="UN--Under"4. Call MOREINFO="NONE"srv_alt_xferdata to send the row to the client, once each column in the compute row has been described and its data bound to a program variable.All compute rows must be sent to the client before sending the completion status with MOREINFO="NONE"srv_senddone.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include          <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*** Local Prototype.*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_alt_xferdata PROTOTYPE((SRV_PROC        *spp,CS_INT          altid));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_ALTXFERDATAREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Example routine to send a compute row the the client using**     srv_altxferdata.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     spp     A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  altid      The compute row identifier (defined using**             srv_alt_header).**** Returns:****    CS_SUCCEED    The row was sent to the client.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/CS_RETCODE          ex_srv_alt_xferdata(spp, altid)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          altid;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Send the compute row to the client.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if (srv_alt_xferdata(spp, altid) != CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return (CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the row was sent to the client.REMAP="BO--Body"CS_FAIL if an error was detected.See AlsoREMAP="BO--Body"LINKEND="X22782"srv_alt_bind
MOREINFO="NONE", LINKEND="X91904"srv_alt_header
MOREINFO="NONE", LINKEND="X83339"srv_alt_descfmt
ID="IN4716733344"srv_alt_xferdataID="X30757"ID="IN488703745"srv_bind
srv_bind
Describe and bind a program variable for a column or parameter. FORMAT="LINESPECIFIC"CS_RETCODE srv_bind(spp, cmd, type, item, osfmtp,FORMAT="LINESPECIFIC"                 varaddrp, varlenp, indp)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_INT           cmd;FORMAT="LINESPECIFIC"CS_INT           type;FORMAT="LINESPECIFIC"CS_INT           item;FORMAT="LINESPECIFIC"CS_DATAFMT       *osfmtp;FORMAT="LINESPECIFIC"CS_BYTE          *varaddrp;FORMAT="LINESPECIFIC"CS_INT           *varlenp;FORMAT="LINESPECIFIC"CS_SMALLINT      *indp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.cmd - cmd indicates whether the program variable stores data going out to a client or coming in from a client. The following table describes the legal values for cmd:TOCENTRY="1"LBL="Table 3-5: "Values for cmd (srv_bind)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="108*"COLNAME="C2" COLWIDTH="252*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Data in the *varaddrp is sent to a client when 
MOREINFO="NONE"srv_xferdata is calledCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"*varaddrp is initialized with data from a client after a 
call to MOREINFO="NONE"srv_xferdatatype - The type of data stored into or read from the program variable. The following table describes the legal values for type:TOCENTRY="1"LBL="Table 3-6: "Values for type (MOREINFO="NONE"srv_bind)COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="117*"COLNAME="C2" COLWIDTH="135*"COLNAME="C3" COLWIDTH="99*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TypeCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Valid cmdCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Description of DataVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_RPCDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SET or CS_GETCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"RPC or stored 
procedure 
parameter COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_ROWDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SET onlyCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Result row columnCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CURDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GET onlyCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Cursor parameterCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_KEYDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GET onlyCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Cursor key columnCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_ERRORDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SET onlyCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Error message 
parameter COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DYNAMICDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SET or CS_GETCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Dynamic SQL 
parameterCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NEGDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SET or CS_GETCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Negotiated login 
parameterCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MSGDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SET or CS_GETCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Message parameteritem - The column or parameter number. Column and parameter numbers start at 1.osfmtp - A pointer to a CS_DATAFMT structure. This structure describes the format of the data stored in *varaddrp. varaddrp - A pointer to the program variable to which the column or parameter data is bound.varlenp - A pointer to the length of varaddrp. Its precise meaning and characteristics differ depending on the value of cmd. The following table summarizes the legal values for varlenp:TOCENTRY="1"LBL="Table 3-7: "Values for varlenp (srv_bind)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="117*"COLNAME="C2" COLWIDTH="279*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If cmd isCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Then varlenpVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SET(data going out to 
client)COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"- cannot be NULL- points to the actual length of the data in *varaddrp- need not be valid until MOREINFO="NONE"srv_xferdata is calledCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GET(data coming in from 
client)COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"- can be NULL (indicating that the Open Server application 
already knows the length of the data)- is a pointer to the program variable in which Open Server 
places the actual length of the data- is filled in after a call to MOREINFO="NONE"srv_xferdataREMAP="UN--Under"When retrieving data, *varlenp is empty until the application calls MOREINFO="NONE"srv_xferdata. Open Server then fills the buffer with the length of the newly received value. When sending data, an application fills in *varlenp points before calling MOREINFO="NONE"srv_xferdata to send the data.indp - A pointer to a buffer containing a null value indicator. The following table lists the legal values for *indp:TOCENTRY="1"LBL="Table 3-8: "Values for indp (srv_bind)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="90*"COLNAME="C2" COLWIDTH="184*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"IndicatesVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_NULLDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Column or parameter data is null.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GOODDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Column or parameter data is not null.REMAP="UN--Under"If indp is NULL, the column data is assumed to be valid; that is, not null.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_bind describes the format of a row column or parameter and associates it with an application program variable.MOREINFO="NONE"srv_bind must be called once for each column in a results row or parameter in a parameter stream.Applications that want to change local program variable addresses (varaddrp, varlenp, or indp) between sending rows must call MOREINFO="NONE"srv_bind followed by MOREINFO="NONE"srv_xferdata each time such a change occurs.Error data parameters must be described (MOREINFO="NONE"srv_descfmt), bound (MOREINFO="NONE"srv_bind) and sent to the client (MOREINFO="NONE"srv_xferdata) immediately after a call to MOREINFO="NONE"srv_sendinfo and before calling MOREINFO="NONE"srv_senddone. The type argument of the MOREINFO="NONE"srv_descfmt, MOREINFO="NONE"srv_bind, and MOREINFO="NONE"srv_xferdata routines is set to SRV_ERRORDATA.Message data parameters must be described (MOREINFO="NONE"srv_descfmt), bound (MOREINFO="NONE"srv_bind), and transferred (MOREINFO="NONE"srv_xferdata) following a call to the MOREINFO="NONE"srv_msg routine. The type argument of the MOREINFO="NONE"srv_descfmt, MOREINFO="NONE"srv_bind, and MOREINFO="NONE"srv_xferdata routines is set to SRV_MSGDATA.The MOREINFO="NONE"srv_bind routine reads from (CS_GET) or sets (CS_SET) the CS_DATAFMT fields listed in the table below. All other fields are undefined for MOREINFO="NONE"srv_bind. (Note that "osfmtp" is a pointer to the structure.).TOCENTRY="1"LBL="Table 3-9: "CS_DATAFMT Fields Used (srv_bind)COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="110*"COLNAME="C2" COLWIDTH="130*"COLNAME="C3" COLWIDTH="157*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FieldCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"In CS_SET operations, it is:COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"In CS_GET operations, it is:VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"osfmtpname='rArrow' font='symbol' code='174'  charset='fontspecific'
datatypeCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Datatype of application 
program variableCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Datatype of application program 
variableCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"osfmtpname='rArrow' font='symbol' code='174'  charset='fontspecific'
maxlengthCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"UnusedCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Maximum length of program 
variableCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"osfmtpname='rArrow' font='symbol' code='174'  charset='fontspecific'
countCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0 or 1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0 or 1If the format described by osfmtp differs from the format of the data received from the client (cmd set to CS_GET), Open Server automatically converts the data to osfmtp. If it differs from the format in which the data is sent to the client (cmd set to CS_SET), Open Server automatically converts it to the client format (clfmtp). ID="IN488674050"srv_bind
MOREINFO="NONE"srv_bind and the new routine MOREINFO="NONE"srv_descfmt extend and replace the functionality of the MOREINFO="NONE"srv_describe and MOREINFO="NONE"srv_returnval routines.MOREINFO="NONE"srv_bind and the new routines MOREINFO="NONE"srv_descfmt and MOREINFO="NONE"srv_xferdata extend and replace the functionality of the MOREINFO="NONE"srv_paramdata routine.MOREINFO="NONE"srv_bind also replaces the functionality of the MOREINFO="NONE"srv_setcoldata, MOREINFO="NONE"srv_setcollen, and MOREINFO="NONE"srv_paramset routines.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_bind PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC               *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT                 *nump,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_BYTE                *namep,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT                 *lenpREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_BINDREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Example routine using srv_bind to describe and bind two**     program.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     variables to receive client RPC parameters. For this**     example, theREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     RPC is passed an employee number, and last name. A third**     program. REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     variable will be bound to receive the length of the**     employee's name.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     This routine is called prior to srv_xferdata, which will**     actually transfer the data into the program variables.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     spp     A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     nump    A Pointer to the integer to receive the employee**             number.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     namep   A Pointer to the memory area to receive the**             employee name.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    lenp     A Pointer to the integer to receive the length of**             the employee's name. (On input, points to the**             maximum length of the memory area available.)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    Program variables were successfully bound.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_bind(spp, nump, namep, lenp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          *nump;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_BYTE         *namep;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          *lenp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_INT               param_no;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_DATAFMT           varfmt;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     srv_bzero((CS_VOID *)&varfmt, (CS_INT)sizeof(varfmt));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** First, bind the integer to receive the employee number,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** param 1. Here, we know the length of the data, so noREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** length pointer is required.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     param_no = 1;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     varfmt.datatype = CS_INT_TYPE;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     varfmt.maxlength = (CS_INT)sizeof(CS_INT);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if (srv_bind(spp, (CS_INT)CS_GET, (CS_INT)SRV_RPCDATA,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          param_no, &varfmt, (CS_BYTE *)nump, (CS_INT *)NULL,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          (CS_SMALLINT *)NULL) != CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Then, bind the character memory to receive the     ** employee name, param 2.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     param_no = 2;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     varfmt.datatype = CS_CHAR_TYPE;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     varfmt.maxlength = *lenp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if (srv_bind(spp, (CS_INT)CS_GET, (CS_INT)SRV_RPCDATA,          param_no,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          &varfmt, namep, lenp, (CS_SMALLINT *)NULL) !=          CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the bind succeeded.REMAP="BO--Body"CS_FAIL if an error was detected.See AlsoREMAP="BO--Body"LINKEND="X19525"srv_cursor_props
MOREINFO="NONE", LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X77646"srv_msg
MOREINFO="NONE", LINKEND="X37615"srv_sendinfo
MOREINFO="NONE", LINKEND="X52699"srv_xferdata
MOREINFO="NONE", LINKEND="X78182"CS_DATAFMT Structure
MOREINFO="NONE", LINKEND="X25021"Processing Parameter and Row DataID="X84125"ID="IN499644454"srv_bmove
srv_bmove
Copy bytes from one memory location to another. FORMAT="LINESPECIFIC"CS_VOID srv_bmove(sourcep, destp, count)FORMAT="LINESPECIFIC"CS_VOID         *sourcep;FORMAT="LINESPECIFIC"CS_VOID         *destp;FORMAT="LINESPECIFIC"CS_INT          count;ParametersREMAP="RI--RefIndent"sourcep - A non-null pointer to the source of the data to be copied. destp - A non-null pointer to the destination for the data to be copied. count - The number of bytes to copy from sourcep to destp.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_bmove copies count bytes from the memory location *sourcep to the memory location *destp. Both sourcep and destp must be valid non-null pointers or a memory fault will occur. Only count bytes are moved and no null terminator is added. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID          ex_srv_bmove PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID          *src,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID          *dest,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT           countREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_BMOVEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Example routine to copy data from one area of memory to       another.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     src     - The address of the source data.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     dest    - The address of the destination buffer.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     count   - The number of bytes to copy.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**          Nothing.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID          ex_srv_bmove(src, dest, count)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID          *src;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID          *dest;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT           count;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Call the Open Server routine that will do the     ** actual copy.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     srv_bmove(src, dest, count);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** All done.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"None. See AlsoREMAP="BO--Body"LINKEND="X11717"srv_bzero
ID="IN499614762"srv_bmoveID="X11717"ID="IN509585163"srv_bzero
srv_bzero
Set the contents of a memory location to zero. FORMAT="LINESPECIFIC"CS_VOID srv_bzero(locationp, count)FORMAT="LINESPECIFIC"CS_VOID         *locationp;FORMAT="LINESPECIFIC"CS_INT          count;ParametersREMAP="RI--RefIndent"locationp - A non-null pointer to the address of the buffer to be zeroed. count - The number of bytes at locationp to set to 0x00. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_bzero sets count bytes to the value 0x00 at memory location locationp. locationp must be a valid non-null pointer or a memory fault will occur. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include          <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE           ex_srv_bzero PROTOTYPE((CS_VOID              *locationp,CS_INT               cnt))REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_BZEROREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Example routine to set the contents of a section of memory**     to zero using srv_bzeroREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     memp          Pointer to section of memory.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     count         Number of bytes to set to zero.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** ReturnsREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_SUCCEED     Arguments were valid and srv_bzero called.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_FAIL        An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_bzero(memp, count)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID         *memp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          count;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Check arguments. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if(memp == (CS_VOID *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if(count < 0)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Set the section of memory to the value 0x00.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     (CS_VOID)srv_bzero(memp,count);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"None. See AlsoREMAP="BO--Body"LINKEND="X84125"srv_bmove
ID="IN509555471"srv_bzeroID="X97955"ID="IN5112525872"srv_callback
srv_callback
Install a state transition handler for a thread. FORMAT="LINESPECIFIC"CS_RETCODE srv_callback(spp, callback_type, funcp)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_INT           callback_type;FORMAT="LINESPECIFIC"CS_RETCODE       (*funcp)();ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.callback_type - An integer that indicates the state transition for which the callback is being installed. The following table summarizes the legal values for callback_type: TOCENTRY="1"LBL="Table 3-10: "Values for callback_type (srv_callback)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="108*"COLNAME="C2" COLWIDTH="252*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_EXITCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The thread has returned from the entry point specified 
in MOREINFO="NONE"srv_spawn or is associated with a disconnected client. 
The handler is executed in the context of the exiting 
thread. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_PROCEXECCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A registered procedure has been invoked and is about 
to execute. The handler executes in the context of the 
thread that requested the registered procedure. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_RESUMECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The thread is resuming. The handler executes in the 
scheduler thread's context and uses its stack. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_SUSPENDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The thread is suspending. The handler executes in the 
context of the thread that is suspending and uses its 
stack. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_TIMESLICECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The callback routine you install for this state transition 
is called when a thread has executed for a period of 
time (time slice) determined by the 
SRV_S_TIMESLICE, SRV_S_VIRTCLKRATE, and 
SRV_S_VIRTTIMER server properties. See the 
MOREINFO="NONE"srv_props reference page and the MOREINFO="NONE"Tailoring Your Open 
Server topics page for more information about these 
parameters. funcp - A pointer to the function to call when the specified state transition occurs.REMAP="UN--Under"A callback function takes a thread pointer argument. CommentsMARK="BULL" REMAP="BU--Bullet"Use MOREINFO="NONE"srv_callback to specify a routine to execute when a thread passes from one state to another. An application calls the callback routine with a pointer to the thread that is changing states. The following table summarizes the value each type of callback routine should return:TOCENTRY="1"LBL="Table 3-11: "Valid Returns for Callback Routines (srv_callback)COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="144*"COLNAME="C2" COLWIDTH="117*"COLNAME="C3" COLWIDTH="90*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Type of Callback RoutineCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Return ValueCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Description of 
Return ValueVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_EXITCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Ignored by Open 
Server, but should be 
set to SRV_CONTINUE 
for the sake of future 
compatibility.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_PROCEXECCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_INHIBITCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Cancel execution 
of the registered 
procedure.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_CONTINUECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Continue 
execution of the 
registered 
procedure.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_RESUMECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Ignored by Open 
Server, but should be 
set to SRV_CONTINUE 
for the sake of future 
compatibility.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_SUSPENDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Ignored by Open 
Server, but should be 
set to SRV_CONTINUE 
for the sake of future 
compatibility.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_TIMESLICECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CONTINUECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Continue 
execution 
uninterrupted.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TERMINATECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Terminate the 
thread. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEBUGCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Add the thread 
to the debug 
queue for 
subsequent 
examination with 
a debugger.Some callback types are not available on some platforms. You can call MOREINFO="NONE"srv_capability to find out if a handler can be installed for a callback type on the current platform. To remove a callback routine installed by a previous call to MOREINFO="NONE"srv_callback, install a null function in its place. For example, to de-install a previously SRV_C_TIMESLICE handler, issue the following command: REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"     srv_callback(spp, SRV_C_TIMESLICE, NULL); Set the funcp argument to NULL if your application will use the callback handler for notifications only. See the LINKEND="X80111"Registered Procedures
topics page, for more details.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include          <stdio.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include          <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE        suspend_handler PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC          *srvprocREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE ex_srv_callback PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC          *srvprocREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     suspend_handler(srvproc)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC       *srvproc;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     printf("Wake me when it's over...\n");REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_CALLBACKREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Example routine to install a state transition handler.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   srvpro  - A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_SUCCEEDREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_FAILREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE          ex_srv_callback(srvproc)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC            *srvproc;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return(srv_callback(srvproc, SRV_C_SUSPEND,                suspend_handler));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X77376"srv_capability
MOREINFO="NONE", LINKEND="X71144"srv_config
MOREINFO="NONE", LINKEND="X84669"srv_props
MOREINFO="NONE", LINKEND="X75457"srv_termproc
ID="IN5112496180"srv_callbackID="X77376"ID="IN5214466581"srv_capability
srv_capability
Determine whether Open Server supports a platform-dependent service. FORMAT="LINESPECIFIC"CS_BOOL srv_capability(capability)FORMAT="LINESPECIFIC"CS_INT         capability;ParametersREMAP="RI--RefIndent"capability - A constant that represents the Open Server services to test. The following table describes the legal values for capability: TOCENTRY="1"LBL="Table 3-12: "Values for capability (srv_capability)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="103*"COLNAME="C2" COLWIDTH="255*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_DEBUGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"srv_dbg_stack and MOREINFO="NONE"srv_dbg_switch are supported. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_EXITCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A callback routine can be invoked when a thread 
terminates. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_RESUMECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A callback routine can be invoked when a thread 
resumes execution. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_PREEMPTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Preemptive scheduling is supported. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_SELECTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"srv_select is supported. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_SUSPENDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A callback routine can be invoked when a thread is 
suspended. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_C_TIMESLICECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A callback routine can be invoked when a thread 
exceeds the maximum number of clock ticks. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_POLLCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"srv_poll is supported.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_capability allows you to write a portable Open Server application program and still use services that are not available on all platforms. Open Server 10.0 has two types of capabilities: platform capabilities and protocol capabilities. The MOREINFO="NONE"srv_capability routine pertains to platform capabilities. The MOREINFO="NONE"srv_capability_info routine pertains to protocol capabilities. See the LINKEND="X96053"srv_capability_info
 reference page, for details.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include          <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"extern CS_RETCODE ex_srv_capability PROTOTYPE((void));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_CAPABILITYREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Example routine to determine whether srv_poll is supported        on this platform.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     None.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_SUCCEED   srv_poll is supported on this platform.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_FAIL      srv_poll is not supported on this platform.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE          ex_srv_capability()REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_BOOL supported;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Check to see whether srv_poll is supported on this      ** platform.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     supported = srv_capability(SRV_C_POLL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return(supported ? CS_SUCCEED : CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_TRUE or CS_FALSE. See AlsoREMAP="BO--Body"LINKEND="X97955"srv_callback
, 
LINKEND="X77376"srv_capability
MOREINFO="NONE", LINKEND="X68955"srv_dbg_stack
MOREINFO="NONE", LINKEND="X23034"srv_dbg_switch
MOREINFO="NONE", LINKEND="X88281"srv_poll (UNIX only)
MOREINFO="NONE", LINKEND="X24148"srv_select (UNIX only)
ID="IN5219436889"srv_capability_info
, LINKEND="X96053"srv_capability_infoID="X96053"srv_capability_info     
Define or retrieve capability information on a client connection.FORMAT="LINESPECIFIC"CS_RETCODE srv_capability_info(spp, cmd, type,FORMAT="LINESPECIFIC"              capability, valp)FORMAT="LINESPECIFIC"SRV_PROC      *spp;FORMAT="LINESPECIFIC"CS_INT        cmd;FORMAT="LINESPECIFIC"CS_INT        type;FORMAT="LINESPECIFIC"CS_INT        capability;FORMAT="LINESPECIFIC"CS_VOID       *valp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.cmd - cmd indicates whether the Open Server application is defining or retrieving the capability information. The following table describes the legal values for cmd:TOCENTRY="1"LBL="Table 3-13: "Values for cmd (srv_capability_info)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="108*"COLNAME="C2" COLWIDTH="252*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The Open Server application is defining capability 
information.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The Open Server application is retrieving capability 
information from the client.type - The capability group type. The following table summarizes the two legal types:TOCENTRY="1"LBL="Table 3-14: "Values for type (srv_capability_info)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="108*"COLNAME="C2" COLWIDTH="252*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CAP_REQUESTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The possible commands a client may want to send.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CAP_RESPONSECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The possible responses a client may want an Open 
Server application to withhold.capability - Specifies the capability item of interest. To set or get the bitmap for all capability items in a type category, set capability to CS_ALL_CAPS. See the MOREINFO="NONE"Capabilities topics page, for a list of all request and response capabilities.valp - A pointer to a program variable. When sending information to a client (CS_SET), the application sets the capability value in this variable. When retrieving information from a client, (CS_GET), Open Server places the capability value in this variable. valp should be a CS_BOOL pointer when the application is defining or retrieving individual capability items, and a CS_CAP_TYPE pointer when the application is defining or retrieving the full bitmap for all capability items (i.e., capability is CS_ALL_CAPS).CommentsMARK="BULL" REMAP="BU--Bullet"An Open Server application and a client must agree on what requests the client can issue and what responses the Open Server application will return. A client/server connection's capabilities determine the types of client requests and server responses permitted for that connection.Open Server assigns a default set of capabilities for all connections. An Open Server application that does not want the default set of capabilities to apply to a given connection can call MOREINFO="NONE"srv_capabilities_info to negotiate explicitly a different set of capabilities.See  the LINKEND="X89653"Capabilities
 topics pages, for a list of the default set of requests and response capabilities.Response capabilities indicate the kinds of responses the client does not want to receive.Open Server 10.0 has two types of capabilities: platform capabilities and protocol capabilities. The MOREINFO="NONE"srv_capability routine pertains to platform capabilities. The MOREINFO="NONE"srv_capability_info routine pertains to protocol capabilities. For more information on MOREINFO="NONE"srv_capability, see its reference page.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_capability_info PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC       *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_CAPABILITY_INFOREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Example routine to retrieve and define capability **     information on a client connection.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     This routine must called in the context of the connect**     handler, so that it is legal to negotiate capabilities.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     spp  A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**      CS_SUCCEED - Successfully retrieved and bound capability**                   information.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**      CS_FAIL - An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE               ex_srv_capability_info(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC                 *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_RETCODE       retval;  /* Return value from Open */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                               /* Server API calls. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_CAP_TYPE      capabilities;  /* Our bit mask. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_BOOL     value; /* Set to CS_TRUE or CS_FALSE */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                        /* for individual capabilities. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** In this example, we don't want to support text or image,     ** so we'll see first if the client has requested this.     ** We'll do this by getting the entire bit mask.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     retval = srv_capability_info(spp, CS_GET, CS_CAP_REQUEST,                         CS_ALL_CAPS, (CS_VOID *)&capabilities);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if (retval == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Turn off text and image. REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     **REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** The other way to do this is to just clear the     ** CS_DATA_TEXT and CS_DATA_IMAGE bits in the capabilities     ** bit mask, and then call srv_capability_info() with     ** CS_ALL_CAPS for the "type" parameter and the altered     ** bit mask as the value.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if (CS_TST_CAPMASK(&capabilities, CS_DATA_TEXT) == CS_TRUE)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          value = CS_FALSE;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          retval = srv_capability_info(spp, CS_SET,               CS_CAP_REQUEST, CS_DATA_TEXT, (CS_VOID *)&value);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          if (retval == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"               return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if (CS_TST_CAPMASK(&capabilities, CS_DATA_IMAGE) == CS_TRUE)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          value = CS_FALSE;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          retval = srv_capability_info(spp, CS_SET,                    CS_CAP_REQUEST, CS_DATA_IMAGE, (CS_VOID*)                    &value);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          if (retval == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"               return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return (CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the capability bit mask was successfully defined or returned.REMAP="BO--Body"CS_FAIL if an error was detected.See AlsoREMAP="BO--Body"LINKEND="X77376"srv_capability
MOREINFO="NONE", LINKEND="X84669"srv_props
MOREINFO="NONE", LINKEND="X89653"Capabilities
MOREINFO="NONE", LINKEND="X41578"Tailoring Your Open Server
ID="IN5319407297"srv_capability_infoID="X71144"ID="IN5410377698"srv_config
srv_config
Set server configuration parameters. FORMAT="LINESPECIFIC"CS_RETCODE srv_config(scp, option, valuep, valuelen)FORMAT="LINESPECIFIC"SRV_CONFIG      *scp;FORMAT="LINESPECIFIC"CS_INT          option;FORMAT="LINESPECIFIC"CS_CHAR         *valuep;FORMAT="LINESPECIFIC"CS_INT          valuelen;ParametersREMAP="RI--RefIndent"scp - A pointer to the configuration structure that holds the values of all the Open Server configuration options. MOREINFO="NONE"srv_init uses it to initialize Open Server. option - The configuration option to set. See the "Options" section below. valuep - A pointer to the new value of the configuration option. valuep is a character string pointer. If *valuep contains "0", Open Server sets option to its default value. If *valuep contains "ZERO" Open Server sets option to the numeric value 0. valuelen - The length, in bytes, of the string in *valuep. If the string is null terminated, valuelen can be set to CS_NULLTERM. OptionsREMAP="BO--Body"The table below lists the configuration options, their default values, and, if applicable, their minimum and maximum values. These constants are defined in the oscompat.h header file. Descriptions of the configuration options follow the table. TOCENTRY="1"LBL="Table 3-15: "Configuration Option Defaults and Legal Values (srv_config)COLS="4" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="151*"COLNAME="C2" COLWIDTH="201*"COLNAME="C3" COLWIDTH="141*"COLNAME="C4" COLWIDTH="201*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"OptionCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DefaultCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MinimumCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Maximum VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CONNECTIONSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_CONNECTIONSCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAX_FDS COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_LOGFILECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0""srv.log"COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"-COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"- COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAXNETBUFCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_MAXNETBUFCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_MAX
NETBUFCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAX_MAXNETBUF COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MSGPOOLCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_MSGMAXCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_MSG
MAXCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAX_MSGMAX COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MSGQUEUESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_MSGQUEUESCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAX_MSGQUEUES COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MUTEXESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_MUTEXESCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAX_MUTEXES COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_PREEMPTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"-COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"- COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_REMPREREADCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_REMPREREADCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAX_REMPREREADCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_REMSITESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_REMSITESCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAX_REMSITES COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_SRVPROCSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_SRVPROCSCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAX_SRVPROCS COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_STACKSIZECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_STACKSIZECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MIN_STACKSIZECOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAX_STACKSIZE COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TIMESLICECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_TIMESLICECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAX_TIMESLICE COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_USEREVENTSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_USEREVENTSCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAX_USEREVENTS COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_VIRTCLKRATECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_VIRTCLKRATECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAX_VIRTCLKRATECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_VIRTTIMERCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"-COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"- REMAP="BO--Body"The following table describes the configuration options currently available: TOCENTRY="1"LBL="Table 3-16: "Descriptions of Configuration Options (srv_config)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="114*"COLNAME="C2" COLWIDTH="352*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CONNECTIONSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The maximum number of physical network connections the server will 
accept. value must be a positive integer. The actual number of possible 
connections depends upon the platform configuration and resources. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_LOGFILECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The name of the file in which to write Open Server messages. Open Server 
messages are appended to the log file. The default name is srv.log. The log file 
can be changed dynamically by calling MOREINFO="NONE"srv_config with this option and 
specifying a new file name in value. Open Server then closes the current log file 
and opens the new log file. To eliminate a log file, call MOREINFO="NONE"srv_config with an 
empty string ("") or with valuelen set to 0. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAXNETBUFCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The maximum size of a network buffer for a thread. The actual size is 
determined when the client connects to the Open Server application. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MSGQUEUESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of message queues to allocate when the Open Server application 
starts up. This number does not include message queues created for internal 
use by the run-time system. However, a message queue is created for each 
thread (see SRV_SRVPROCS) created by an application and each client 
connection (see SRV_CONNECTIONS), so the configured value of 
SRV_MSGQUEUES should always be greater than or equal to the sum of the 
configured values for SRV_SRVPROCS and SRV_CONNECTIONS.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MSGPOOLCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of message structures to allocate when the Open Server 
application starts up. This should always be greater than or equal to the 
product of the configured value for SRV_MSGQUEUES and 256. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MUTEXESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of mutexes allocated when the Open Server application starts 
up. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_PREEMPTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If CS_TRUE, preemptive scheduling is used. This configuration parameter is 
available only on platforms that support both non-preemptive and 
preemptive scheduling. Use MOREINFO="NONE"srv_capability to find out if preemptive 
scheduling is available. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_REMSITESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The maximum number of site handlers that can execute at a time. Each site 
handler can support multiple connections to a single remote SQL Server. If a 
remote server attempts to connect to the Open Server application and there 
are no available site handlers, the connection request fails. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_REMPREREADCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of network read buffers allocated for each server-to-server 
logical connection. The optimum value depends upon the application. If a 
typical remote procedure call has a one-packet request and a one-packet 
response, SRV_REMPREREAD would be optimally be set to 1. However, if 
the typical remote procedure call is larger than one packet, it should be set as 
high as the request size. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_SRVPROCSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The maximum number of threads an application can create with MOREINFO="NONE"srv_spawn or 
MOREINFO="NONE"srv_createproc. This does not include threads created internally by Open 
Server. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_STACKSIZECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The size of the stack that is allocated for a client thread when a new 
connection is made to the Open Server application or when a thread is 
created by MOREINFO="NONE"srv_createproc or MOREINFO="NONE"srv_spawn. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TIMESLICECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of clock ticks a thread consumes before the callback routine is 
called. The time slice, in microseconds, is the product of SRV_TIMESLICE and 
SRV_VIRTCLKRATE. SRV_VIRTTIMER must be set to CS_TRUE to enable 
time slice callbacks. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_USEREVENTSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of user events that can be defined. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_VIRTCLKRATECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The clock rate, in microseconds per tick. Since SRV_VIRTCLKRATE depends 
upon hardware, you should generally accept the default value and adjust the 
length of the thread time slice by reconfiguring SRV_TIMESLICE. The time 
slice in microseconds is the product of the values of SRV_TIMESLICE and 
SRV_VIRTCLKRATE. SRV_VIRTTIMER must be set to CS_TRUE to enable 
time slice callbacks. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_VIRTTIMERCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Set to CS_TRUE to enable the virtual timer. The virtual timer is not supported 
on all platforms. Call MOREINFO="NONE"srv_capability with the capability argument set to 
SRV_C_TIMESLICE to determine whether the virtual timer is supported on 
your platform.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_config sets server configuration options, such as the maximum number of client connections the Open Server application accepts and the name of the Open Server log file. All Open Server configuration options have default values. It is not necessary to call MOREINFO="NONE"srv_config unless you want to use configuration option values different from the default values. Once an application is up and running, it cannot change any configuration options except SRV_LOGFILE. MOREINFO="NONE"srv_config will not be supported in future Open Server releases.The new Server-Library MOREINFO="NONE"srv_props routine provides the same functionality. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include      <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_config PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_CONFIG      *sconfigREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_CONFIGREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     An example routine to configure the Open Server options **     using srv_config.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     sconfig  A pointer to a SRV_CONFIG structure obtained by**              calling srv_config_alloc.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_SUCCEED    All options were set successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE               ex_srv_config(sconfig)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_CONFIG               *sconfig;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Make sure that sconfig has been initialized.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if ( sconfig == (SRV_CONFIG *)NULL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Set the new maximum number of connections that the     ** OpenServer can accept.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if ( srv_config(sconfig, SRV_CONNECTIONS, "50", CS_NULLTERM)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          == CS_FAIL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Set the Open Server log file name.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if ( srv_config(sconfig, SRV_LOGFILE, "oserver.log",           CS_NULLTERM)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          == CS_FAIL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X97955"srv_callback
MOREINFO="NONE", LINKEND="X77376"srv_capability
MOREINFO="NONE", LINKEND="X78569"srv_config_alloc
MOREINFO="NONE", LINKEND="X48434"SRV_GETCONFIG
MOREINFO="NONE", LINKEND="X24609"srv_init
MOREINFO="NONE", LINKEND="X18405"srv_log
MOREINFO="NONE", LINKEND="X84669"srv_props
MOREINFO="NONE", LINKEND="X48116"srv_run
ID="IN54103479107"srv_configID="X78569"ID="IN55163183108"srv_config_alloc
srv_config_alloc
Allocate a SRV_CONFIG structure. FORMAT="LINESPECIFIC"SRV_CONFIG *srv_config_alloc() CommentsMARK="BULL" REMAP="BU--Bullet"Allocate a SRV_CONFIG structure. SRV_CONFIG structures contain the Open Server default configuration option parameters. The configuration structure is needed only for MOREINFO="NONE"srv_init and can be freed afterward with MOREINFO="NONE"srv_free. After the SRV_CONFIG structure is allocated, configuration options are set via MOREINFO="NONE"srv_config. MOREINFO="NONE"srv_config_alloc will not be supported in future Open Server releases. The CS-Library routine MOREINFO="NONE"cs_ctx_alloc provides the same functionality. See the CS-Library topics page for details.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include          <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE               ex_srv_config_alloc PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_CONFIG               **cppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_CONFIG_ALLOCREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Example routine to illustrate the use of srv_config_allocREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    cpp  - A pointer to (SRV_CONFIG *). It is initialized with**           the pointer to the allocated SRV_CONFIG structure if**           successful, or NULL(SRV_CONFIG *) if a failure**           occurred.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_SUCCEED  SRV_CONFIG structure allocation was **                    successful.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_FAIL     An error was detected. REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_config_alloc(cpp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_CONFIG     **cpp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Initialization. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     *cpp = (SRV_CONFIG *)NULL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if ((*cpp = srv_config_alloc()) == (SRV_CONFIG *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return (CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"A pointer to a SRV_CONFIG structure on success, or (SRV_CONFIG *) NULL on failure. See AlsoREMAP="BO--Body"LINKEND="X71144"srv_config
MOREINFO="NONE",LINKEND="X68633"srv_free
MOREINFO="NONE", LINKEND="X24609"srv_init
MOREINFO="NONE", LINKEND="X84669"srv_props
ID="IN55162886115"srv_config_allocID="X21623"ID="IN56112590116"srv_convert
srv_convert
Convert data from one datatype to another. FORMAT="LINESPECIFIC"CS_INT srv_convert(spp, srctype, srcp, srclen,FORMAT="LINESPECIFIC"        desttype, destp, destlen)FORMAT="LINESPECIFIC"SRV_PROC     *spp;FORMAT="LINESPECIFIC"CS_INT       srctype;FORMAT="LINESPECIFIC"CS_VOID      *srcp;FORMAT="LINESPECIFIC"CS_INT       srclen;FORMAT="LINESPECIFIC"CS_INT       desttype;FORMAT="LINESPECIFIC"CS_VOID      *destp;FORMAT="LINESPECIFIC"CS_INT       destlen;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.srctype - The datatype of the data that is to be converted. This parameter can be any of the following Open Server datatypes:      SRVCHAR     SRVVARCHAR     SRVBINARY     SRVVARBINARY     SRVINT1     SRVINT2     SRVINT4     SRVREAL     SRVFLT8     SRVBIT     SRVDATETIME     SRVDATETIME4     SRVMONEY     SRVMONEY4srcp - A pointer to the data to be converted. If this pointer is null, MOREINFO="NONE"srv_convert will place an appropriate null value in the destination variable. srclen - The length, in bytes, of the data to be converted. If the srclen is 0, MOREINFO="NONE"srv_convert will place an appropriate null value in the destination variable. This length is ignored for fixed-length datatypes, unless it is 0, in which case the source data is assumed to be NULL. For SRVCHAR data, a length of CS_NULLTERM indicates that the string is null terminated. desttype - The datatype to convert the source data to. This parameter can be any of the Open Server datatypes listed in the first table below. destp - A pointer to the destination variable that will receive the converted data. If this pointer is NULL, Open Server will call the user-supplied error handler (if any) and return -1. destlen - The length, in bytes, of the destination variable. destlen is ignored for fixed-length datatypes. For a SRVCHAR destination, the value of destlen must be the total length of the destination buffer space. A length of -1 for a SRVCHAR or SRVBINARY destination means that there is sufficient space available. A length of -1 for a SRVCHAR destination terminates the character string with NULL. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_convert converts data from one representation to another. To determine whether a particular conversion is permitted, call MOREINFO="NONE"srv_willconvert before attempting a conversion. The table below lists the datatype conversions that MOREINFO="NONE"srv_convert supports. The source datatypes are listed in the leftmost column and the destination datatypes are listed in the top row of the table. For brevity, the prefix "SRV" has been eliminated from each datatype. T (CS_TRUE) indicates that the conversion is supported; F (CS_FALSE) indicates that the conversion is not supported. TOCENTRY="1"LBL="Table 3-17: "Supported Datatype Conversions (srv_convert)COLS="7" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="72*"COLNAME="C2" COLWIDTH="33*"COLNAME="C3" COLWIDTH="45*"COLNAME="C4" COLWIDTH="36*"COLNAME="C5" COLWIDTH="63*"COLNAME="C6" COLWIDTH="51*"COLNAME="C7" COLWIDTH="60*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"From:COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"To: COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C7" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"charCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"binaryCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"bitCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"int, small 
int, tinyint, 
real, floatCOLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"moneymoney4COLNAME="C7" ALIGN="LEFT" ROTATE="0" MOREROWS="0"datetime datetime4 VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"charCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C7" ALIGN="LEFT" ROTATE="0" MOREROWS="0"T COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"binaryCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C7" ALIGN="LEFT" ROTATE="0" MOREROWS="0"F COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"bitCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FCOLNAME="C7" ALIGN="LEFT" ROTATE="0" MOREROWS="0"T COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"int, smallint, 
tinyint, real, 
floatCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"T COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"T COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"T COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"T COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"T COLNAME="C7" ALIGN="LEFT" ROTATE="0" MOREROWS="0"F  COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"money money4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"T COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"T COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"T COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"T COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"T COLNAME="C7" ALIGN="LEFT" ROTATE="0" MOREROWS="0"F  COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"datetime 
datetime4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FCOLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FCOLNAME="C7" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TA conversion to or from the SRVBINARY datatype is a straight bit-copy, except when the conversion involves SRVCHAR. When converting SRVCHAR data to SRVBINARY, MOREINFO="NONE"srv_convert interprets the SRVCHAR string as hexadecimal, whether or not the string contains a leading "0x". When converting SRVBINARY data to SRVCHAR, MOREINFO="NONE"srv_convert creates a hexadecimal string without a leading "0x". Converting a SRVMONEY or SRVCHAR value to SRVFLT8 can result in some loss of precision. Converting a SRVFLT8 value to SRVCHAR can also result in some loss of precision. Converting a SRVFLT8 value to SRVMONEY can result in overflow, because the maximum value for SRVMONEY is $922,337,203,685,477.58. If overflow occurs when converting integer or float data to SRVCHAR, the first position of the resulting character array will contain an asterisk ("*") to indicate the error. In certain cases, it can be useful to convert a datatype to itself. For instance, a conversion of SRVCHAR to SRVCHAR with a destlen of CS_NULLTERM is a useful way to append NULL to a string. For more information on Open Server datatypes, see the MOREINFO="NONE"Types topics page.MOREINFO="NONE"srv_convert will not be supported in future Open Server releases.The new CS-Library MOREINFO="NONE"cs_convert routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include          <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE ex_srv_convert PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     SRV_PROC          *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_INT            intval,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_CHAR           *buf,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_INT            buflen,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_INT            *outlenREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_CONVERTREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Example routine to convert integer data into character data**     using srv_convert.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp      A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    intval   The integer to be converted.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    buf      The output buffer to use.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    buflen   The size of the output buffer.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    outlen   Return pointer for the length of the converted**             data; if conversion fails, -1 is returned.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED      The conversion was successful.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL         An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_convert(spp, intval, buf, buflen, outlen)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          intval;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *buf;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          buflen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          *outlen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Convert the integer value to a character value.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     *outlen = srv_convert(spp, SRVINT4, (CS_VOID *)&intval,          CS_SIZEOF(intval), SRVCHAR, (CS_VOID *)buf, buflen);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if (*outlen == -1)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"The length of the converted data, in bytes, if the datatype conversion succeeds. If the conversion fails, -1 is returned. REMAP="BO--Body"If MOREINFO="NONE"srv_convert fails, it calls the Open Server error handler, if a thread pointer was provided. REMAP="BO--Body"MOREINFO="NONE"srv_convert can fail for several reasons: the requested conversion was not available; the conversion resulted in truncation, overflow, or loss of precision in the destination variable; or a syntax error occurred in converting a character string to some numeric type. See AlsoREMAP="BO--Body"LINKEND="X21623"srv_convert
MOREINFO="NONE", LINKEND="X84513"srv_willconvert
MOREINFO="NONE",LINKEND="X24762"Errors
MOREINFO="NONE", LINKEND="X87730"Types
ID="IN56112293124"srv_convertID="X63435"ID="IN57141997125"srv_createmsgq
srv_createmsgq
Create a message queue. FORMAT="LINESPECIFIC"CS_RETCODE srv_createmsgq(msgqnamep, msgq_namelen,FORMAT="LINESPECIFIC"              msgqidp)FORMAT="LINESPECIFIC"CS_CHAR       *msgqnamep;FORMAT="LINESPECIFIC"CS_INT        msgqname_len;FORMAT="LINESPECIFIC"SRV_OBJID     *msgqidp;ParametersREMAP="RI--RefIndent"msgqnamep - A pointer to the name of the queue to create. It is an error to attempt to create a queue that already exists. msgqname_len - The length of the name in *msgqnamep. If the name is null terminated, an application can set msgqname_len to CS_NULLTERM. A message queue can be up to SRV_MAXNAME characters long. msgqidp - Open Server returns the ID of the newly created message queue in *msgqidp. CommentsMARK="BULL" REMAP="BU--Bullet"When creating a message queue, an application must assign it a name. Once a message queue has been created, an application can reference it either by name or by ID. Given the ID of a message queue, use MOREINFO="NONE"srv_getobjname to look up the name. SRV_OBJID is defined as a CS_INT.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_createmsgq PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     SRV_OBJID     *msgqp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_CHAR       *msgqnmREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_CREATEMSGQREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Example routine to create an Open Server message queue**     using srv_createmsgq.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     msgqp   Return pointer to the created message queue**             identifier.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     msgqn   Null terminated name for the created queue.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_SUCCEED  Message queue with given name successfully                created.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_FAIL     An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE            ex_srv_createmsgq(msgqp, msgqnm)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_OBJID             *msgqp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR               *msgqnm;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Check parameters. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if ((CS_INT)strlen(msgqnm) > SRV_MAXNAME)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Create the message queue. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if (srv_createmsgq(msgqnm, (CS_INT)CS_NULLTERM, msgqp) !=          CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X72703"srv_deletemsgq
MOREINFO="NONE", LINKEND="X70696"srv_getmsgq
MOREINFO="NONE", LINKEND="X19319"srv_getobjname
MOREINFO="NONE", LINKEND="X32227"srv_putmsgq
ID="IN571416100133"srv_createmsgq
ID="IN571513103134"srv_createmutexID="X69149"srv_createmutex
Create a mutual exclusion semaphore. FORMAT="LINESPECIFIC"CS_RETCODE srv_createmutex(mutex_namep, mutex_namelen,FORMAT="LINESPECIFIC"                mutex_idp)FORMAT="LINESPECIFIC"CS_CHAR         *mutex_namep;FORMAT="LINESPECIFIC"CS_INT          mutex_namelen;FORMAT="LINESPECIFIC"SRV_OBJID       *mutex_idp;ParametersREMAP="RI--RefIndent"mutex_namep - A pointer to a the name of the mutex to create. mutex_namelen - The length of the name in *mutex_namep. If the string is null terminated, an application can set mutex_namelen to CS_NULLTERM. mutex_idp -Open Server returns the ID of the new mutex in the *mutex_idp. CommentsMARK="BULL" REMAP="BU--Bullet"When creating a mutex, an application must assign it a name. Once a mutex has been created, the application can reference it either by name or by ID. If you have the ID of a mutex, you can use MOREINFO="NONE"srv_getobjname to look up the name. Creating a mutex does not grant a lock to its creator. Use MOREINFO="NONE"srv_lockmutex to lock it once a mutex has been created. SRV_OBJID is defined as a CS_INT.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include     <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE               ex_srv_createmutex PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR           *name,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT            namelen,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_OBJID         *idpREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_CREATEMUTEXREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Example routine to create an Open Server mutex.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     name      The name of the mutex to create.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     namelen   The length of name.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     idp       The address of a SRV_OBJID, which will be set**               to the unique identifier for the created mutex.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**          CS_SUCCEED      The mutex was created successfuly.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**          CS_FAIL         An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE           ex_srv_createmutex(name, namelen, idp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR              *name;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT               namelen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_OBJID            *idp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Call the Open Server routine that will create     ** the mutex.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if( srv_createmutex(name, namelen, idp) == CS_FAIL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          ** An error was already raised.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return CS_FAIL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** All done.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return CS_SUCCEED;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X30072"srv_deletemutex
MOREINFO="NONE", LINKEND="X19319"srv_getobjname
MOREINFO="NONE", LINKEND="X55165"srv_lockmutex
MOREINFO="NONE",LINKEND="X37215"srv_unlockmutex
ID="IN581510107142"srv_createmutexID="X35449"ID="IN59147111143"srv_createproc
srv_createproc
Create a non-client, event-driven thread. FORMAT="LINESPECIFIC"SRV_PROC *srv_createproc(ssp)FORMAT="LINESPECIFIC"SRV_SERVER     *ssp;ParametersREMAP="RI--RefIndent"ssp - A pointer to the Open Server state information control structure. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_createproc creates a thread that is driven by programmer-defined events raised by MOREINFO="NONE"srv_event or MOREINFO="NONE"srv_event_deferred. Non-client threads receive only programmer-defined events. They never receive client-generated events. Use MOREINFO="NONE"srv_termproc to terminate a thread created with MOREINFO="NONE"srv_createproc. MOREINFO="NONE"srv_termproc supersedes the Release 1.0 MOREINFO="NONE"srv_dropproc function. Non-client threads have no client I/O. Calling MOREINFO="NONE"srv_thread_props with the property argument set to (SRV_T_IODEAD) always returns CS_TRUE for a non-client thread.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include          <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE               ex_srv_creatp     PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_SERVER               *ssp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC                 *newspREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_CREATPREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Example routine to create a non-client, event driven thread.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     ssp     A pointer to the Open Server state information**             control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    newsp    A pointer that will be returned by srv_createproc**             and point to the new thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** ReturnsREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_SUCCEED            Thread was created.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_FAIL               An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE             ex_srv_creatp(ssp, newsp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_SERVER             *ssp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC               *newsp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Check arguments. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if(ssp == (SRV_SERVER *)0)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Create the new threadREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     newsp = srv_createproc(ssp);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if(newsp == (SRV_PROC *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"If successful, MOREINFO="NONE"srv_createproc returns pointer to the new thread control structure. If unsuccessful, MOREINFO="NONE"srv_createproc returns a NULL thread pointer, and Open Server raises an error.See AlsoREMAP="BO--Body"LINKEND="X94254"srv_event
MOREINFO="NONE",LINKEND="X40599"srv_event_deferred
MOREINFO="NONE", LINKEND="X60232"srv_spawn
MOREINFO="NONE", LINKEND="X75457"srv_termproc
MOREINFO="NONE", LINKEND="X51398"srv_thread_props
ID="IN59144114151"srv_createprocID="IN60111118152"SRV_CURPROC
SRV_CURPROC
Access the thread control structure for the thread that is currently executing.FORMAT="LINESPECIFIC"SRV_PROC      *SRV_CURPROCCommentsMARK="BULL" REMAP="BU--Bullet"The MOREINFO="NONE"SRV_CURPROC macro returns a thread pointer to the thread structure associated with the currently executing Open Server thread.MOREINFO="NONE"SRV_CURPROC will not be supported in future Open Server releases. The new Server-LibraryMOREINFO="NONE" srv_props routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include          <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE               ex_srv_curproc PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_CURPROCREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Example routine to access the control structure for **     the currently executing thread.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     NoneREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_SUCCEEDREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_FAILREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE               ex_srv_curproc()REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     SRV_PROC          *spp = (SRV_PROC *)NULL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if ((spp = SRV_CURPROC) == (SRV_PROC *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"A pointer to the executing thread. See AlsoREMAP="BO--Body"LINKEND="X78437"srv_pfield
MOREINFO="NONE", LINKEND="X84669"srv_props
ID="IN6011-2121159"SRV_CURPROCID="X19525"ID="IN6116-5125160"srv_cursor_props
srv_cursor_props
Retrieve or set information about the current cursor.FORMAT="LINESPECIFIC"CS_RETCODE srv_cursor_props(spp, cmd, cdp)FORMAT="LINESPECIFIC"SRV_PROC       *spp;FORMAT="LINESPECIFIC"CS_INT         cmd;FORMAT="LINESPECIFIC"SRV_CURDESC    *cdp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.cmd - cmd indicates whether MOREINFO="NONE"srv_cursor_props sends cursor information to the client or retrieves cursor information from the client. The following table describes the legal values for cmd:TOCENTRY="1"LBL="Table 3-18: "Values for cmd (srv_cursor_props)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="50*"COLNAME="C2" COLWIDTH="209*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"srv_cursor_props sends information about 
the current cursor to the client. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"srv_cursor_props retrieves information about 
the current cursor command from the client.cdp - A pointer to a SRV_CURDESC structure. When the application is setting cursor information, the SRV_CURDESC structure describes the current cursor. When the application is retrieving information, Open Server updates the SRV_CURDESC structure with information about the current cursor. Various fields are set or filled in at various times, depending on the current cursor command. For an explanation of each field in cdp and how and when they are filled in, see the MOREINFO="NONE"Cursors topics page.CommentsMARK="BULL" REMAP="BU--Bullet"An Open Server application uses MOREINFO="NONE"srv_cursor_props to exchange active cursor information with the client.The client always initiates this exchange by issuing a cursor command. The client, therefore, specifies the current cursor.An application can only call MOREINFO="NONE"srv_cursor_props from inside a SRV_CURSOR event handler.Open Server generates a SRV_CURSOR event in response to each cursor command received from a client. An application's SRV_CURSOR event handler can then call MOREINFO="NONE"srv_cursor_props with cmd set to CS_GET to determine the current cursor and the type of cursor command received. It can then decide how to respond. For a description of valid cursor command types and legal responses, see the MOREINFO="NONE"Cursors topics page. Each cursor command provokes a distinct response from an Open Server application. The application pulls information from the SRV_CURDESC structure (the requested fetch count, for example), makes decisions based on that data, and then sets information in the structure and sends it back to the client via MOREINFO="NONE"srv_cursor_props. An application can also read in parameters, or send back result rows and parameters, depending on the circumstances.The SRV_CURSOR event handler must acknowledge all cursor commands except fetch, update, and delete by sending back a cursor information command. The handler sets the curcmd field in the SRV_CURDESC structure to CS_CURSOR_INFO and then calls MOREINFO="NONE"srv_cursor_props with cmd set to CS_SET. This is the very first piece of information the handler sends back.In response to a CURSOR_DECLARE command, an Open Server application chooses a cursor ID to uniquely identify the current cursor. The application then sends the cursor ID back to the client by calling MOREINFO="NONE"srv_cursor_props with cmd set to CS_SET. The client and Open Server application subsequently refer to the current cursor by its ID rather than its name. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include          <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"extern CS_RETCODE     ex_srv_cursor_props PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID               *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_CURSOR_PROPSREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Example routine to retrieve information on the current**     cursor.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  spp  Apointer to an internal control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_SUCCEED     Cursor information was retrieved successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_FAIL        An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE         ex_srv_cursor_props(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC           *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     SRV_CURDESC   curdesc;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if(srv_cursor_props(spp, CS_GET, &curdesc) == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the SRV_CURDESC structure was updated with information on the current cursor (cmd set to CS_GET) or if the current cursor was set based on the information in the SRV_CURDESC structure to which cdp points (cmd set to CS_SET).REMAP="BO--Body"CS_FAIL if an error was detected. See AlsoREMAP="BO--Body"LINKEND="X30757"srv_bind
MOREINFO="NONE", LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X87885"srv_numparams
MOREINFO="NONE", LINKEND="X52699"srv_xferdata
MOREINFO="NONE", LINKEND="X47274"Cursors
ID="IN6116-8128168"srv_cursor_propsID="X68955"ID="IN6213-11132169"srv_dbg_stack
srv_dbg_stack
Display the call stack of a thread. FORMAT="LINESPECIFIC"CS_RETCODE srv_dbg_stack(spp, depth, funcp)FORMAT="LINESPECIFIC"SRV_PROC        *spp;FORMAT="LINESPECIFIC"CS_INT          depth;FORMAT="LINESPECIFIC"CS_RETCODE     (*funcp)();ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.depth - The maximum number of call stack levels to display. If depth is -1, all levels are displayed. funcp - A pointer to a function that you provide to process each line of the call stack display. Your function is called with a pointer to a null terminated string and an integer that is the length of the string. The string contains the program counter and the routine's parameters formatted in hexadecimal. If your function returns CS_FAIL, the stack trace is terminated. If it returns anything else, the stack trace continues until all of the routines on the call stack are processed or until depth stack frames are processed. If funcp is NULL, Open Server writes the call stack contents to stderr.REMAP="UN--Under"The following is a typical implementation for a function: REMAP="COW10--CompOutWide10pt" FORMAT="LINESPECIFIC"CS_RETCODE callstack_display(linebuf, length) CS_CHAR  *linebuf; CS_INT   length; {      /*      ** Output each line of the stack trace to stderr.       */      fprintf(stderr,"%s\n", linebuf);      return(CS_SUCCEED); } CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_dbg_stack is not available on all platforms. Use MOREINFO="NONE"srv_capability to determine if it is available on the current platform. MOREINFO="NONE"srv_dbg_stack allows you to examine the call stack of a thread during debugging or when handling execution errors. It can be called from a debugger or from the running application. A typical use for MOREINFO="NONE"srv_dbg_stack is to record the stack frame in the error log when a serious error occurs. Each routine on the call stack is formatted into a string consisting of the program counter, in hexadecimal, followed by each parameter, also in hexadecimal. You will need a load map of the executable to translate the program counter to a function name. If called to display the stack of the currently running thread, MOREINFO="NONE"srv_dbg_stack and the routines it calls appear at the top of the stack.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_dbg_stack PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_DBG_STACKREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Example routine to display the call stack of a thread.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     spp  -  A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_SUCCEED    Call stack successfully displayed.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE           ex_srv_dbg_stack(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC       *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_RETCODE retval;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     retval = srv_dbg_stack(spp, -1, (CS_RETCODE(*)())NULL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return (retval);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X77376"srv_capability
MOREINFO="NONE",LINKEND="X23034"srv_dbg_switch
ID="IN6213-14135177"srv_dbg_stackID="X23034"ID="IN6314-17139178"srv_dbg_switch
srv_dbg_switch
Temporarily restore another thread context for debugging. FORMAT="LINESPECIFIC"CS_RETCODE srv_dbg_switch(spid)FORMAT="LINESPECIFIC"CS_INT     spid;ParametersREMAP="RI--RefIndent"spid - The server process ID (spid) of the thread whose context should be temporarily restored. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_dbg_switch is not available on all platforms. You can use MOREINFO="NONE"srv_capability to determine whether the current platform supports MOREINFO="NONE"srv_dbg_switch. Once a thread context is switched, continuing execution of the application restores the original thread context and the application continues to run normally. The thread whose context has been restored is not runnable. It can only be examined. On UNIX systems, do not call MOREINFO="NONE"srv_dbg_switch from within system service routines. If you do, a SIGTRAP signal is raised and the program terminates. The spid can be obtained by calling MOREINFO="NONE"srv_thread_props with the property argument set to SRV_T_SPID. It is an error to attempt to restore the context for the currently running thread. ReturnsREMAP="BO--Body"If successful, CS_SUCCEED is returned. Otherwise, an error is raised and CS_FAIL is returned. See AlsoREMAP="BO--Body"LINKEND="X77376"srv_capability
MOREINFO="NONE", LINKEND="X68955"srv_dbg_stack
ID="IN6314-20142185"srv_dbg_switchID="X96733"ID="IN6416-23146186"srv_define_event
srv_define_event
Define a user event. FORMAT="LINESPECIFIC"int srv_define_event(ssp, type, namep, namelen)FORMAT="LINESPECIFIC"SRV_SERVER     *ssp;FORMAT="LINESPECIFIC"CS_INT         type;FORMAT="LINESPECIFIC"CS_CHAR        *namep;FORMAT="LINESPECIFIC"CS_INT         namelen;ParametersREMAP="RI--RefIndent"ssp - A pointer to the Open Server control structure. type - The type of event. Currently, programmer-defined events must be of type SRV_EQUEUED. namep - A pointer to the name of the event. namelen - The length, in bytes, of string in *namep. If the string is null terminated, namelen can be CS_NULLTERM. CommentsMARK="BULL" REMAP="BU--Bullet"Programmer-defined events are triggered by calling MOREINFO="NONE"srv_event rather than by client actions. The Open Server programmer provides a handler routine that executes when the event is triggered. Event handlers for programmer-defined events are installed in the usual way, with MOREINFO="NONE"srv_handle. Handlers for programmer-defined events receive a pointer to the thread control structure for the thread that received the event.Events cannot be defined unless the Open Server application has been configured to allow programmer-defined events. See  the MOREINFO="NONE"srv_props reference page, for details. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include          <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_define_event PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR        *namep,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT         namelen,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT         *event_noREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_DEFINE_EVENTREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Example routine to illustrate the use of srv_define_event to**   define an user event.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     namep     A pointer to the name of event.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     namelen        The length, in bytes, of string in **               *namep.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     event_no  A CS_INT pointer that is initialized with**               the unique number for the event.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_SUCCEED   If the event was defined successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_FAIL      An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_define_event(namep, namelen, event_no)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR        *namep;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT         namelen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT         *event_no;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     SRV_SERVER               *sp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Get a pointer to the server structure. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     sp = SRV_GETSERVER((SRV_PROC *)NULL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Now define the event. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if ((*event_no = srv_define_event(sp, SRV_EQUEUED,           namep, namelen)) == (CS_INT)0)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return (CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"A unique integer ID number for the event. If the event can't be defined, an Open Server error is raised and 0 is returned. See AlsoREMAP="BO--Body"LINKEND="X71144"srv_config
MOREINFO="NONE", LINKEND="X94254"srv_event
MOREINFO="NONE", LINKEND="X40599"srv_event_deferred
MOREINFO="NONE", LINKEND="X76123"srv_handle
MOREINFO="NONE", LINKEND="X84669"srv_props
MOREINFO="NONE", LINKEND="X78566"Events
ID="IN6416-26149194"srv_define_eventID="X72703"ID="IN6514-29153195"srv_deletemsgq
srv_deletemsgq
Delete a message queue. FORMAT="LINESPECIFIC"CS_RETCODE srv_deletemsgq(msgqnamep, msgqname_len,FORMAT="LINESPECIFIC"              msgqid)FORMAT="LINESPECIFIC"CS_CHAR       *msgqnamep;FORMAT="LINESPECIFIC"CS_INT        msgqname_len;FORMAT="LINESPECIFIC"SRV_OBJID     msgqid;ParametersREMAP="RI--RefIndent"msgqnamep - A pointer to the name of the message queue to delete. It is an error to attempt to delete a message queue that does not exist. msgqname_len - The length of the name pointed to by msgqname. If the name is null terminated, msgqname_len can be set to CS_NULLTERM. msgqid - A SRV_OBJID that specifies the identifier of message queue to delete. CommentsMARK="BULL" REMAP="BU--Bullet"Message queues can be deleted by either name or ID. If msgqname is not NULL, the message queue name is used; otherwise, the message queue ID is used. Unread messages in the queue are flushed before the queue is deleted. Threads waiting in MOREINFO="NONE"srv_putmsgq wake upMOREINFO="NONE". srv_putmsgq returns CS_FAIL. When a message queue is deleted, threads waiting for
messages from the queue wake up with a CS_FAIL return value from MOREINFO="NONE"srv_getmsgq, and the infop argument to that routine is set to SRV_I_DELETED. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include          <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_deletemsgq PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *msgqname,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          msgqname_len,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_OBJID msgqidREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_DELETEMSGQREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Example routine using srv_deletemsgq to delete an Open**     Server message queue previously create by srv_createmsgq.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** This routine can be passed a value message queue name, or** NULL,in which case the message queue identifier will be used.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  msgqname        The name of the message queue to delete. If**                  NULL, the msgqid is used.**  msgqname_len    The length of the name to which msgqname **                  points.**  msgqid          A SRV_OBJID that specifies the identifier of**                  the message queue to delete.**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    The message queue was successfully deleted.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_deletemsgq(msgqname, msgqname_len, msgqid)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *msgqname;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          msgqname_len;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_OBJID       msgqid;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Delete a message queue.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if (srv_deletemsgq(msgqname, msgqname_len, msgqid) !=          CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X63435"srv_createmsgq
MOREINFO="NONE", LINKEND="X70696"srv_getmsgq
MOREINFO="NONE", LINKEND="X19319"srv_getobjname
MOREINFO="NONE", LINKEND="X32227"srv_putmsgq
ID="IN6514-32156203"srv_deletemsgq
ID="IN6515-35159204"srv_deletemutexID="X30072"srv_deletemutex
Delete a mutex created by MOREINFO="NONE"srv_createmutex. FORMAT="LINESPECIFIC"CS_RETCODE srv_deletemutex(mutex_namep, mutex_namelen,FORMAT="LINESPECIFIC"               mutex_id)FORMAT="LINESPECIFIC"CS_CHAR        *mutex_namep;FORMAT="LINESPECIFIC"CS_INT         mutex_namelen;FORMAT="LINESPECIFIC"SRV_OBJID      mutex_id;ParametersREMAP="RI--RefIndent"mutex_namep - A pointer to the name associated with the mutex when it was created. mutex_namelen - The length, in bytes, of the mutex_namep. If the string is null terminated, mutex_namelen can be set to CS_NULLTERM. mutex_id - The unique identifier returned by MOREINFO="NONE"srv_createmutex. CommentsMARK="BULL" REMAP="BU--Bullet"The mutex to delete can be referenced by its name or ID. If mutex_namep is not NULL, the name is used; otherwise, the ID is used. A mutex is not deleted until other threads waiting to lock the mutex have had their requests satisfied and have released their locks. An example of the use of mutexes appears on the MOREINFO="NONE"srv_createmutex reference page. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE    ex_srv_deletemutex PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *mtxnm,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_OBJID       mtxidREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_DELETEMUTEXREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Example routine using srv_deletemutex to delete an**     Open Server mutex previously created by srv_createmutex.**     This routine can be passed a mutex name, or NULL,**     in which case the mutex identifier will be used.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     mtxnm     Null terminated mutex name, or NULL to use mutex **               id.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    mtxid      Mutex identifier (valid only if mtxnm is NULL).REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED     mutex was successfully queued for deletion.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL        An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE              ex_srv_deletemutex(mtxnm, mtxid)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR                 *mtxnm;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_OBJID               mtxid;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Delete the mutex. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if (srv_deletemutex(mtxnm, (CS_INT)CS_NULLTERM, mtxid) !=           CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X69149"srv_createmutex
MOREINFO="NONE", LINKEND="X37417"srv_getobjid
MOREINFO="NONE", LINKEND="X19319"srv_getobjname
MOREINFO="NONE", LINKEND="X55165"srv_lockmutex
ID="IN6615-38163212"srv_deletemutexID="X33058"ID="IN6711-41167213"srv_descfmt
srv_descfmt
Describe or retrieve the description of a column or parameter going to or coming from a client.FORMAT="LINESPECIFIC"CS_RETCODE srv_descfmt(spp, cmd, type, item,FORMAT="LINESPECIFIC"               clfmtp)FORMAT="LINESPECIFIC"SRV_PROC       *spp;FORMAT="LINESPECIFIC"CS_INT         cmd;FORMAT="LINESPECIFIC"CS_INT         type;FORMAT="LINESPECIFIC"CS_INT         item;FORMAT="LINESPECIFIC"CS_DATAFMT     *clfmtp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.cmd - cmd indicates whether MOREINFO="NONE"srv_descfmt describes data being sent to the client or retrieves a description of data received from the client. The following table describes the legal values for cmd:TOCENTRY="1"LBL="Table 3-19: "Values for cmd (srv_descfmt)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="50*"COLNAME="C2" COLWIDTH="252*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"srv_descfmt describes the format the data will be in 
when the client receives it.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"srv_descfmt retrieves the format the data was in when 
the client sent it.REMAP="BO--Body"type - If cmd is CS_SET, the type of data being described. If cmd is CS_GET, the type of data being retrieved. The following table describes the valid types and their appropriate context:TOCENTRY="1"LBL="Table 3-20: "Values for type (srv_descfmt)COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="102*"COLNAME="C2" COLWIDTH="77*"COLNAME="C3" COLWIDTH="122*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TypeCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Relevant 
contextCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_RPCDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SET or 
CS_GETCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"RPC or stored 
procedure parametersCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_ROWDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SET onlyCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Row dataCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CURDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GET onlyCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Cursor parametersCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_UPCOLDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GET onlyCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Cursor update columnsCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_KEYDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GET onlyCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Cursor key dataCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_ERRORDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SET onlyCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Extended error dataCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DYNDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SET or 
CS_GETCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Dynamic SQL dataCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NEGDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SET or 
CS_GETCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Negotiated login dataCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MSGDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SET or 
CS_GETCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MSG parametersREMAP="RI--RefIndent"item - The parameter or column number. Parameter and column numbers start at 1. clfmtp - A pointer to a CS_DATAFMT structure containing a description of the data. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_descfmt describes the format of a variety of kinds of columns and parameter. See the MOREINFO="NONE"CS_DATAFMT topics page, for details.When sending rows or parameters to the client (CS_SET), you must call MOREINFO="NONE"srv_descfmt to describe how the data will look to the client. When receiving parameters from the client (CS_GET), call MOREINFO="NONE"srv_descfmt to retrieve a description of the format the data was in when the client sent it. A gateway application may want to save this client format information in order to pass it on to the remote server.The MOREINFO="NONE"srv_descfmt routine reads from (CS_GET) or sets (CS_SET) the CS_DATAFMT fields listed in the table below. All other fields are undefined for MOREINFO="NONE"srv_descfmt. (Note that "clfmtp" is a pointer to the structure.)TOCENTRY="1"LBL="Table 3-21: "CS_DATAFMT Fields Used (srv_descfmt)COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="98*"COLNAME="C2" COLWIDTH="130*"COLNAME="C3" COLWIDTH="177*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FieldCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SETCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GETVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"clfmtpname='rArrow' font='symbol' code='174'  charset='fontspecific'
namelenCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Length of nameCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Length of name.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"clfmtpname='rArrow' font='symbol' code='174'  charset='fontspecific'
statusCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Parameter/column statusCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Parameter statusCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"clfmtpname='rArrow' font='symbol' code='174'  charset='fontspecific'
nameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Parameter/column nameCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Parameter nameCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"clfmtpname='rArrow' font='symbol' code='174'  charset='fontspecific'
datatypeCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Remote datatype set hereCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Remote datatype retrieved from hereCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"clfmtpname='rArrow' font='symbol' code='174'  charset='fontspecific'
maxlengthCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Maximum length of 
remote datatype set hereCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Maximum length of remote datatype 
retrieved from hereCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"clfmtpname='rArrow' font='symbol' code='174'  charset='fontspecific' formatCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Remote datatype formatCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Remote datatype formatsIf the format described in the CS_DATAFMT structure (clfmtp) differs from the format described in the subsequent call to MOREINFO="NONE"srv_bind (osfmtp), Open Server automatically converts to the client format (clfmtp) when cmd is CS_SET or the application format (osfmtp) when cmd is CS_GET.Once each column or parameter in the datastream has been described and bound, call MOREINFO="NONE"srv_xferdata to send the data in the program variable to the client or update the program variable with data from the client.MOREINFO="NONE"srv_descfmt cannot be called with cmd equal to CS_SET and type equal to SRV_RPCDATA in the SRV_RPC event handler. Open Server reads the format information for RPC return parameters from a client when in the SRV_RPC event handler. SRV_NEGDATA parameters can be sent or received as part of a negotiated login operation, after MOREINFO="NONE"srv_negotiate has returned successfully.Key column numbers correspond to their number in the row.MOREINFO="NONE"srv_descfmt and the new routine MOREINFO="NONE"srv_bind extend and replace the functionality of the MOREINFO="NONE"srv_describe and MOREINFO="NONE"srv_returnval routines.MOREINFO="NONE"srv_descfmt and the new routines MOREINFO="NONE"srv_bind and MOREINFO="NONE"srv_xferdata extend and replace the old MOREINFO="NONE"srv_paramdata routine.MOREINFO="NONE"srv_descfmt also replaces:REMAP="UN--Under"srv_paramlenREMAP="UN--Under"srv_parammaxlenREMAP="UN--Under"srv_paramnameREMAP="UN--Under"srv_paramnumberREMAP="UN--Under"srv_paramstatusREMAP="UN--Under"srv_paramtypeExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_descfmt PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          item,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_DATAFMT      *dpREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_DESCFMTREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Example routine used to get an RPC parameter description.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     spp          A pointer to an internal thread control                     structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     item         The parameter number we're looking for.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     dp           The address of a CS_DATAFMT to be filled with**                  the parameter's description.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**          CS_SUCCEED if the description was obtained, or**          CS_FAIL if an error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_descfmt(sp, item, dp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *sp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          item;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_DATAFMT      *dp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Call srv_descfmt to get the RPC parameter description.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if( srv_descfmt(sp, CS_GET, SRV_RPCDATA, item, dp) ==          CS_FAIL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          ** An error was already raised.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return CS_FAIL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** All done.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return CS_SUCCEED;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the description succeeded.REMAP="BO--Body"CS_FAIL if an error was detected.See AlsoREMAP="BO--Body"LINKEND="X30757"srv_bind
MOREINFO="NONE", LINKEND="X19525"srv_cursor_props
MOREINFO="NONE",LINKEND="X26762"srv_dynamic
MOREINFO="NONE", LINKEND="X77646"srv_msg
MOREINFO="NONE", LINKEND="X84584"srv_negotiate
MOREINFO="NONE", LINKEND="X87885"srv_numparams
MOREINFO="NONE", LINKEND="X37615"srv_sendinfo
MOREINFO="NONE", LINKEND="X52699"srv_xferdata
MOREINFO="NONE", LINKEND="X78182"CS_DATAFMT Structure
ID="IN6711-44170221"srv_descfmtID="X59720"ID="IN6812-47174222"srv_describe
srv_describe
Describe a result row column and its data source. FORMAT="LINESPECIFIC"CS_RETCODE srv_describe(spp, colnumber, columnnamep,FORMAT="LINESPECIFIC"         namelen, desttype, destlen,FORMAT="LINESPECIFIC"         srctype, srclen, srcdatap)FORMAT="LINESPECIFIC"SRV_PROC     *spp;FORMAT="LINESPECIFIC"CS_INT       colnumber;FORMAT="LINESPECIFIC"CS_CHAR      *columnnamep;FORMAT="LINESPECIFIC"CS_INT       namelen;FORMAT="LINESPECIFIC"CS_INT       desttype;FORMAT="LINESPECIFIC"CS_INT       destlen;FORMAT="LINESPECIFIC"CS_INT       srctype;FORMAT="LINESPECIFIC"CS_INT       srclen;FORMAT="LINESPECIFIC"CS_VOID      *srcdatap;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.colnumber - The column number of the column being described. Columns need not be described in order, but all columns must be described before MOREINFO="NONE"srv_sendrow is first called. The first column is 1. columnnamep - A pointer to the name of the column to which the data belongs. columnnamep can be (CS_CHAR *) NULL, since a column is not required to have a name. namelen - The length, in bytes, of the column name. If the name is null terminated, namelen can be CS_NULLTERM. desttype - The datatype of the destination row column. This is the datatype that will be sent to the client. The appropriate datatype must be specified, even if the data is null. See the MOREINFO="NONE"Types topics page, for a list of datatypes used in Open Server. destlen - The length of the data that will be sent to the client, in bytes. For fixed length datatypes that don't allow nulls, it is ignored. For variable length datatypes and fixed length datatypes that allow nulls, it must be the maximum length that the destination data can be. srctype - The datatype of the source data. srclen - The length of the source data in bytes. It is ignored for fixed length datatypes. For variable length datatypes, it must be the maximum length that the source data can be. A srclen of -1 tells Open Server to use the default length, which is destlen. srcdatap - A pointer to the source data for a particular column. When MOREINFO="NONE"srv_sendrow is called, it looks for the data for column column at the address srcdatap. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_describe tells Open Server what the rows to be sent to a client look like, and where to find their data. MOREINFO="NONE"srv_describe must be called once for each column in the row before the first call to MOREINFO="NONE"srv_sendrow. The columns of a row can be described in any order. To change the location and length of the source data between rows sent, use MOREINFO="NONE"srv_setcoldata and MOREINFO="NONE"srv_setcollen, respectively. Length of source data can be changed between calls to MOREINFO="NONE"srv_sendrow with MOREINFO="NONE"srv_setcollen. To return a null value for a particular column, set the column's length to 0 with MOREINFO="NONE"srv_setcollen.Be sure to reset the column's length after returning a null value to the client process. If the column's length remains 0, all subsequent result rows will contain a null value for the column.Only certain datatypes are nullable. See the LINKEND="X87730"Types topics page, for details.Open Server automatically converts data between srctype and desttype for supported conversions. See the LINKEND="X21623"srv_convert reference page, for more information about data conversions.Only a nullable datatypes can have a srclen of 0.MOREINFO="NONE"srv_describe will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_descfmt and MOREINFO="NONE"srv_bind routines together provide the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_describe    PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          colnum,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *colnamep,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          namelen,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          desttype,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          destlen,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          srctype,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          srclen,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID         *srcdatapREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_describeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Routine to describe a result row column and its data type.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     spp          A Pointer to an internal thread structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     colnum       The column number of the column being described.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** colnamep    A Pointer to the name of the column, can be **             (CS_CHAR *)NULL.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** namelen     Length in bytes of the column name.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** desttype    The datatype of the destination row column, can be**             CS_DECIMAL_TYPE, CS_LONGBINARY_TYPE,**             CS_LONGCHAR_TYPE, CS_NUMERIC_TYPE.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** destlen     Length in bytes of the data that will be sent to**             the client.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** srctype     The datatype of the source data.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** srclen      The length of the source data in bytes.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** srcdatap    Pointer to the source data.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** ReturnsREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_SUCCEED     REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_FAIL          REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_describe(spp,colnum,colnamep,namelen,                 desttype, destlen,srctype,srclen,srcdatap)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC   *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     colnum;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR    *colnamep;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     namelen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     desttype;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     destlen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     srctype;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     srclen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID    *srcdatap;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Check arguments.  */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if(spp == (SRV_PROC *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(srv_describe(spp,colnum,colnamep,namelen,desttype,        destlen,srctype,srclen,srcdatap));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"The number of the column that has been described. The first column is column 1. If there was an error, 0 is returned. See AlsoREMAP="BO--Body"MOREINFO="NONE"cs_convert, LINKEND="X30757"srv_bind
MOREINFO="NONE", LINKEND="X21623"srv_convert
MOREINFO="NONE", LINKEND="X33058"srv_descfmt
MOREINFO="NONE",LINKEND="X82466"srv_sendrow
MOREINFO="NONE", LINKEND="X65415"srv_setcoldata
MOREINFO="NONE", LINKEND="X94031"srv_setcollen
MOREINFO="NONE", LINKEND="X87730"Types
ID="IN6812-50177230"srv_describeID="IN6912-53181231"srv_dropproc
srv_dropproc
Destroy a non-client thread created with MOREINFO="NONE"srv_createproc. FORMAT="LINESPECIFIC"CS_RETCODE srv_dropproc(spp)FORMAT="LINESPECIFIC"SRV_PROC      *spp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_dropproc destroys a thread that was created earlier by MOREINFO="NONE"srv_createproc. It is an error to try to drop a thread that is associated with a client connection. MOREINFO="NONE"srv_dropproc will not be in future Open Server releases. The MOREINFO="NONE"srv_termproc routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE    ex_srv_dropproc PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC      *srvprocREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_DROPPROCREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to destroy a non-client thread**    created with srv_createproc.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    srvproc     A pointer to an internal thread control**                structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEEDREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAILREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE            ex_srv_dropproc(srvproc)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC              *srvproc;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_INT        conntype;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* See if this is the site handler logging in */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC" srv_thread_props(srvproc, CS_GET, SRV_T_TYPE, (CS_INT *)                &conntype, sizeof(CS_INT), (CS_INT *)NULL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC" REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* srv_dropproc doesn't work on client threads. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if (conntype == SRV_TCLIENT)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {    REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(srv_dropproc(srvproc));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"ReturnsREMAP="BO--Body"CS_SUCCEED if the thread exists and is a non-client thread and was dropped. REMAP="BO--Body"CS_FAIL if an error was detected. See AlsoREMAP="BO--Body"LINKEND="X35449"srv_createproc
MOREINFO="NONE", LINKEND="X94254"srv_event
MOREINFO="NONE", LINKEND="X40599"srv_event_deferred
MOREINFO="NONE", LINKEND="X60232"srv_spawn
MOREINFO="NONE", LINKEND="X75457"srv_termproc
ID="IN6912-56184239"srv_dropprocID="X26762"ID="IN7011-59188240"srv_dynamic
srv_dynamic
Read or respond to a client Dynamic SQL command. FORMAT="LINESPECIFIC"CS_RETCODE srv_dynamic(spp, cmd, item, bufp,FORMAT="LINESPECIFIC"                          buflen, outlenp)FORMAT="LINESPECIFIC"SRV_PROC       *spp;FORMAT="LINESPECIFIC"CS_INT         cmd;FORMAT="LINESPECIFIC"CS_INT         item;FORMAT="LINESPECIFIC"CS_VOID        *bufpFORMAT="LINESPECIFIC"CS_INT         buflen;FORMAT="LINESPECIFIC"CS_INT         *outlenpParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.cmd - cmd indicates whether a dynamic command is being read from or sent to a client. The following table describes the legal values for cmd:TOCENTRY="1"LBL="Table 3-22: "Values for cmd (srv_dynamic)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="108*"COLNAME="C2" COLWIDTH="252*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"srv_dynamic is sending a response to a dynamic 
command back to a clientCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"srv_dynamic is reading a dynamic command from a 
clientitem - Indicates what kind of information is being sent or retrieved. The following table describes the legal values for item:TOCENTRY="1"LBL="Table 3-23: "Values for item (srv_dynamic)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="117*"COLNAME="C2" COLWIDTH="243*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DYN_TYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The type of dynamic operation being performedCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DYN_IDLENCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The length of the dynamic statement IDCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DYN_IDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The dynamic statement IDCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DYN_STMTLENCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The length of the dynamic statementCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DYN_STMTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The dynamic statement that is being prepared or 
executedbufp - A pointer to the buffer in which the item value is returned (CS_GET) or set (CS_SET).buflen - The length, in bytes, of the *bufp buffer. The following table summarizes the required buffer sizes:TOCENTRY="1"LBL="Table 3-24: "Required Buffer Sizes (srv_dynamic)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="117*"COLNAME="C2" COLWIDTH="304*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Required Format (Size)VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DYN_TYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"sizeof(CS_INT).COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DYN_IDLENCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"sizeof(CS_INT).COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DYN_IDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Varies. Determine length by first calling MOREINFO="NONE"srv_dynamic with item set 
to CS_DYN_IDLEN and then allocate buffer size accordingly.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DYN_STMTLENCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"sizeof(CS_INT).COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DYN_STMTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Varies. Determine length by first calling MOREINFO="NONE"srv_dynamic with item set 
to CS_DYN_STMTLEN and then allocate buffer size accordingly.outlenp - A pointer to an integer variable which is set to the actual length of data copied into *bufp when retrieving data from the client (cmd is CS_GET). This argument is not required if cmd is CS_SET.CommentsMARK="BULL" REMAP="BU--Bullet"The MOREINFO="NONE"srv_dynamic routine allows an Open Server application to read a Dynamic SQL command or send a response to such a command.Valid operation types (SRV_DYN_TYPE) include:REMAP="UN--Under"CS_PREPARE - prepare a statement (CS_GET only).REMAP="UN--Under"CS_DESCRIBE_INPUT - request input parameter formats for the current prepared statement (CS_GET only).REMAP="UN--Under"CS_DESCRIBE_OUTPUT - request column formats for the current prepared statement (CS_GET only).REMAP="UN--Under"CS_EXECUTE - execute a prepared statement (CS_GET only).REMAP="UN--Under"CS_EXEC_IMMEDIATE - execute an unprepared statement, which has no parameters and does not return results (CS_GET only).REMAP="UN--Under"CS_DEALLOC - deallocate a prepared statement (CS_GET only).REMAP="UN--Under"CS_ACK - acknowledge a Dynamic SQL command from client (CS_SET only).Each dynamic command received from a client triggers a SRV_DYNAMIC event. An Open Server application can then call MOREINFO="NONE"srv_dynamic, in response to each client dynamic command, to retrieve and store the operation type, statement ID and statement, and then acknowledge the client communication, by issuing a MOREINFO="NONE"srv_dynamic call with type set to CS_ACK.It is an error to call MOREINFO="NONE"srv_dynamic in any event handler other than a SRV_DYNAMIC handler.CS_ACK is the only dynamic operation type that can be set (cmd set to CS_SET).CS_PREPARE, CS_DESCRIBE_INPUT, CS_DESCRIBE_OUTPUT, CS_EXEC, CS_EXEC_IMMEDIATE and CS_DEALLOC are the only dynamic operation types that can be retrieved (cmd set to CS_GET).Sending a full Dynamic SQL response to a client requires passing the ID length, the ID, and the operation type. This requires three distinct calls to MOREINFO="NONE"srv_dynamic. It is an error, for example, to set just the statement ID and then call MOREINFO="NONE"srv_senddone. The only exception is if the operation type is CS_EXEC_IMMEDIATE, for which there is no associated statement ID.Parameter data formats and output column formats can be sent to a client, in response to a CS_PREPARE dynamic command, using MOREINFO="NONE"srv_descfmt and MOREINFO="NONE"srv_xferdata with a type argument of SRV_DYNDATA. Note that MOREINFO="NONE"srv_bind is not necessary here, as the application is simply sending formats.An Open Server application retrieves and store the parameter data sent by a client following the CS_EXEC dynamic command using MOREINFO="NONE"srv_descfmt, MOREINFO="NONE"srv_bind, and MOREINFO="NONE"srv_xferdata, with a type argument of SRV_DYNDATA. The application determines the number of parameters using MOREINFO="NONE"srv_numparams. The application sends Dynamic SQL result rows to the client, in response to a CS_EXECUTE Dynamic SQL command, using MOREINFO="NONE"srv_descfmt, MOREINFO="NONE"srv_bind, and MOREINFO="NONE"srv_xferdata with a type argument of SRV_ROWDATA. A Dynamic SQL command of CS_EXEC_IMMEDIATE indicates that the client wishes to execute a statement without parameters and receive only a DONE as a result. The statement is contained in the CS_EXEC_IMMEDIATE command stream and is accessible via SRV_DYN_STMT. The statement has not been previously prepared-the statement ID length (SRV_DYN_IDLEN) will be 0-and will cease to exist once the SRV_DYNAMIC event handler has exited.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include        <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"extern CS_RETCODE                ex_srv_dynamic PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID     *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT      *optypepREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_DYNAMICREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to retrieve dynamic operation type from a**    client.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp      Thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    optypep  Dynamic operation type.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED   Dynamic information was retrieved **                 successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL      An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_dynamic(spp, optypep)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC   *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     *optypep;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_INT     outlen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if(srv_dynamic(spp, CS_GET, SRV_DYN_TYPE, optypep,        sizeof(*optypep), &outlen) == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the Open Server application successfully retrieved dynamic command items (CS_GET) or sends them (CS_SET).REMAP="BO--Body"CS_FAIL if an error was detected.See AlsoREMAP="BO--Body"LINKEND="X30757"srv_bind
MOREINFO="NONE", LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X87885"srv_numparams
MOREINFO="NONE", LINKEND="X52699"srv_xferdata
MOREINFO="NONE", LINKEND="X26626"Dynamic SQL
ID="IN7011-62191248"srv_dynamicID="IN7113-65195249"srv_envchange
srv_envchange
Notify the client of an environment change.FORMAT="LINESPECIFIC"CS_RETCODE srv_envchange(spp, type, oldvalpFORMAT="LINESPECIFIC"            oldvallen, newvalp, newvallen)FORMAT="LINESPECIFIC"SRV_PROC    *spp;FORMAT="LINESPECIFIC"CS_INT      type;FORMAT="LINESPECIFIC"CS_CHAR     *oldvalp;FORMAT="LINESPECIFIC"CS_INT      oldvallenFORMAT="LINESPECIFIC"CS_CHAR     *newvalp;FORMAT="LINESPECIFIC"CS_INT      newvallenParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.type - The environment being changed. Currently, the only legal values are SRV_ENVDATABASE and SRV_ENVLANG, the name of the current database and the current national language, respectively.oldvalp - A pointer to the character string containing the old value. It can be NULL. Its length in bytes is stored in oldvallen.oldvallen - The length, in bytes, of the string in *oldvalp. It can be CS_NULLTERM, which indicates that the string in *oldvalp is null terminated. It can also be CS_UNUSED, indicating that the string in *oldvalp is NULL.newvalp - A pointer to the character string containing the new value of the environment variable. It can be null. Its length in bytes is stored in newvallen.newvallen - The length, in bytes, of the string in *newvalp. It can be CS_NULLTERM, which indicates that the string in newvalp is null terminated. It can also be CS_UNUSED, indicating that the string in *newvalp is NULL.CommentsMARK="BULL" REMAP="BU--Bullet" There are various settable "environment" variables. Open Server handles some automatically, while others must be handled by an Open Server application. Currently, an application can only inform a client of a change to the current database or national language. Open Server calls an Open Server application's error handler any time one of the values changes. An Open Server application can change it via MOREINFO="NONE"srv_envchange, or Open Server can change it using internal code, or both. The error number passed to the error handler is the SQL Server message number sent back to a client when one of these values changes. This allows a client application to match the same message number to a changing value, whether the client is connected to an Open Server or a SQL Server. The following table lists the message number and oserror.h define that correspond to each changing value.TOCENTRY="1"LBL="Table 3-25: "Environment Variables (srv_envchange)COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="129*"COLNAME="C2" COLWIDTH="106*"COLNAME="C3" COLWIDTH="115*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Changing ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Message NumberCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Define in oserror.hVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Current DatabaseCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"5701COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SQLSRV_ENVDBCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"National LanguageCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"5703COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SQLSRV_ENVLANGExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE  ex_srv_envchange PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC    *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_ENVCHANGEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to notify the client of an environment**    change.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp    A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_SUCCEED    Succesfully notified client of environment**                   change.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE   ex_srv_envchange(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC     *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_RETCODE   retval;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Notify the client that we've changed the database    ** from "master" to "pubs2".REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    retval = srv_envchange(spp, SRV_ENVDATABASE, "master",REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"             CS_NULLTERM, "pubs2", CS_NULLTERM);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return (retval);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the Open Server application successfully sent the new value to the client.REMAP="BO--Body"CS_FAIL if an error was detected.ID="IN7113-68198256"srv_envchangeID="IN7213-71202257"srv_errhandle
srv_errhandle
Define an error-handler for Open Server errors. FORMAT="LINESPECIFIC"CS_INT (*srv_errhandle(handlerp))()FORMAT="LINESPECIFIC"CS_INT    (*handlerp)();ParametersREMAP="RI--RefIndent"handler - A pointer to the function that is called whenever Open Server determines that an error has occurred. The following table describes the parameters with which Open Server calls the function: TOCENTRY="1"LBL="Table 3-26: "Parameters for handler (srv_errhandle)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="80*"COLNAME="C2" COLWIDTH="242*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ArgumentCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_SERVER *COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The Open Server control structureCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_PROC *COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The thread that detected the errorCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_INTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The Open Server error numberCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_BYTECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The severity of the error: informational (SRV_INFO), 
fatal for the thread (SRV_FATAL_PROCESS), or fatal 
for the Open Server (SRV_FATAL_SERVER)COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_BYTECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The state of the errorCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_INTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The operating-system error numberCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CHAR *COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The Open Server error stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_INTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The length of the Open Server error stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CHAR *COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The operating system error stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_INTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The length of the operating system error stringCommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_errhandle installs a programmer-supplied error handler function in the Open Server application. When an error occurs, Open Server calls this error handler. If the programmer-supplied error handler returns SRV_EXIT_PROGRAM, a SRV_STOP event is queued. Any other value the handler returns is ignored. Otherwise, the error handler should always SRV_CONTINUE. You must include oserror.h if you use SRV_EXIT_PROGRAM. If no error handler is installed, error messages are written to the Open Server log file. You can de-install an existing error handler by calling MOREINFO="NONE"srv_errhandle with a null parameter. You can also install a new error handler at any time. The new handler replaces the existing handler. The error numbers and severities are defined in the header file oserror.h. If you want to use the defined error values, you must include oserror.h. MOREINFO="NONE"srv_errhandle will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_props routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include        <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include        <oserror.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID ex_srv_errhandle      PROTOTYPE((CS_VOID));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT user_errhandle         PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_SERVER      *server,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *sproc,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          srverrnum,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"int             severity,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"int             state,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          oserrnum,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *srverrstr,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          srverrlen,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *oserrstr,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          oserrlenREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_ERRHANDLEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    An example routine to install a user error handler using**    srv_errhandle.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    None.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Nothing.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID    ex_srv_errhandle()REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_INT    (*prev_errhandler)();REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    prev_errhandler = srv_errhandle(user_errhandle);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** USER_ERRHANDLEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     An example of a user error handler routine.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    server        A pointer to the Open Server control**                  structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    sproc         The affected Open Server connection.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    srverrnum     The Open Server error number.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    severity      The severity of the error.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    state         The state of the error.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    oserrnum      The operating system error number.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    srverrstr     The Open Server error string.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    srverrlen     The length of the Open Server error string.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    oserrstr      The operating system error string.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    oserrlen      The length of the operating system error**                  string.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    SRV_CONTINUE      If the error is informational.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    SRV_EXIT_PROGRAM  If the severity is SRV_FATAL_PROCESS**                      or SRV_FATAL_SERVER.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     user_errhandle(server, sproc, srverrnum, severity,                             state, oserrnum, srverrstr,                              srverrlen, oserrstr, oserrlen)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_SERVER  *server;         /* The active Open Server. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC  *sproc;            /* The client process. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     srverrnum;    /* The Open Server error number. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_BYTE    severity;     /* The severity of the error. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_BYTE    state;        /* The state of the error. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     oserrnum;     /* The operating system error. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR    *srverrstr;   /* The Open Server error string. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     srverrlen;             /* Length of the Open Server error string. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR    *oserrstr;   /* The operating system error string */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT  oserrlen;/* Length of the operating system error string*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Check for an operating system error.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if ( oserrnum != SRV_ENO_OS_ERR )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        ** There is an operating system error, so we will        ** print the error to the Open Server log file.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        (CS_VOID)srv_log(server, CS_TRUE, srverrstr,                        srverrlen);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Print the Open Server error message to the log file.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    (CS_VOID)srv_log(server, CS_TRUE, oserrstr, oserrlen);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Terminate the Open Server application if the severity of     ** the error is SRV_FATAL_SERVER.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if ( severity == SRV_FATAL_SERVER )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        (CS_VOID)srv_log(server, CS_TRUE,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            "FATAL SERVER ERROR: Abort!", CS_NULLTERM);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(SRV_EXIT_PROGRAM);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Break the connection if the severity is     ** SRV_FATAL_PROCESS.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if ( severity == SRV_FATAL_PROCESS )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        (CS_VOID)srv_log(server, CS_TRUE,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            "FATAL CONNECTION ERROR: Abort!", CS_NULLTERM);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        srv_event(sproc, SRV_DISCONNECT, (CS_VOID *)NULL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(SRV_CONTINUE);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ReturnsREMAP="BO--Body"A pointer to the previously installed error handling function. See AlsoREMAP="BO--Body"LINKEND="X37615"srv_sendinfo
MOREINFO="NONE",LINKEND="X83099"Client Command Errors
ID="IN7213-74205265"srv_errhandleID="X94254"ID="IN739-77209266"srv_event
srv_event
Add an event request to a thread's request-handling queue. FORMAT="LINESPECIFIC"CS_INT srv_event(spp, event, datap)FORMAT="LINESPECIFIC"SRV_PROC    *spp;FORMAT="LINESPECIFIC"CS_INT      event;FORMAT="LINESPECIFIC"CS_VOID     datap;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure. event - The token for the event to add to the client's event queue.  See the LINKEND="X78566"Events
 topics page, for a list of defined events. datap - A pointer (CS_VOID) to data supplied by the Open Server programmer. An application can retrieve the data by calling MOREINFO="NONE"srv_thread_props with property set to SRV_T_EVENTDATA, from within the event handler. CommentsMARK="BULL" REMAP="BU--Bullet"Add an event request to the event queue of a particular client thread. Event requests are usually added to a event request queue automatically, for example, by Client-Library calls from the client application. However, Open Server programmers can specifically add requests with MOREINFO="NONE"srv_event. The following events can be added to an event queue by MOREINFO="NONE"srv_event: SRV_DISCONNECTSRV_URGDISCONNECT SRV_STOPProgrammer-defined events. MOREINFO="NONE"srv_handle tells Open Server which event handler to call when an event occurs. If no handler is defined for a particular event, the default Open Server event handler is called. The SRV_URGDISCONNECT event causes an Open Server application's SRV_DISCONNECT event handler to be called.The SRV_URGDISCONNECT event is queued as an urgent event. This allows an application to place a disconnect event at the top of a thread's event queue, skipping any currently queued events. This is useful to implement immediate termination of an Open Server thread.If the event is programmer-defined, it must first be defined with MOREINFO="NONE"srv_define_event before it can be triggered.MOREINFO="NONE"srv_event adds any event except SRV_STOP or SRV_START to a thread's event queue. In the case of a SRV_STOP or SRV_START event, spp points to the internal thread control structure for the thread requesting the event.An Open Server application cannot call any routine that does I/O from inside a user-defined event.In interrupt-level code, use MOREINFO="NONE"srv_event_deferred instead of MOREINFO="NONE"srv_event. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE   ex_srv_event PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC     *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT       event,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID     *datapREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_EVENTREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to queue an event request to an Open Server**    thread's request-handling queue.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Note that if the event is an user-defined one, it**    must have been defined earlier using srv_define_event.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp        A pointer to a control structure for an Open **               Server thread.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    event      The token for the event to be added to the queue.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    datap      Data pointer.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    The event was queued successfullyREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE  ex_srv_event(spp, event, datap)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC    *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT      event;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID     *datap;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if (srv_event(spp, event, datap) == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    elseREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return (CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"The token for the requested event if successful, CS_FAIL otherwise. See AlsoREMAP="BO--Body"LINKEND="X96733"srv_define_event
MOREINFO="NONE", LINKEND="X92794"SRV_EVENTDATA
MOREINFO="NONE", LINKEND="X76123"srv_handle
MOREINFO="NONE", LINKEND="X40599"srv_event_deferred
MOREINFO="NONE", LINKEND="X51398"srv_thread_props
MOREINFO="NONE", LINKEND="X78566"Events
ID="IN739-80212274"srv_eventID="X40599"srv_event_deferredID="IN7418-83216275"srv_event_deferred
Add an event request to the event queue of a thread as the result of an asynchronous event. FORMAT="LINESPECIFIC"CS_INT srv_event_deferred(spp, event, datap)FORMAT="LINESPECIFIC"SRV_PROC    *spp;FORMAT="LINESPECIFIC"CS_INT      event;FORMAT="LINESPECIFIC"CS_VOID     *datap;ParametersREMAP="RI--RefIndent" spp - A pointer to an internal thread control structure. event - The event to add to the thread's event queue. datap - A pointer (CS_VOID) to data supplied by the Open Server programmer. An application can retrieve the data by calling MOREINFO="NONE"srv_thread_props with property set to SRV_T_EVENTDATA from within the event handler. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_event_deferred adds an event request to the event queue of a thread from interrupt-level code, such as signal delivery on UNIX or AST delivery on VMS. The event request is deferred until critical functions internal to Open Server have been completed, if any such functions were being performed when MOREINFO="NONE"srv_event_deferred was called. Some Open Server applications must be able to raise events from interrupt-level code. For example, if you want to raise an event within the attention handler or you're using the alarm signal in the Open Server application code, you must use MOREINFO="NONE"srv_event_deferred instead of MOREINFO="NONE"srv_event. MOREINFO="NONE"srv_event_deferred ensures that critical functions, such as updating linked lists or performing other internals housekeeping, are completed before the event request is acted on. In interrupt-level code, use MOREINFO="NONE"srv_event_deferred instead of MOREINFO="NONE"srv_event. Open Server usually adds event requests to a thread's event request queue automatically. However, you can specifically add requests with MOREINFO="NONE"srv_event_deferred. The following events can be added to an event queue by MOREINFO="NONE"srv_event_deferred: REMAP="UN--Under"SRV_DISCONNECTREMAP="UN--Under"SRV_URGDISCONNECTREMAP="UN--Under"SRV_STOPREMAP="UN--Under"Programmer-defined eventsMOREINFO="NONE"srv_handle tells the Open Server which event handler to call when an event occurs. If no handler is defined for a particular event, the default event Open Server handler is called. If the event is programmer-defined, it must be defined with MOREINFO="NONE"srv_define_event before it can be triggered. MOREINFO="NONE"srv_event adds any event except SRV_STOP or SRV_START to a thread's event queue. In the case of a SRV_STOP or SRV_START event, spp points to the internal thread control structure for the thread requesting the event.An Open Server application cannot call any routine that does I/O from inside a user-defined event.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE   ex_srv_event_deferred PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC     *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT       event,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID      *datapREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_EVENT_DEFERREDREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to queue up a deferred event using**    srv_event_deferred. A deferred event request will **    typically be made from within interrupt-level code.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp       A pointer to the internal thread control **              structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    event     The event to add to the thread's queue.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    datap     A pointer to data to attach to the event.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    The event was sucecssfully queued.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE          ex_srv_event_deferred(spp, event, datap)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC            *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT              event;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID             *datap;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Add a deferred event to the event queue.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if (srv_event_deferred(spp, event, datap) == -1)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"The requested event. If there was an error, -1 is returned. See AlsoREMAP="BO--Body"LINKEND="X96733"srv_define_event
MOREINFO="NONE", LINKEND="X94254"srv_event
MOREINFO="NONE", LINKEND="X76123"srv_handle
MOREINFO="NONE", LINKEND="X51398"srv_thread_props
MOREINFO="NONE", LINKEND="X78566"Events
ID="IN7418-86219283"srv_event_deferredID="X92794"ID="IN7513-89223284"SRV_EVENTDATA
SRV_EVENTDATA
Access event handler data passed by MOREINFO="NONE"srv_event or MOREINFO="NONE"srv_event_deferred. FORMAT="LINESPECIFIC"CS_VOID *SRV_EVENTDATA(spp)FORMAT="LINESPECIFIC"SRV_PROC     *spp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.CommentsMARK="BULL" REMAP="BU--Bullet"When an event is explicitly raised by MOREINFO="NONE"srv_event orMOREINFO="NONE" srv_event_deferred, a pointer to data can be passed along with the event. This pointer is available in the event handler with the MOREINFO="NONE"SRV_EVENTDATA macro. Data can be passed to event handlers for any event.MOREINFO="NONE"SRV_EVENTDATA will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_thread_props routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_eventdata PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC       *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID        **dppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_EVENTDATAREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Example routine using SRV_EVENTDATA to return the user-**     defined data pointer passed by srv_event or **     srv_event_deferred, which can be NULL. This example routine **     would be called from the event handler for the raised event.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     spp     A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     dpp     Output pointer to the returned data.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_SUCCEED     A valid data pointer was returned.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_FAIL        An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE            ex_srv_eventdata(spp, dpp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC              *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID               **dpp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Retrieve the data pointer. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if ((*dpp = SRV_EVENTDATA(spp)) == (CS_VOID *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"A pointer to data passed by MOREINFO="NONE"srv_event orMOREINFO="NONE" srv_event_deferred. The pointer can be null. See AlsoREMAP="BO--Body"LINKEND="X94254"srv_event
MOREINFO="NONE", LINKEND="X40599"srv_event_deferred
MOREINFO="NONE",LINKEND="X51398"srv_thread_props
MOREINFO="NONE", LINKEND="X78566"Events
ID="IN7513-92226292"SRV_EVENTDATAREMAP="BO--Body"ID="X68633"srv_freeID="IN4389751"srv_free
Free previously allocated memory. FORMAT="LINESPECIFIC"CS_RETCODE srv_free(mp)FORMAT="LINESPECIFIC"CS_VOID            *mp;ParametersREMAP="RI--RefIndent"mp - A pointer to the memory to be freed. CommentsMARK="BULL" REMAP="BU--Bullet"Use MOREINFO="NONE"srv_free only to free memory allocated by MOREINFO="NONE"srv_alloc, MOREINFO="NONE"srv_config_alloc, MOREINFO="NONE"srv_init, or MOREINFO="NONE"srv_realloc. Currently, MOREINFO="NONE"srv_free calls the C routine, free. A 10.0 Open Server application, however, can install its own memory management routines using the new MOREINFO="NONE"srv_props routine. The parameter-passing conventions of the user-installed routine must be the same as those of free. If the application is not configured to use the user-installed routines, it will use free.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE ex_srv_free PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_BYTE   *pREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_FREEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Example routine to free memory allocated via srv_alloc.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**        p - The address of the memory block to be freed.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED      Memory was freed successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL         An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_free(p)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_BYTE        *p;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Free the memory block.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if( srv_free(p) == CS_FAIL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return CS_FAIL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return CS_SUCCEED;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the memory was successfully freed. REMAP="BO--Body"CS_FAIL if an error was detected.See AlsoREMAP="BO--Body"LINKEND="X95939"srv_alloc
, LINKEND="X78569"srv_config_alloc
, LINKEND="X84669"srv_props
, LINKEND="X58541"srv_realloc
, LINKEND="X24609"srv_init
ID="IN4389489"srv_freeID="X23785"ID="INB4412911210"srv_get_text
srv_get_text
Read a text or image datastream from a client, in chunks. FORMAT="LINESPECIFIC"CS_RETCODE srv_get_text(spp, bp, buflen, outlenp)FORMAT="LINESPECIFIC"SRV_PROC    *spp;FORMAT="LINESPECIFIC"CS_BYTE     *bp;FORMAT="LINESPECIFIC"CS_INT      buflen;FORMAT="LINESPECIFIC"CS_INT      *outlenp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.bp - A pointer to a buffer where the data from the client is placed. buflen - The size of the *bp pointer. This indicates how many bytes are transferred in each chunk.outlenp - The number of the bytes read into the *bp buffer is returned here.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_get_text is used to read bulk data from a client. The bulk data can be of type text or image.MOREINFO="NONE"srv_get_text must be called until all of the bulk data has been read from a client. It returns CS_END_DATA when the whole data stream has been read in.MOREINFO="NONE"srv_get_text can only be called from inside the SRV_BULK event handler.A column read with MOREINFO="NONE"srv_get_text must be of type text or image.An Open Server application must call MOREINFO="NONE"srv_text_info prior to the first call to MOREINFO="NONE"srv_get_text for the data stream. The application then calls MOREINFO="NONE"srv_get_text to retrieve a chunk. MOREINFO="NONE"srv_get_text is called as many times as are necessary to read in the whole column.Open Server treats text and image data streams except that it converts only text data before sending it to the Open Server application. The only conversion by Open Server performs is character set translation.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include        <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include        <stdio.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE    ex_srv_get_text PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC      *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT        *outlenp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_BYTE       *bbufREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_GET_TEXTREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to read chunks of text or image datastream**    from a client into a buffer and then write it to a disk**    file.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp        Pointer to thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    outlenp    Number of bytes read and written.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    bbuf       Pointer to very large buffer for text.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** ReturnsREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    The data was successfully read.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       An error was detected.***/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#define    BUFSIZE     256REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#define    FPUTS(a,b)      fputs(a,b)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE  ex_srv_get_text(spp,outlenp,bbuf)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC    *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT      *outlenp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_BYTE     *bbuf;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"  CS_INT       llen;    /* Local length. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"  CS_INT       lout;    /* Local read count. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"  CS_RETCODE   lret;    /* Local return code. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"  CS_BYTE      *lbufp;  /* Local pointer into bbuf. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"  /* Check arguments. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"  if(bbuf == (CS_VOID *)0)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"  if(spp == (SRV_PROC *)0)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"  llen = BUFSIZE;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"  lbufp = bbuf;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   ** Loop around getting data and copy it to bbuf.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   while(lret != CS_END_DATA)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        (CS_VOID)srv_bzero(lbufp,BUFSIZE);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        lout = 0;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        lret = srv_get_text(spp, lbufp, llen, &lout);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        if(lret == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            break;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        *outlenp += lout;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        lbufp += lout;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if(lret == CS_END_DATA)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    elseREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(lret);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the text or image data chunk was successfully read from a client.REMAP="BO--Body"CS_FAIL if an error was detected.REMAP="BO--Body"CS_END_DATA if the entire text or image data stream has been read in.See AlsoREMAP="BO--Body"LINKEND="X30757"srv_bind
MOREINFO="NONE", srv_bulk_type, LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X43143"srv_send_text
MOREINFO="NONE", LINKEND="X13415"srv_text_info
MOREINFO="NONE", LINKEND="X51398"srv_thread_props
MOREINFO="NONE", LINKEND="X52699"srv_xferdata
MOREINFO="NONE", LINKEND="X27944"International Support
MOREINFO="NONE", LINKEND="X12233"Text and Image
ID="INB4412881518"srv_get_textID="X48434"ID="IN4513851919"SRV_GETCONFIG
SRV_GETCONFIG
Access the Open Server configuration structure. FORMAT="LINESPECIFIC"SRV_CONFIG *SRV_GETCONFIG(ssp)FORMAT="LINESPECIFIC"SRV_SERVER    *ssp;ParametersREMAP="RI--RefIndent"ssp - A pointer to the Open Server control structure. CommentsMARK="BULL" REMAP="BU--Bullet"The SRV_SERVER structure contains information about the Open Server, such as the server name, current status, and the event list. The SRV_SERVER structure contains a copy of the SRV_CONFIG structure used to configure the Open Server. The MOREINFO="NONE"SRV_GETCONFIG macro accesses the SRV_SERVER structure's SRV_CONFIG structure via a procedure call. For example, to change the Open Server log file after the server has been started, call MOREINFO="NONE"SRV_GETCONFIG to get a pointer to the SRV_CONFIG structure. Then pass the pointer to MOREINFO="NONE"srv_config to change the log file, as the following code demonstrates: REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"int   change_log(ssp) SRV_SERVER  *ssp; {    SRV_CONFIG *scp;    scp = SRV_GETCONFIG(ssp);    srv_config(scp, SRV_LOGFILE, "new.log",             CS_NULLTERM);         return (SRV_CONTINUE); } MOREINFO="NONE"SRV_GETCONFIG will not be supported in future Open Server releases. Instead, applications will access a MOREINFO="NONE"CS_CONTEXT structure, via a call to MOREINFO="NONE"srv_props. For details, see the LINKEND="X41578""Tailoring Your Open Server"
 topics page.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*** Local Prototype*/CS_RETCODE      ex_srv_getconfig PROTOTYPE((SRV_SERVER      *server));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* ** EX_SRV_GETCONFIG****    Example routine to access Open Server's configuration **    structure.**** Arguments:****    server- A pointer to the Open Server control structure.**** Returns:****    CS_SUCCEED**    CS_FAIL*/CS_RETCODE            ex_srv_config(server)SRV_SERVER            *server;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_CONFIG            *configp;if ((configp = SRV_GETCONFIG(server)) == (SRV_CONFIG *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    elseREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        srv_config(configp, SRV_LOGFILE, "mylog",    CS_NULLTERM);        return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"A pointer to the SRV_CONFIG structure. If server is (SRV_SERVER *) NULL, (SRV_CONFIG *) NULL is returned.See AlsoREMAP="BO--Body"LINKEND="X71144"srv_config
MOREINFO="NONE", LINKEND="X55932"SRV_GETSERVER
MOREINFO="NONE", LINKEND="X84669"srv_props
ID="IN4513822227"SRV_GETCONFIGID="X37685"ID="IN4614792628"srv_getloginfo
srv_getloginfo
Obtain login information from a client thread to prepare a pass-through connection with a remote server. FORMAT="LINESPECIFIC"CS_RETCODE srv_getloginfo(spp, loginfo)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_LOGINFO       **loginfo;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.loginfo - A pointer to a CS_LOGINFO pointer that will be set to the address of a newly allocated CS_LOGINFO structure.CommentsMARK="BULL" REMAP="BU--Bullet"Use MOREINFO="NONE"srv_getloginfo in gateway applications that use pass-through mode. In pass-through mode, a gateway application passes packets between clients and remote SYBASE servers without interpreting the protocol. When a client connects directly to a server, the two programs negotiate the protocol format they will use to send and receive data. When you use protocol pass-through in a gateway application, the Open Server forwards protocol packets between a client and a remote server. Therefore, the client and the remote server must agree on the protocol version. MOREINFO="NONE"srv_getloginfo is the first of four calls, two of them CS-Library calls, that allow a client and remote server to negotiate a protocol format. The calls, which can only be made in a SRV_CONNECT event handler, are: NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"MOREINFO="NONE"srv_getloginfo - Allocate a CS_LOGINFO structure and fill it with protocol information from the client thread. MOREINFO="NONE"ct_setloginfo - Prepare a CS_LOGINFO structure with the protocol information retrieved in step 1, then log into the remote server with MOREINFO="NONE"ct_connect. MOREINFO="NONE"ct_getloginfo - Transfer protocol login response information from a CS_CONNECTION structure to the newly-allocated CS_LOGINFO structure. MOREINFO="NONE"srv_setloginfo - Send the remote server's response, retrieved in step 3, to the client, then release the CS_LOGINFO structure.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"extern CS_RETCODE   ex_srv_getloginfo PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID             *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID             **loginfoppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_GETLOGINFOREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to retrieve the client's login structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   spp        Thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   loginfopp  A pointer to client's login record returned here.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    Login structure was retrieved successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE ex_srv_getloginfo(spp, loginfopp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC   *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_LOGINFO **loginfopp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* Initialization. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    *loginfopp = (CS_LOGINFO *)NULL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if(srv_getloginfo(spp, loginfopp) == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X69557"srv_recvpassthru
MOREINFO="NONE", LINKEND="X30039"srv_sendpassthru
MOREINFO="NONE", LINKEND="X72527"srv_setloginfo
ID="IN4614762936"srv_getloginfoID="X70696"ID="IN4711733337"srv_getmsgq
srv_getmsgq
Get the next message from a message queue. FORMAT="LINESPECIFIC"CS_RETCODE srv_getmsgq(msgqid, msgp, getflags, infop)FORMAT="LINESPECIFIC"SRV_OBJID    msgqid;FORMAT="LINESPECIFIC"CS_VOID      **msgp;FORMAT="LINESPECIFIC"CS_INT       getflags;FORMAT="LINESPECIFIC"CS_INT       *infop;ParametersREMAP="RI--RefIndent"msgqid - The identifier for the message queue from which to get a message. To reference the message queue by name, call MOREINFO="NONE"srv_getobjid with the name to yield the message queue ID. msgp - A pointer to a pointer variable that MOREINFO="NONE"srv_getmsgq sets to the message's address. getflags - The values for getflags can be OR'd together. The following table lists the legal values for getflags, and their significance: TOCENTRY="1"LBL="Table 3-27: "Values for getflags (srv_getmsgq)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="117*"COLNAME="C2" COLWIDTH="225*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SignificanceVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_M_WAITCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If no message is available, MOREINFO="NONE"srv_getmsgq sleeps 
until a message is delivered. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_M_NOWAITCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"srv_getmsgq returns immediately whether a 
message is available or not. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_M_READ_ONLYCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The default behavior of MOREINFO="NONE"srv_getmsgq is to remove 
the message from the message list and to wake 
up any thread that is waiting for the message to 
be read. If SRV_M_READ_ONLY is set, a 
message pointer is returned, but the message is 
not removed from the list and the thread waiting 
for the message to be read does not wake up. 
This option can be used to peek at the head of 
the message queue to see if the message is 
intended for the thread. infop - A pointer to a CS_INT. The following table describes the possible values returned in *infop if MOREINFO="NONE"srv_getmsgq returns CS_FAIL: TOCENTRY="1"LBL="Table 3-28: "Values for infop (srv_getmsgq)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="117*"COLNAME="C2" COLWIDTH="243*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_WOULDWAITCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The SRV_M_NOWAIT flag was set in the getflags 
field and there are no messages to be read. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_DELETEDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"While waiting for a message, the message queue 
was deleted. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_INTERRUPTEDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The SRV_M_WAIT flag was set in the getflags field 
and this call was interrupted before the message 
arrived.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_UNKNOWNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Some other error occurred. Look in the log file for a 
message. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_getmsgq puts the address of the next message from the message queue msgqid in *msgp. If the thread that sent the message specified that it would sleep until the message is read, it wakes up. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local prototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID    ex_srv_getmsgq PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_OBJID  msgqid,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     *infopREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_GETMSGQREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to get messages from a message queue.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    msgqid-    The id of the message queue from which to get**               the message.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    infop-     Will hold information about why this routine**               failed. Comes directly from srv_getmsg.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Nothing. If this routine returns, it is because srv_getmsgq**    failed. Check infop to see why it failed.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID    ex_srv_getmsgq(msgqid, infop)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_OBJID  msgqid;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     *infop;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_CHAR   *message;   /* This message is a string. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Loop processing messages. Go to sleep if no messages are    ** available.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    while (srv_getmsgq(msgqid, (CS_VOID *)&message, SRV_M_WAIT,            infop)== CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        /* Process message.*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* infop will contain the reason why it failed. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return ;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL.See AlsoREMAP="BO--Body"LINKEND="X63435"srv_createmsgq
MOREINFO="NONE", LINKEND="X72703"srv_deletemsgq
MOREINFO="NONE", LINKEND="X37417"srv_getobjid
MOREINFO="NONE", LINKEND="X32227"srv_putmsgq
ID="IN4711703645"srv_getmsgqID="X37417"ID="IN4812674046"srv_getobjid
srv_getobjid
Look up the object ID for a message queue or mutex with a specified name. FORMAT="LINESPECIFIC"CS_RETCODE srv_getobjid(obj_type, obj_namep, FORMAT="LINESPECIFIC"                     obj_namelen, obj_idp, infop)FORMAT="LINESPECIFIC"CS_INT       obj_type;FORMAT="LINESPECIFIC"CS_CHAR      *obj_namep;FORMAT="LINESPECIFIC"CS_INT       obj_namelen;FORMAT="LINESPECIFIC"SRV_OBJID    *obj_idp;FORMAT="LINESPECIFIC"CS_INT       *infop;ParametersREMAP="RI--RefIndent"obj_type - Indicates whether the object is a mutex (SRV_C_MUTEX) or a message queue SRV_C_MQUEUE). obj_namep - A pointer to a CS_CHAR buffer that contains the name of the object. obj_namelen - The length of the string in *obj_namep. If the string is null terminated, obj_namelen can be CS_NULLTERM. obj_idp - A pointer to a SRV_OBJID structure that will receive the identifier for the object, if found. infop - A pointer to a CS_INT. The following table describes the possible values returned in *infop if MOREINFO="NONE"srv_getobjid returns CS_FAIL: TOCENTRY="1"LBL="Table 3-29: "Values for infop (srv_getobjid)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="108*"COLNAME="C2" COLWIDTH="270*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_NOEXISTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The object does not exist. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_UNKNOWNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Some other error occurred, for example, a null object 
name. CommentsMARK="BULL" REMAP="BU--Bullet"Open Server maintains a table that maps the unique object identifiers of message queues and mutexes to their names. Given the name, MOREINFO="NONE"srv_getobjid finds the identifier. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT    ex_srv_getobjid PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT    obj_type,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR   *obj_name,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_OBJID *obj_idpREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_GETOBJIDREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   An example routine to retrieve the object id for a specified**   message queue or mutex name.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   obj_type  SRV_C_MUTEX if requesting a mutex object id, and**             SRV_C_MQUEUE if requesting a message queue object               id.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   obj_name  A null terminated string which specifies the name**             of the message queue or the mutex.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   obj_idp   A pointer to a SRV_OBJID structure that will store**             the identifier for the object.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED    If the object id was retrieved                   successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   SRV_I_NOEXIST   If the object does not exist.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** CS_FAIL    If the object was not retrieved due to               some error.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT        ex_srv_getobjid(obj_type, obj_name, obj_idp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT        obj_type;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR       *obj_name;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_OBJID     *obj_idp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_INT   info;  /* The reason for failure. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_INT   status;  /* The return status. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Validate the obj_type. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if ( (obj_type != SRV_C_MUTEX) && (obj_type !=            SRV_C_MQUEUE) )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* Make sure that the object name is not null. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if ( obj_name == (CS_CHAR *)NULL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* Make sure that the pointer to the SRV_OBJID is not null. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if ( obj_idp == (SRV_OBJID *)NULL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* Get the object id. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    status = (CS_INT)srv_getobjid( obj_type, obj_name,             CS_NULLTERM, obj_idp, &info);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* Check the status. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if ( (status == CS_FAIL) && (info == SRV_I_NOEXIST) )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        status = SRV_I_NOEXIST;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(status);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X63435"srv_createmsgq
MOREINFO="NONE", LINKEND="X69149"srv_createmutex
MOREINFO="NONE", LINKEND="X72703"srv_deletemsgq
MOREINFO="NONE", LINKEND="X30072"srv_deletemutex
MOREINFO="NONE", LINKEND="X70696"srv_getmsgq
MOREINFO="NONE", LINKEND="X19319"srv_getobjname
MOREINFO="NONE", LINKEND="X55165"srv_lockmutex
MOREINFO="NONE",LINKEND="X32227"srv_putmsgq
MOREINFO="NONE", LINKEND="X37215"srv_unlockmutex
ID="IN4812644354"srv_getobjidID="X19319"ID="IN4914614755"srv_getobjname
srv_getobjname
Get the name of a message queue or mutex with a specified identifier. FORMAT="LINESPECIFIC"CS_RETCODE srv_getobjname(obj_type, obj_id, obj_namep,FORMAT="LINESPECIFIC"             obj_namelenp, infop)FORMAT="LINESPECIFIC"CS_INT       obj_type;FORMAT="LINESPECIFIC"SRV_OBJID    obj_id;FORMAT="LINESPECIFIC"CS_CHAR      *obj_namep;FORMAT="LINESPECIFIC"CS_INT       *obj_namelenp;FORMAT="LINESPECIFIC"CS_INT       *infop;ParametersREMAP="RI--RefIndent"obj_type - Indicates whether the object is a mutex (SRV_C_MUTEX) or a message queue (SRV_C_MQUEUE). obj_id - The unique identifier of the object. obj_namep - A pointer to a CS_CHAR
buffer into which the name of the object is copied. The buffer must be large enough to accommodate the object name and, if obj_namelenp is NULL, a null character. The maximum length for an object name is SRV_MAXNAME characters, not including the null termination byte. obj_namelenp - A pointer to a CS_INT that receives the length of the object. If obj_namelenp is NULL, the name that is found is copied into *obj_namep and terminated with a null character. Otherwise, the length of the name in *obj_namep is placed in *obj_namelenp. infop - A pointer to a CS_INT that is set to SRV_I_NOEXIST if the object with ID obj_id does not exist. CommentsMARK="BULL" REMAP="BU--Bullet"Open Server maintains a table that maps the unique identifiers of message queues and mutexes to their names. Given the identifier, MOREINFO="NONE"srv_getobjname finds the name. In some applications, it may make more sense to reference message queues or mutexes by name. MOREINFO="NONE"srv_getobjid can be used to look up the identifier that is used by the mutex and message queue services. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <stdio.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE  ex_srv_getobjname PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT      obj_type,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_OBJID   obj_idREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_GETOBJNAMEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to illustrate the use of srv_getobjname to**    get the name of mutex or message queue with id = obj_id**    where obj_id was earlier returned by srv_createmutex or**    srv_createmsgq.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    obj_type - Type of object; SRV_C_MUTEX or SRV_C_MQUEUE.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    obj_id   - The unique identifier of the object.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED   Memory was allocated successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL      Memory allocation failure occured.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE   ex_srv_getobjname(obj_type, obj_id)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT       obj_type;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_OBJID    obj_id;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_CHAR      obj_name[SRV_MAXNAME+1];REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_INT       obj_namelen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_INT       info;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_RETCODE   ret;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* Get object name. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ret = srv_getobjname(obj_type, obj_id, obj_name, &    obj_namelen, &info);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* Print information depending on retcode */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    switch(ret)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     case CS_FAIL:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        if (info == SRV_I_NOEXIST)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            fprintf(stderr, "%s object with id: %d does not                    exist\n", (obj_type == SRV_C_MUTEX) ?                    "Mutex" :"Message Queue", (CS_INT)obj_id);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        elseREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            fprintf (stderr, "srv_getobjname failed\n");REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        break;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     case CS_SUCCEED:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        fprintf (stderr, "%s name: %s for id: %d\n",REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        (obj_type == SRV_C_MUTEX) ? "Mutex" : "Message Queue", REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        obj_name, (CS_INT)obj_id);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        break;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     default:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        fprintf (stderr, "Unknown return code from                 srv_getobjname\n");REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        ret = CS_FAIL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        break;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return (ret);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X63435"srv_createmsgq
MOREINFO="NONE",LINKEND="X69149"srv_createmutex
MOREINFO="NONE", LINKEND="X72703"srv_deletemsgq
MOREINFO="NONE", LINKEND="X30072"srv_deletemutex
MOREINFO="NONE", LINKEND="X70696"srv_getmsgq
MOREINFO="NONE", LINKEND="X37417"srv_getobjid
MOREINFO="NONE",LINKEND="X55165"srv_lockmutex
MOREINFO="NONE", LINKEND="X32227"srv_putmsgq
MOREINFO="NONE", LINKEND="X37215"srv_unlockmutex
ID="IN4914585063"srv_getobjnameID="X55932"ID="IN5013555464"SRV_GETSERVER
SRV_GETSERVER
Obtain a pointer to the SRV_SERVER structure. FORMAT="LINESPECIFIC"SRV_SERVER *SRV_GETSERVER(spp)FORMAT="LINESPECIFIC"SRV_PROC     *spp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure. CommentsMARK="BULL" REMAP="BU--Bullet"Returns a pointer to the Open Server control structure.MOREINFO="NONE"SRV_GETSERVER will not be supported in future Open Server releases. The MOREINFO="NONE"SRV_SERVER control structure is no longer needed by Open Server routines.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE  ex_srv_getserver PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC    *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_SERVER  **ssppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_GETSERVERREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to return a pointer to the SRV_SERVER Open**    Server control structure, using SRV_GETSERVER.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp       A pointer to an internal thread control structureREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    sspp      Output pointer to the SRV_SERVER structureREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    SRV_SERVER structure returned successfullyREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       A null pointer was returned by SRV_GETSERVERREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_getserver(spp, sspp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_SERVER      **sspp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* Retrieve the pointer. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if ((*sspp = SRV_GETSERVER(spp)) == (SRV_SERVER *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsID="IN5013525771"SRV_GETSERVERREMAP="BO--Body"A pointer to the Open Server control structure on success, and, on failure, a null Open Server control structure pointer. ID="X12814"ID="IN5115496172"srv_getuserdata
srv_getuserdata
Return a pointer to private data space in a thread structure. FORMAT="LINESPECIFIC"CS_VOID *srv_getuserdata(spp)FORMAT="LINESPECIFIC"SRV_PROC        *spp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_setuserdata returns a pointer to private data space in a thread structure. The data pointer is set via MOREINFO="NONE"srv_setuserdata. Open Server passes event handlers the current thread pointer, so they can access the private data. Since Server-Library routines should be re-entrant, this also allows Open Server programs to avoid using global or static variables to hold private data.MOREINFO="NONE"srv_getuserdata will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_thread_props routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID   *ex_srv_getuserdata PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC  *spREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_GETUSERDATAREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to obtain a thread's user data pointer,**    using srv_getuserdata.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**        sp -  A pointer to an internal thread control **              structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**        The user data pointer associated with this thread, or**        NULL on failure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID        *ex_srv_getuserdata(sp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC       *sp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_VOID  *lp;  /* Local pointer. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Initialization.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    lp = (CS_VOID *)NULL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Get the user data pointer from the thread.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    lp = srv_getuserdata(sp);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Check for failure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if( lp == (CS_VOID *)NULL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        ** An error was already raised.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return (CS_VOID *)NULL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** All done.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return lp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"A generic void pointer to the private data space. If there was an error, or nothing was saved via MOREINFO="NONE"srv_setuserdata, (CS_VOID*) NULL is returned. See AlsoREMAP="BO--Body"LINKEND="X51398"srv_thread_props
MOREINFO="NONE", LINKEND="X78566"Events
ID="IN5115466480"srv_getuserdataID="IN5214436881"SRV_GETVERSION
SRV_GETVERSION
Return a pointer to the Open Server version string. FORMAT="LINESPECIFIC"CS_CHAR *SRV_GETVERSION()CommentsMARK="BULL" REMAP="BU--Bullet"The MOREINFO="NONE"SRV_GETVERSION macro returns a pointer to a null terminated character string that contains the version number, date, and copyright information for the Open Server release. The version string can be formatted with tab (\t) and newline (\n) characters.MOREINFO="NONE"SRV_GETVERSION will not be supported in future Open Server releases.The new Server-Library MOREINFO="NONE"srv_props routine provides the same functionality.ReturnsREMAP="BO--Body"A CS_CHAR pointer to the Open Server version string.See AlsoREMAP="BO--Body"LINKEND="X84669"srv_props
ID="IN5214407187"SRV_GETVERSIONID="IN5317377588"SRV_GOT_ATTENTION
SRV_GOT_ATTENTION
Test whether a SRV_ATTENTION event has occurred. FORMAT="LINESPECIFIC"CS_BOOL SRV_GOT_ATTENTION(spp)FORMAT="LINESPECIFIC"SRV_PROC        *spp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure. CommentsMARK="BULL" REMAP="BU--Bullet"When a client sends an attention to an Open Server thread - with the CT-Library routine MOREINFO="NONE"ct_cancel, for example, - Open Server detects the attention. MOREINFO="NONE"SRV_GOT_ATTENTION indicates whether an attention has been received. The attention flag in the thread structure is cleared when MOREINFO="NONE"srv_senddone is sent to the thread. Open Server calls an Open Server application's SRV_ATTENTION event handler when an attention is received.MOREINFO="NONE"SRV_GOT_ATTENTION will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_thread_props routine provides the same functionality. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE   ex_srv_got_attention PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC     *srvprocREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_GOT_ATTENTIONREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to test whether an attention has been **    received.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  srvproc - A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEEDREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAILREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE   ex_srv_got_attention(srvproc)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC     *srvproc;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if (SRV_GOT_ATTENTION(srvproc))REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"If an attention has been received, CS_TRUE is returned. Otherwise, CS_FALSE is returned.See AlsoREMAP="BO--Body"LINKEND="X76123"srv_handle
MOREINFO="NONE", LINKEND="X51398"srv_thread_props
MOREINFO="NONE",LINKEND="X52860"Attentions
MOREINFO="NONE", LINKEND="X78566"Events
ID="IN5317347896"SRV_GOT_ATTENTIONID="X76123"ID="IN5410318297"srv_handle
srv_handle
Install an event handler in an Open Server application. FORMAT="LINESPECIFIC"SRV_EVENTHANDLE_FUNC (*srv_handle(ssp, event,FORMAT="LINESPECIFIC"                       handler))()FORMAT="LINESPECIFIC"SRV_SERVER             *ssp;FORMAT="LINESPECIFIC"CS_INT                 event;FORMAT="LINESPECIFIC"SRV_EVENTHANDLE_FUNC   handler;ParametersREMAP="RI--RefIndent"ssp - A pointer to the Open Server control structure. This parameter is optional. It is present only to provide backward compatibility.event - The event that handler will handle. Here is a list of all the regular Open Server events:REMAP="UN--Under"SRV_ATTENTIONREMAP="UN--Under"SRV_BULKREMAP="UN--Under"SRV_CONNECT REMAP="UN--Under"SRV_CURSORREMAP="UN--Under"SRV_DISCONNECT/SRV_URGDISCONNECTREMAP="UN--Under"SRV_DYNAMICREMAP="UN--Under"SRV_LANGUAGE REMAP="UN--Under"SRV_MSGREMAP="UN--Under"SRV_OPTIONREMAP="UN--Under"SRV_RPC REMAP="UN--Under"SRV_START REMAP="UN--Under"SRV_STOPREMAP="UN--Under"Programmer-defined events - A programmer-defined event is defined using MOREINFO="NONE"srv_define_event. REMAP="UN--Under"For a description of each event, see the LINKEND="X78566"Events
 topics page. handler - A pointer to the function to call when an event request occurs. Passing NULL as the handler installs the default event handler. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_handle tells Open Server to call a particular function when it receives a request to handle a particular event. Open Server calls handler with one argument. The event handlers for the following events take a pointer to an Open Server control structure as an argument: REMAP="UN--Under"SRV_START  REMAP="UN--Under"SRV_STOP REMAP="UN--Under"The event handlers for the following events take a pointer to a thread control structure as an argument: REMAP="UN--Under"SRV_ATTENTIONREMAP="UN--Under"SRV_BULK REMAP="UN--Under"SRV_CONNECTREMAP="UN--Under"SRV_CURSORREMAP="UN--Under"SRV_DISCONNECT/SRV_URGDISCONNECTREMAP="UN--Under"SRV_DYNAMICREMAP="UN--Under"SRV_LANGUAGE REMAP="UN--Under"SRV_MSGREMAP="UN--Under"SRV_OPTIONREMAP="UN--Under"SRV_RPCREMAP="UN--Under"Any programmer-defined event Each Open Server event has a default handler with a known name. Installing an event handler with MOREINFO="NONE"srv_handle replaces the default handler. Event handlers can be installed dynamically. The new event handler is called the next time the event is raised. Event handlers must return CS_SUCCEED. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"extern CS_RETCODE  ex_srv_handle PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_EVENTHANDLE_FUNC       funcpREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_HANDLEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Install a SRV_START handler.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    funcp  Handler to install.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED   Start handler was installed successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL      An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE               ex_srv_handle(funcp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_EVENTHANDLE_FUNC     funcp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if(srv_handle((SRV_SERVER *)NULL, SRV_START, funcp) ==        CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"A pointer to the previously defined event-handling function. A null pointer indicates failure.See AlsoREMAP="BO--Body"LINKEND="X96733"srv_define_event
MOREINFO="NONE", LINKEND="X94254"srv_event
MOREINFO="NONE", LINKEND="X40599"srv_event_deferred
MOREINFO="NONE",LINKEND="X78566"Events
ID="IN54102885105"srv_handleID="X24609"ID="IN5582589106"srv_init
srv_init
Initialize an Open Server application. FORMAT="LINESPECIFIC"SRV_SERVER *srv_init(scp, servernamep, namelen)FORMAT="LINESPECIFIC"SRV_CONFIG       *scp;FORMAT="LINESPECIFIC"CS_CHAR          *servernamep;FORMAT="LINESPECIFIC"CS_INT           namelen;ParametersREMAP="RI--RefIndent"scp - The configuration structure that holds the values of all the Open Server configuration options. This argument is optional. It is included for backward compatibility.servernamep - A pointer to the Open Server application name. The name you supply is looked up in the interfaces file to get the necessary network information. If you use (CS_CHAR *) NULL as the Open Server name, the value of DSLISTEN will be the server's name. If DSLISTEN has not been explicitly set, the name defaults to the string "SYBASE". namelen - The length, in bytes, of the string in *servernamep. If the string is (CS_CHAR *) NULL, namelen is ignored. If servername is null terminated, namelen can be CS_NULLTERM. CommentsMARK="BULL" REMAP="BU--Bullet"A server must be initialized before it is started with MOREINFO="NONE"srv_run. MOREINFO="NONE"srv_init initializes an Open Server application. The initialization process consists primarily of allocating the necessary data structures for the server, initializing the server state, and starting up the network listener. Most configuration options must be set before MOREINFO="NONE"srv_init is called if values other than the defaults are desired. See the LINKEND="X84669"srv_props
 reference page, for a list of configurable options. MOREINFO="NONE"srv_version must be called prior to MOREINFO="NONE"srv_init to set up library version information and default internationalization values.Open Server releases the SRV_SERVER structure when a SRV_STOP event occurs. An Open Server application should not release it. For information on designating an interfaces file, see the LINKEND="X84669"srv_props
 reference page. For more information on the interfaces file itself, see the Open Client/Server Supplement for your platform. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_SERVER    *ex_srv_init PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_CONFIG    *scpREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_INITREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to initialize an Open Server application.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    scp   -   A pointer to the configuration structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    On success, a pointer to a newly allocated SRV_SERVER      structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    On failure, NULL.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_SERVER   *ex_srv_init(scp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_CONFIG   *scp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      SRV_SERVER   *server;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_CHAR      *servername = "EX_SERVER";REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    server = srv_init(scp, servername, CS_NULLTERM);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return (server);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"MOREINFO="NONE"srv_init returns a SRV_SERVER pointer if everything went well. A (SRV_SERVER *) NULL is returned if the server could not be initialized. See AlsoREMAP="BO--Body"LINKEND="X84669"srv_props
MOREINFO="NONE", LINKEND="X48116"srv_run
MOREINFO="NONE", LINKEND="X94448"srv_version
ID="IN5582292114"srv_initID="IN56101996115"SRV_IODEAD
SRV_IODEAD
Indicate the status of a thread's I/O.FORMAT="LINESPECIFIC"CS_BOOL SRV_IODEAD(spp)FORMAT="LINESPECIFIC"SRV_PROC    *spp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"SRV_IODEAD indicates whether the thread's I/O is active. This is especially useful when handling error conditions. For example, MOREINFO="NONE"SRV_IODEAD can be used to check whether it is possible to send a message to a client during error handling. In a SRV_DISCONNECT handler, MOREINFO="NONE"SRV_IODEAD will always return CS_TRUE. MOREINFO="NONE"SRV_IODEAD always returns CS_TRUE if the thread is created with MOREINFO="NONE"srv_createproc or MOREINFO="NONE"srv_spawn.MOREINFO="NONE"SRV_IODEAD will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_thread_props routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_BOOL   ex_SRV_IODEAD PROTOTYPE((SRV_PROC  *sproc));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_IODEADREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    An example routine to examine the I/O status of a client**    thread using SRV_IODEAD.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    sproc  A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_TRUE   If the thread's I/O has failed.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FALSE  If the thread's I/O channel is active.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_BOOL   ex_SRV_IODEAD(sproc)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC  *sproc;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** If the thread is NULL then I/O is not possible.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if ( sproc == (SRV_PROC *)NULL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_TRUE);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Get the I/O status of the specified thread.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(SRV_IODEAD(sproc));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_TRUE if the client thread's I/O has failed, CS_FALSE if the client thread's I/O channel is active. See AlsoREMAP="BO--Body"LINKEND="X35449"srv_createproc
MOREINFO="NONE", LINKEND="X60232"srv_spawn
MOREINFO="NONE" , LINKEND="X51398"srv_thread_props
ID="IN56101699123"SRV_IODEADREMAP="BO--Body"ID="X29878"srv_langcpyID="IN43119751"srv_langcpy
Copy a client's language request into an application buffer. FORMAT="LINESPECIFIC"CS_INT srv_langcpy(spp, start, nbytes, bp)FORMAT="LINESPECIFIC"SRV_PROC    *spp;FORMAT="LINESPECIFIC"CS_INT      start;FORMAT="LINESPECIFIC"CS_INT      nbytes;FORMAT="LINESPECIFIC"CS_BYTE     *bp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure. start - The point at which to start copying characters from the request buffer. The first character in the request buffer is the 0'th character. nbytes - The number of characters to copy. If nbytes is -1, MOREINFO="NONE"srv_langcpy copies as many bytes as possible. It is legal to copy 0 bytes. If there are not nbytes characters available to copy, MOREINFO="NONE"srv_langcpy copies as many as are in the request buffer. bp - A CS_CHAR pointer to the programmer-supplied buffer into which to copy the bytes. CommentsMARK="BULL" REMAP="BU--Bullet"When a language request is received from the client, MOREINFO="NONE"srv_langcpy can be used to copy a portion of the request buffer to a Open Server program variable. The copy placed in the destination buffer is null terminated. MOREINFO="NONE"srv_langcpy is also used to process language strings in cursor declare or update statements.MOREINFO="NONE"srv_langcpy assumes that the destination buffer is large enough to handle nbytes + 1 bytes. To set the total length of the language request buffer call MOREINFO="NONE"srv_langlen. The request buffer can contain any string of characters, including Transact-SQL statements. It's up to the Open Server application to process the string. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_langcpy PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC       *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR        *buf,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT         size,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT         *outlenREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_LANGCPYREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to illustrate the use of srv_langcpy to**    copy language commands sent by a client.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp      A pointer to internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    buf      A CS_CHAR pointer to buffer for language commands.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    size     The size of the buffer; A CS_INT.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    outlen   A pointer to CS_INT; the actual length of               language query copied to buf is returned here. -1**             is returned in case of failure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED   Language request was copied successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL      An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE   ex_srv_langcpy(spp, buf, size, outlen)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC     *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR      *buf;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT       size;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT       *outlen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   CS_INT        act_len; /* actual length of language request */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* Initialization.*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    *outlen = (CS_INT)-1;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* Get the length of language request.*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if ((act_len = srv_langlen(spp)) == -1)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* Check to see whether we got a buffer of adequate size. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if (size < (act_len +1))REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* Copy language commands.*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if (srv_langcpy(spp, (CS_INT)0, act_len, buf) <= 0)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* Set the actual length copied. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    *outlen = act_len;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return (CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"The number of bytes copied. If there is no current language request from the client, -1 is returned. See AlsoREMAP="BO--Body"LINKEND="X69406"srv_langlen
MOREINFO="NONE",LINKEND="X71810"srv_langptr
ID="IN43119489"srv_langcpyID="X69406"ID="IN4411911210"srv_langlen
srv_langlen
Return the length of the language request buffer. FORMAT="LINESPECIFIC"int srv_langlen(spp)FORMAT="LINESPECIFIC"SRV_PROC    *spp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.CommentsMARK="BULL" REMAP="BU--Bullet"When a language request has been received from a client, MOREINFO="NONE"srv_langlen returns the length of the request buffer.MOREINFO="NONE"srv_langlen is also used to process language strings in cursor declare or update statements.All or part of the request buffer can be accessed with MOREINFO="NONE"srv_langcpy. The request buffer can contain any string, including Transact-SQL statements. It is up to the Open Server application to process the string. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE ex_srv_langlen PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC  *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT    *lenREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_LANGLENREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  Example routine to return the length of the language request**  buffer using srv_langlen.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  spp    A pointer to the internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  len    Return pointer for the length of the language string.**         If there is no language command -1 is returned.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED   Language length was retrieved successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL      An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE   ex_srv_langlen(spp, len)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC     *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT       *len;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* Retrieve the language length.    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if ((*len = srv_langlen(spp)) < 0)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"The length in bytes of the language request buffer received from the client. If there is no current language request from the client, -1 is returned. See AlsoREMAP="BO--Body"LINKEND="X29878"srv_langcpy
ID="IN4411881518"srv_langlenID="X71810"ID="IN4511851919"srv_langptr
srv_langptr
Return a pointer to a character in the language request buffer. FORMAT="LINESPECIFIC"CS_CHAR       *srv_langptr(spp, n)FORMAT="LINESPECIFIC"SRV_PROC      *spp;FORMAT="LINESPECIFIC"CS_INT        n;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.n - The ordinal number of the character to find in the language request buffer. The first character in the request buffer is the 0'th character. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_langptr finds the specified character in the language request buffer and returns a pointer to it. MOREINFO="NONE"srv_langptr is also used to process language strings in cursor declare or update statements.The language text is stored as a contiguous string of characters. The string is null terminated. The pointer can be incremented through the language text characters until it points to the terminating null character, `\0'. An application can copy the request buffer using MOREINFO="NONE"srv_langcpy. The request buffer can contain any string, including Transact-SQL statements. It is up to the SRV_LANGUAGE handler to process the string. MOREINFO="NONE"srv_langptr will not be supported in future Open Server releases. The MOREINFO="NONE"srv_langcpy routine provides the same functionality.REMAP="BO--Body"ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_langptr PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         **bpp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          cREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_LANGPTRREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Example routine using srv_langptr to return a pointer to the**   first occurrence of the requested character in the language**   request buffer.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp  A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    bpp  A return pointer to the requested characte.rREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    c    The character to search for in the language request**         buffer. REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED   A pointer to character successfully returned.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL      An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE   ex_srv_langptr(spp, bpp, c)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC     *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR      **bpp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT       c;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* Retrieve the pointer. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if ((*bpp = srv_langptr(spp, c)) == (CS_CHAR *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"A pointer to the n'th character in the language request buffer. If n is not in range or there is no language request, a null character pointer is returned. See AlsoREMAP="BO--Body"LINKEND="X29878"srv_langcpy
MOREINFO="NONE", LINKEND="X69406"srv_langlen
ID="INA4511822227"srv_langptrID="X55165"ID="INA4613792628"srv_lockmutex
srv_lockmutex
Lock a mutex. FORMAT="LINESPECIFIC"CS_RETCODE srv_lockmutex(mutex_id, waitflag, infop)FORMAT="LINESPECIFIC"SRV_OBJID       mutex_id;FORMAT="LINESPECIFIC"CS_INT          waitflag;FORMAT="LINESPECIFIC"CS_INT          *infop;ParametersREMAP="RI--RefIndent"mutex_id - The unique mutex identifier that was returned by the call to MOREINFO="NONE"srv_createmutex. Given the name of the mutex, the mutex_id can be obtained by calling MOREINFO="NONE"srv_getobjid. waitflag - Specifies whether the thread requesting the mutex lock should wait or just return if the mutex cannot be granted immediately. The value in *indp indicates whether the lock was granted. The two valid values for waitflag are SRV_M_WAIT, which indicates that the thread should wait if the lock cannot be granted immediately, and SRV_M_NOWAIT, which indicates that the thread should return without waiting if the lock cannot be granted. infop - A pointer to a CS_INT that is set to one of the following values: REMAP="UN--Under"SRV_I_SYNC - The lock was granted synchronously-the thread requesting the lock was not suspended to wait for the lock. MOREINFO="NONE"srv_lockmutex returned CS_SUCCEED. REMAP="UN--Under"SRV_I_GRANTED - The lock was granted after the requesting thread was suspended to wait for another thread to release a lock on the mutex. MOREINFO="NONE"srv_lockmutex returned CS_SUCCEED. REMAP="UN--Under"SRV_I_INTERRUPTED - The thread received an attention while waiting for the lock. The lock was not granted, and MOREINFO="NONE"srv_lockmutex returned CS_FAIL. REMAP="UN--Under"SRV_I_WOULDWAIT - The waitflag parameter was set to SRV_M_NOWAIT and the thread would have had to wait for the lock. The lock was not granted, and MOREINFO="NONE"srv_lockmutex returned CS_FAIL. REMAP="UN--Under"SRV_I_UNKNOWN - Some other error occurred, for example, the mutex does not exist. MOREINFO="NONE"srv_lockmutex returned CS_FAIL. CommentsMARK="BULL" REMAP="BU--Bullet"Mutexes are associated with data objects and program resources that must be protected from simultaneous access by multiple threads. Mutex locks are granted to threads on a first-come, first-served basis. The lock is granted only if no other thread has already obtained a lock on the mutex. MOREINFO="NONE"srv_lockmutex cannot be used in a SRV_START or SRV_ATTENTION handler. A thread can lock a mutex more than once, but must call MOREINFO="NONE"srv_unlockmutex once for each call toMOREINFO="NONE" srv_lockmutex before another thread can lock the mutex. If the mutex was waiting for is deleted, MOREINFO="NONE"srv_lockmutex returns CS_FAIL.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE    ex_srv_lockmutex PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_OBJID     midREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_LOCKMUTEXREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  Example routine to illustrate the use of srv_lockmutex.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**      mid - The id of the mutex to lock.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_SUCCEED   Mutex successfully locked.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_FAIL      An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE   ex_srv_lockmutex(mid)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_OBJID    mid;     /* The mutex id. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_INT   info;    /* Information output variable. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Request the mutex lock - sleep until we get it.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if( srv_lockmutex(mid, SRV_M_WAIT, &info) == CS_FAIL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        ** An error was already raised.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return CS_FAIL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** All done.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return CS_SUCCEED;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X69149"srv_createmutex
MOREINFO="NONE", LINKEND="X30072"srv_deletemutex
MOREINFO="NONE", LINKEND="X37417"srv_getobjid
MOREINFO="NONE", LINKEND="X37215"srv_unlockmutex
ID="IN4613762936"srv_lockmutexID="X18405"ID="IN477733337"srv_log
srv_log
Write a message to the Open Server log file. FORMAT="LINESPECIFIC"CS_RETCODE srv_log(ssp, datestamp, msgp, msglen)FORMAT="LINESPECIFIC"SRV_SERVER    *ssp;FORMAT="LINESPECIFIC"CS_BOOL       datestamp;FORMAT="LINESPECIFIC"CS_CHAR       *msgp;FORMAT="LINESPECIFIC"CS_INT        msglen;ParametersREMAP="RI--RefIndent"ssp - The handle to the Open Server. This argument is optional. It is only present for backward compatibility.datestamp - If datestamp is CS_TRUE, the current date and time is added to the beginning of the log message. If datestamp is CS_FALSE, the log message is not timestamped. msgp - A pointer to the actual text of the message. msglen - The length in bytes of msg. If the string in *msgp is null terminated, msglen can be CS_NULLTERM. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_log writes messages to the Open Server log file. The default name of the log file is srv.log. The name can be set with MOREINFO="NONE"srv_props. Messages are always appended to the log file. The name of the log file can be accessed with the MOREINFO="NONE"srv_props routine. The newline character is not added to the text in *msgp. The log file is truncated based on the SRV_TRUNCATELOG property set via MOREINFO="NONE"srv_props.If the message length exceeds SRV_MAXMSG, Open Server truncates the message. This holds true whether or not the message is null terminated.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <string.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE   ex_srv_log PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_SERVER   *ssp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR      *msg_txtREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_LOGREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to log a message.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  ssp         A pointer to the Open Server state information**              control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    msg_txt   Text of message to log.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** ReturnsREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_SUCCEED      Thread was created.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_FAIL         An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE  ex_srv_log(ssp, msg_txt)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_SERVER  *ssp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR     *msg_txt;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_RETCODE        lret;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_INT            msg_len;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* Check arguments. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if(ssp == (SRV_SERVER *)0)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if(msg_txt == (CS_CHAR *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    msg_len=strlen(msg_txt);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Log the message -  We use CS_TRUE as the second argument    **                    to force the date and time to be    **                    added to the beginning of the logged    **                    message. If you do not want a    **                    datestamp then use CS_FALSE.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    lret = srv_log(ssp,CS_TRUE,msg_txt,msg_len);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(lret);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X84669"srv_props
ID="IN477703646"srv_logID="X43703"ID="IN488674047"srv_mask
srv_mask
Initialize, set, clear or check bits in a SRV_MASK_ARRAY structure.FORMAT="LINESPECIFIC"CS_RETCODE srv_mask(cmd, maskp, bit, infop)FORMAT="LINESPECIFIC"CS_INT            cmd;FORMAT="LINESPECIFIC"SRV_MASK_ARRAY    *maskp;FORMAT="LINESPECIFIC"CS_INT            bit;FORMAT="LINESPECIFIC"CS_BOOL           *infop;ParametersREMAP="RI--RefIndent"cmd - The action being performed. The following table summarizes the legal values for cmd:TOCENTRY="1"LBL="Table 3-30: "Legal Values for cmd (srv_mask)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="81*"COLNAME="C2" COLWIDTH="234*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ActionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Set the bit in the SRV_MASK_ARRAY in *maskp.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Find out whether the bit is currently set in the 
SRV_MASK_ARRAY in *maskp. If bit is set, *infop 
is set to CS_TRUE. Otherwise, it is set to 
CS_FALSE.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CLEARCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Clear the bit in the SRV_MASK_ARRAY in *maskp.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_ZEROCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Initialize the SRV_MASK_ARRAY in *maskp so 
that all the bits are off. When cmd is set to 
CS_ZERO, bit and infop are ignored. maskp - A pointer to a SRV_MASK_ARRAY structure.bit - The bit being initialized, set, cleared, or checked in the SRV_MASK_ARRAY. This must be an integer between 0 and SRV_MAXMASK_LENGTH. SRV_MAXMASK_LENGTH is defined in ospublic.h.infop - A pointer to a variable that will indicate whether or not bit is set. This parameter is ignored when cmd is CS_SET, CS_CLEAR, or CS_ZERO. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_mask is used to access and modify a SRV_MASK_ARRAY structure. MOREINFO="NONE"srv_mask replaces the MOREINFO="NONE"SRV_MASK_CLEAR, MOREINFO="NONE"SRV_MASK_SET, andMOREINFO="NONE" SRV_MASK_ZERO macros.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_mask PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_MASK_ARRAY  *maskptr,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          bitREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_MASKREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to manipulate bits in a SRV_MASK_ARRAY**    structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    maskptr    A pointer to a mask array.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    bit        The bit to examine.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEEDREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAILREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/    REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE       ex_srv_mask(maskptr, bit)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_MASK_ARRAY  *maskptr;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT  bit;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_BOOL    info = CS_TRUE;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if (srv_mask(CS_GET, maskptr, bit, &info) == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"         return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    elseREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        /* Has the bit been set? */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        if (info == CS_FALSE)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        elseREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the action was successfully performed.REMAP="BO--Body"CS_FAIL if an error was detected.ID="IN488644354"srv_maskID="IN4915614755"SRV_MASK macros
SRV_MASK macros
Initialize, set, clear, and test the bits in SRV_MASK_ARRAY structures. FORMAT="LINESPECIFIC"SRV_MASK_ZERO(maskp, bit) FORMAT="LINESPECIFIC"SRV_MASK_SET(maskp, bit)FORMAT="LINESPECIFIC"SRV_MASK_CLEAR(maskp, bit)FORMAT="LINESPECIFIC"SRV_MASK_ISSET(maskp, bit)FORMAT="LINESPECIFIC"SRV_MASK_ARRAY          *maskp;FORMAT="LINESPECIFIC"CS_INT                  bit;ParametersREMAP="RI--RefIndent"maskp - A pointer to a SRV_MASK_ARRAY structure. bit - A number between 1 and SRV_MAXMASK_LENGTH that indicates the bit in *maskp to which the operation applies. CommentsMARK="BULL" REMAP="BU--Bullet"These macros are useful for setting and testing the bit masks required by MOREINFO="NONE"srv_select. A SRV_MASK_ARRAY structure holds an array of bits. The number of bits in the array is SRV_MAXMASK_LENGTH. SRV_MASK_ZERO initializes to zero all elements in *maskp. SRV_MASK_SET sets the bit indicated by bit in *maskp. SRV_MASK_CLEAR clears the bit indicated by bit in *maskp. SRV_MASK_ISSET returns CS_TRUE if the bit indicated by bit is set in *maskp.MOREINFO="NONE"SRV_MASK MOREINFO="NONE"macros will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_mask routine provides the same functionality.REMAP="BO--Body"REMAP="BO--Body"ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototypes.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"extern CS_VOID      ex_srv_mask_zero PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_MASK_ARRAY      *maskpREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"extern CS_RETCODE   ex_srv_mask_set PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_MASK_ARRAY      *maskp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT              bitREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"extern CS_RETCODE    ex_srv_mask_clear PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_MASK_ARRAY       *maskp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT               bitREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"extern CS_RETCODE    ex_srv_mask_isset PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_MASK_ARRAY       *maskp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT               bit,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_BOOL              *setpREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_MASK_ZERO.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Clear a SRV_MASK_ARRAY.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    maskp  Mask array to clear.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Nothing.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID            ex_srv_mask_zero(maskp).REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_MASK_ARRAY            *maskp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    SRV_MASK_ZERO(maskp);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_MASK_SETREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Set a bit in a SRV_MASK_ARRAY structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    maskp        A pointer to the mask array to update.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    bit          The bit to set in the mask array.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED    Bit was set successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE         ex_srv_mask_set(maskp, bit)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_MASK_ARRAY     *maskp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT             bit;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Verify that bit we're setting is valid.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if((bit < 1) || (bit > SRV_MAXMASK_LENGTH))REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    SRV_MASK_SET(maskp, bit);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_MASK_CLEARREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Clear a bit in a SRV_MASK_ARRAY.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    maskp        A pointer to the mask array to update.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    bit          The bit to clear in the mask array.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_SUCCEED   The bit was cleared successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_FAIL      An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE       ex_srv_mask_clear(maskp, bit)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_MASK_ARRAY   *maskp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT           bit;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Verify that bit we're setting is valid.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if((bit < 1) || (bit > SRV_MAXMASK_LENGTH))REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    SRV_MASK_CLEAR(maskp, bit);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_MASK_ISSETREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Test a bit in a SRV_MASK_ARRAY structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    maskp  A pointer to the mask array to update.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    bit    The bit to clear in the mask array.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    setp   Return CS_TRUE here if bit is set.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED   Bit was tested successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL      An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE         ex_srv_mask_isset(maskp, bit, setp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_MASK_ARRAY     *maskp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT             bit;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_BOOL            *setp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Verify that bit we're setting is valid.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if((bit < 1) || (bit > SRV_MAXMASK_LENGTH))REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    *setp = SRV_MASK_ISSET(maskp, bit);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}See AlsoREMAP="BO--Body"LINKEND="X43703"srv_mask
MOREINFO="NONE", LINKEND="X24148"srv_select (UNIX only)
ID="IN4915585062"SRV_MASK macrosID="X77646"ID="IN507555463"srv_msg
srv_msg
Send or receive a message datastream. FORMAT="LINESPECIFIC"CS_RETCODE srv_msg(spp, cmd, msgidp, status)FORMAT="LINESPECIFIC"SRV_PROC    *spp;FORMAT="LINESPECIFIC"CS_INT      cmd;FORMAT="LINESPECIFIC"CS_INT      *msgidp;FORMAT="LINESPECIFIC"CS_INT      *statusp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.cmd - Indicates whether the application is calling MOREINFO="NONE"srv_msg to send or retrieve a message. The following table describes the legal values for cmd:TOCENTRY="1"LBL="Table 3-31: "Values for cmd (srv_msg)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="54*"COLNAME="C2" COLWIDTH="306*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"srv_msg is setting the values for status and msgid prior to sending 
the message to the client.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"srv_msg is retrieving the status and msgid values for the message 
being received.msgidp - A pointer to the message ID of the current message. If the Open Server application is sending a message (CS_SET), it must provide the message ID here. If the application is reading a message (CS_GET), the message ID of the received message is returned here. Values of SRV_MINRESMSG through SRV_MAXRESMSG are reserved for internal Sybase usage.statusp - A pointer to the status of the current message. If the Open Server application is receiving a message (CS_GET), Open Server will update *statusp with the message status. If the application is sending a message (CS_SET), *statusp must contain the status of the message to be sent. The following table describes the legal values for *statusp:TOCENTRY="1"LBL="Table 3-32: "Values for statusp (srv_msg)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="99*"COLNAME="C2" COLWIDTH="155*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_HASPARAMSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The message has parameters.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NOPARAMSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The message has no parameters.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_msg is used to send or receive a TDS message data stream.Each message data stream received from a client raises a SRV_MSG event. A separate event is raised for each message received. If a message has parameters, *statusp will contain the value CS_HASPARAMS. The application can retrieve and store the parameters using MOREINFO="NONE"srv_descfmt, MOREINFO="NONE"srv_bind, and MOREINFO="NONE"srv_xferdata with type set to SRV_MSGDATA.An application can determine the number of parameters for a message by calling MOREINFO="NONE"srv_numparams. The MOREINFO="NONE"srv_msg routine is used to send the status and ID. The actual parameters of the message, if any, are sent using MOREINFO="NONE"srv_descfmt, MOREINFO="NONE"srv_bind, and MOREINFO="NONE"srv_xferdata with a type argument of SRV_MSGDATA.An application can send or receive multiple message data streams. However, MOREINFO="NONE"srv_xferdata must be called once for each message being sent or received. MOREINFO="NONE"srv_msg can only be called in a SRV_MSG event handler when cmd is CS_GET. It can be called in any event handler when cmd is CS_SET.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE    ex_srv_msg PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC      *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_MSGREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to receive and send a message datastream.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  spp  A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_SUCCEED if we were successful in both receiving and**  sending a message stream.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_FAIL if an error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE    ex_srv_msg(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_CONFIG    *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_RETCODE      result;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_INT          msgid;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_INT          status;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** We will first get a message and process any parameters.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    result = srv_msg(spp, CS_GET, &msgid, &status);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if (result == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if (status == SRV_HASPARAMS)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        /* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        ** Process parameters here using srv_bind and         ** srv_xferdata.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Now, an example of sending a message.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    msgid = 9999;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    status = SRV_NOPARAMS;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    result = srv_msg(spp, CS_SET, &msgid, &status);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if (result == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Send message across using srv_xferdata.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    result = srv_xferdata(spp, CS_SET, SRV_MSGDATA);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return (result);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the status and message ID of a message were successfully received or set. REMAP="BO--Body"CS_FAIL if an error was detected.See AlsoREMAP="BO--Body"LINKEND="X30757"srv_bind
MOREINFO="NONE", LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X87885"srv_numparams
MOREINFO="NONE", LINKEND="X52699"srv_xferdata
MOREINFO="NONE",LINKEND="X13599"Datastream MessagesID="X84584"ID="IN5113525871"srv_negotiate
srv_negotiate
Send to and receive from a client, negotiated login information.FORMAT="LINESPECIFIC"CS_RETCODE srv_negotiate(spp, cmd, type)FORMAT="LINESPECIFIC"SRV_PROC    *spp;FORMAT="LINESPECIFIC"CS_INT      cmd;FORMAT="LINESPECIFIC"CS_INT      type;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.cmd - Indicates whether the application is calling MOREINFO="NONE"srv_negotiate to send or retrieve negotiated login information. The following table describes the legal values for cmd:TOCENTRY="1"LBL="Table 3-33: "Values for cmd (srv_negotiate)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="108*"COLNAME="C2" COLWIDTH="252*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The negotiated login information defined by type is to 
be sent to the client.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The negotiated login information defined by type is to 
be read from the client.type - The type of negotiated login information to be sent to or read from a client. The following table describes the legal values for type:TOCENTRY="1"LBL="Table 3-34: "Values for type (srv_negotiate)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="135*"COLNAME="C2" COLWIDTH="225*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NEG_CHALLENGECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The negotiated login information is a challenge 
byte stream sent to the client (CS_SET) or a 
challenge response byte stream read from the 
client (CS_GET).COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NEG_ENCRYPTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The negotiated login information consists of an 
encryption key sent to the client. The client will 
then use this to encrypt its local and remote 
passwords. This type is only valid when cmd is 
CS_SET.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NEG_LOCPWDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The encrypted local password sent by the client 
in response to a SRV_NEG_ENCRYPT 
challenge. This type is only valid when cmd is 
CS_GET.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NEG_REMPWDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The negotiated login information is a variable 
number of remote server name and encrypted 
remote password pairs sent by the client in 
response to a SRV_NEG_ENCRYPT challenge. 
This type is only valid when cmd is CS_GET.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NEG_SECLABELCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The negotiated login information is a request for 
security labels sent to the client, or a set of 
security labels sent by the client to the server.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"An integer value between 
CS_USER_MSGID and 
CS_USER_MAX_MSGID, 
inclusive.COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The negotiated login information is part of an 
application-defined handshake, identified by 
the type argument itself.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_negotiate is used to send negotiated login information to and receive negotiated login responses from, a client.Via MOREINFO="NONE"srv_negotiate, Open Server applications can implement a secure login process inside their SRV_CONNECT event handler. In a secure computing environment, an application may want to perform more rigorous authentication at connect time to verify that clients are who they claim to be, by issuing negotiated login challenges and encrypted passwords.An Open Server application can choose to send a challenge or encrypted password to the client while in the SRV_CONNECT event handler, to authenticate the login attempt. Once an application has sent a negotiated login challenge or encrypted password, it must read the client's response before the connection process can continue.An Open Server application can go through as many challenge or response iterations as are necessary to authenticate the login attempt. However, the application must read in the response to each challenge before sending another challenge.Once a negotiated login challenge has been sent to a client, the application must read the response before the connection process can continue.An Open Server application must punctuate any type of challenge with a call to MOREINFO="NONE"srv_senddone. If the application issues a "batch
" of several challenges before it reads a response, it must call MOREINFO="NONE"srv_senddone with a status argument of SRV_DONE_MORE after each challenge but the last one in the batch. After the last challenge in the batch, the application must call MOREINFO="NONE"srv_senddone with a status argument of SRV_DONE_FINAL.For application-defined handshakes, an Open Server application can set the type argument to a value between CS_USER_MSGID and CS_USER_MAX_MSGID to set the handshake type (CS_SET) or specify the type of reply the client should be sending in response (CS_GET). If the Open Server application receives an unexpected value, Open Server raises an error.When a client responds to a challenge or encrypted password, MOREINFO="NONE"srv_negotiate suspends the thread's execution until the client's response has arrived. Applications should bear this in mind when coding a secure SRV_CONNECT event handler.Negotiated login challenges and responses carry data values via parameters, which are sent and received via MOREINFO="NONE"srv_bind,MOREINFO="NONE" srv_descfmt, andMOREINFO="NONE" srv_xferdata.These three routines take a type argument of SRV_NEGDATA to define or access negotiated login data.The following table lists the parameter or parameters that accompany each type of challenge sent to a client:TOCENTRY="1"LBL="Table 3-35: "Required Challenge Parameters (srv_negotiate)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="177*"COLNAME="C2" COLWIDTH="163*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Negotiated Login TypeCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Parameters RequiredVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NEG_CHALLENGECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1 Parameter - Challenge-data 
value. Data type is 
CS_BINARY_TYPE with the 
CS_DATAFMT status field set to 
CS_CANBENULL.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NEG_ENCRYPTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1 Parameter - Encryption key data 
value. Data type is 
CS_BINARY_TYPE with the 
CS_DATAFMT status field set to 
CS_CANBENULL.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NEG_SECLABELCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No parameters.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"An integer value between 
CS_USER_MSGID and 
CS_USER_MAX_MSGID, inclusive.COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1 Parameter - Application-defined 
login handshake data value.The following table lists the parameter that should be read from a client for each type of negotiated login challenge:TOCENTRY="1"LBL="Table 3-36: "Expected Challenge Parameters (srv_negotiate)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="135*"COLNAME="C2" COLWIDTH="163*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Negotiated Login TypeCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Parameters PresentVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NEG_CHALLENGECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1 Parameter - Challenge response 
data. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NEG_LOCPWDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1 Parameter - Encrypted local 
password. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NEG_REMPWDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A variable number of server-
name/password pairs.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NEG_SECLABELCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Four parameters:Param 1: Maximum read level 
label.Param 2: Maximum write level 
label.Param 3: Minimum write level 
label.Param 4: Current write level label.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"An integer value between 
CS_USER_MSGID and 
CS_USER_MAX_MSGID, 
inclusive.COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1 Parameter - Application-defined 
login handshake data value.Note that a response to a password encryption challenge, SRV_NEG_ENCRYPT, can consist of two sets of parameters. The SRV_NEG_LOCPWD response carries a parameter indicating the client's encrypted password. The client can also send a SRV_NEG_REMPWD response, which carries parameters indicating the client's encrypted remote server password and the remote server name, respectively. The SRV_NEG_LOCPWD response to a SRV_NEG_ENCRYPT challenge will always be present. If no remote server passwords were sent by the client, a request to receive a SRV_NEG_REMPWD response will fail.Applications that use Open Client and Open Server to implement gateway functionality must use Open Client's negotiated login callback mechanism to route negotiated login challenges and responses between clients and the remote server. In this type of application, the Open Client negotiated login callback must contain the Server-Library routine calls necessary to forward a challenge to the client, and receive the response, which Open Client then returns to the remote server. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE    ex_srv_negotiate PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC      *sprocREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_NEGOTIATEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  An example routine to retrieve negotiated login information**  by using srv_negotiate.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  sproc  A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_SUCCEED   The login information was retrieved.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_FAIL      An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE   ex_srv_negotiate(sproc)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC     *sproc;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Check to make sure that the thread control structure is    ** not NULL.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if ( sproc == (SRV_PROC *)NULL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* Now get the login information. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if ( srv_negotiate(sproc, CS_GET, SRV_NEG_CHALLENGE) == CS_FAIL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the negotiated login data was sent or received successfully.REMAP="BO--Body"CS_FAIL if an error was detected.See AlsoREMAP="BO--Body"LINKEND="X15984"srv_senddone
MOREINFO="NONE", LINKEND="X51398"srv_thread_props
ID="IN5113496179"srv_negotiateID="X87885"ID="IN5213466580"srv_numparams
srv_numparams
Return the number of parameters contained in the current client command. FORMAT="LINESPECIFIC"CS_RETCODE srv_numparams(spp, numparamsp)FORMAT="LINESPECIFIC"SRV_PROC    *spp;FORMAT="LINESPECIFIC"CS_INT      *numparamsp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.numparamsp - A pointer to the number of arguments in the current client command or cursor data stream is returned In *numparamsp.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_numparams returns the number of parameters in the current MSG, RPC, DYNAMIC or cursor data stream.MOREINFO="NONE"srv_numparams can only be called from handlers for specific events. The following table lists those events and their parameters:TOCENTRY="1"LBL="Table 3-37: "Events and Parameters (srv_numparams)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="99*"COLNAME="C2" COLWIDTH="205*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"EventCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ParametersVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CURSORCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Cursor parametersCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_RPCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"RPC parametersCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DYNAMICCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Dynamic SQL parametersCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MSGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MSG parametersMOREINFO="NONE"srv_numparams replaces the MOREINFO="NONE"srv_rpcparams routine.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE    ex_srv_numparams PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC      *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT        *countp REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_NUMPARAMSREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to illustrate the use of srv_numparams to**    get the number parameters contained in the current client**    command.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp      A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    countp   A pointer to the buffer in which the number of**           parameters in the client command is returned.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_SUCCEED    The number of parameters was successfully **                returned.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE        ex_srv_numparams(spp, countp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC          *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT            *countp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if (srv_numparams(spp, countp) == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if *numparamsp contains the number of arguments in the MSG, RPC, DYNAMIC or cursor data stream.REMAP="BO--Body"CS_FAIL if an error was detected.See AlsoREMAP="BO--Body"LINKEND="X30757"srv_bind
MOREINFO="NONE", LINKEND="X19525"srv_cursor_props
MOREINFO="NONE", LINKEND="X26762"srv_dynamic
MOREINFO="NONE", LINKEND="X77646"srv_msg
MOREINFO="NONE", LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X52699"srv_xferdata
MOREINFO="NONE", LINKEND="X25021"Processing Parameter and Row Data
ID="IN5213436888"srv_numparamsID="IN5311407289"srv_options
srv_options
Send option information to a client or receive option information from a client. FORMAT="LINESPECIFIC"CS_RETCODE srv_options(spp, cmd, optcmdp, optionp,FORMAT="LINESPECIFIC"    bufp, bufsize, outlenp)FORMAT="LINESPECIFIC"SRV_PROC    *spp;FORMAT="LINESPECIFIC"CS_INT      cmd;FORMAT="LINESPECIFIC"CS_INT      *optcmdp;FORMAT="LINESPECIFIC"CS_INT      *optionp;FORMAT="LINESPECIFIC"CS_CHAR     *bufp;FORMAT="LINESPECIFIC"CS_INT      bufsize;FORMAT="LINESPECIFIC"CS_INT      *outlenp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.cmd - Indicates whether the application is calling MOREINFO="NONE"srv_options to send or receive option information. The following table describes the legal values for cmd:TOCENTRY="1"LBL="Table 3-38: "Values for cmd (srv_options)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="108*"COLNAME="C2" COLWIDTH="252*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The Open Server application is sending an option 
command to a client. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The Open Server application is receiving an option 
command from a client.optcmdp - A pointer either to the program variable that will contain a client's option command (CS_GET) or to the program variable that contains the Open Server application's option command (CS_SET). The following table summarizes the legal values for *optcmdp:TOCENTRY="1"LBL="Table 3-39: "Values for optcmdp (srv_options)COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="117*"COLNAME="C2" COLWIDTH="180*"COLNAME="C3" COLWIDTH="54*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CmdVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_SETOPTIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The client is requesting that the 
option be set. The value associated 
with optionp is returned in *bufp. Open 
Server will set bufsize to the size, in 
bytes, of the data returned. If *bufp is 
not large enough to hold the data, the 
function will return CS_FAIL, the 
actual size of the option value, in 
bytes, is returned in *outlenp, and the 
values of optionp and bufp will remain 
undefined.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GETCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CLEAROPTIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The client is requesting that optionp be 
set to its default value. The bufp and 
optionp values will remain undefined.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GETCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_GETOPTIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A client is requesting information on 
the current value in *optionp. The bufp 
and optionp values will remain 
undefined.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GETCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_SENDOPTIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The application is sending the current 
option value to the client in response 
to a SRV_GETOPTION command. 
bufp points to the argument 
associated with the option, and bufsize 
holds the size, in bytes, of the data in 
*bufp.COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SEToptionp - A pointer either to the client's requested option (CS_GET) or to the option with which the Open Server application is responding (CS_SET). bufp - A pointer to a buffer that will contain either the value associated with the option (CS_GET) or the value of the option to be sent to the requestor (CS_SET). The *optionp contains the option in question and *bufp contains its value (on a CS_SET). For a complete list of options and their legal values, see below.bufsize - The length of the *bufp buffer. When sending an option that takes a character string option value, if the value in bufp is null terminated, pass bufsize as CS_NULLTERM.outlenp - A pointer to a program variable which is set to the size, in bytes, of the option value returned in *bufp. This parameter is only used when cmd is set to CS_GET, and is optional.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_options allows an Open Server application to read option information from a client or send option information to a client.The following table summarizes the valid options, their legal values, and the datatype of the optionp parameter:TOCENTRY="1"LBL="Table 3-40: "Description of Options (srv_options)COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="153*"COLNAME="C2" COLWIDTH="144*"COLNAME="C3" COLWIDTH="144*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Option COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Legal ValueCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"bufp Points To VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_ANSINULLCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUE, CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_ANSIPERMCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUE, CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_ARITHABORTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUE, CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_ARITHIGNORECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUE, CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_AUTHOFFCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_SA,CS_OPT_SSO,CS_OPT_OPERCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A character stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_AUTHONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_SA,CS_OPT_SSO,CS_OPT_OPERCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A character stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_CHAINXACTSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUE, CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_CURCLOSEONXACTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUE, CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_CURREADCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Read label (string)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A character stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_CURWRITECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Write label (string)COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A character stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_DATEFIRSTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_SUNDAYCS_OPT_MONDAYCS_OPT_TUESDAYCS_OPT_WEDNESDAYCS_OPT_THURSDAYCS_OPT_FRIDAYCS_OPT_SATURDAYCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A symbolic value 
representing the day to use as 
the first day of the weekCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_DATEFORMATCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_FMTMDYCS_OPT_FMTDMYCS_OPT_FMTYMDCS_OPT_FMTYDMCS_OPT_FMTMYDCS_OPT_FMTDYMCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A symbolic value 
representing the order of 
year, month and day to be 
used in datetime valuesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_FIPSFLAGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUE, CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_FORCEPLANCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUE, CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_FORMATONLYCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUE, CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_GETDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUE, CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_IDENTITYOFFCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A string value representing a 
table nameCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A character stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_IDENTITYONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A string value representing a 
table nameCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A character stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_ISOLATIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_LEVEL1CS_OPT_LEVEL3COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A symbolic value 
representing the isolation 
levelCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_NOCOUNTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUE, CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_NOEXECCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUE, CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_PARSEONLYCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUE, CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_QUOTED_IDENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUE, CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_RESTREESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUE, CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_ROWCOUNTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The maximum number of 
regular rows to returnCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INT.0 means all rows are returnedCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_SHOWPLANCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUE, CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_STATS_IOCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUE, CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_STATS_TIMECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUE, CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_STR_RTRUNCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUE, CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_TEXTSIZECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The length, in bytes, of the 
longest text or image value 
the server should returnCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_OPT_TRUNCIGNORECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUE, CS_FALSECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLREMAP="UN--Under"The MOREINFO="NONE"Options topics describes each option and lists its default value.Open Server raises a SRV_OPTION event for each option command received from a client. Inside its SRV_OPTION event handler, the application can then call MOREINFO="NONE"srv_options with cmd set to CS_GET to retrieve the option information. When MOREINFO="NONE"srv_options returns, optcmdp, optionp, and *bufp will contain all of the option information received from the client. It is an error to call MOREINFO="NONE"srv_options in any event handler other than a SRV_OPTION event handler.In response to SRV_SETOPTION and SRV_CLEAROPTION, the application must call MOREINFO="NONE"srv_senddone with an argument of SRV_DONE_FINAL. If option processing is unsuccessful, the application must call MOREINFO="NONE"srv_senddone with an argument of SRV_DONE_FINAL | SRV_DONE_ERROR. The application must respond to every SRV_GETOPTION command it receives with a call to MOREINFO="NONE"srv_options, with optcmdp set to SRV_SENDOPTION and bufp pointing to the current value of the option.It is the application's responsibility to ensure that the *bufp buffer is large enough to receive arguments sent by a client with a SRV_SETOPTION command. If the buffer is not large enough, MOREINFO="NONE"srv_options will return CS_FAIL and outlenp will be set to the required size.Open Server has no notion of what particular options mean. It is the Open Server application's responsibility to save the client's option commands and perform any actions that they require. If there is no SRV_OPTION even handler installed, option commands received from clients will be rejected with an error. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE    ex_srv_options PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC      *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT        *rowcountREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_OPTIONSREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to recieve option information for the**    maximum number of regular rows to return (CS_OPT_ROWCOUNT)**    from a client.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   spp       A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   rowcount  Return pointer for the number of rows to return.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED   Successfully retrieved option.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL      An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE       ex_srv_options(spp, rowcount)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC         *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT           *rowcount;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_INT       optcmdp;    /* The client's option command. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_INT       optionp;    /* The client's option request. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* Initialization. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    optcmdp = SRV_GETOPTION;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    optionp = CS_OPT_ROWCOUNT;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Get the maximum number of rows to return.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if (srv_options(spp, CS_GET, &optcmdp, &optionp, (CS_VOID        *)rowcount, CS_SIZEOF(CS_INT), (CS_INT *)NULL) !=        CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}Returns REMAP="BO--Body"CS_SUCCEED if the client's option command is returned in *optcmdp, the associated option in *optionp, the arguments in *bufp and the length of the arguments in *outlenp (CS_GET); or if the option information set in *optcmdp, *optionp and *bufp is successfully sent to the client (CS_SET).REMAP="BO--Body"CS_FAIL if an error was detected.See AlsoREMAP="BO--Body"LINKEND="X15984"srv_senddone
MOREINFO="NONE",LINKEND="X46017"Options
ID="IN5311377597"srv_optionsID="IN5411347998"srv_orderby
srv_orderby
Return an order-by list to a client.FORMAT="LINESPECIFIC"CS_RETCODE srv_orderby(spp, numcols, collistp)FORMAT="LINESPECIFIC"SRV_PROC    *spp;FORMAT="LINESPECIFIC"CS_INT      numcols;FORMAT="LINESPECIFIC"CS_INT      *collistp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.numcols - The number of columns in the order-by list. Because the columns are passed as an array of CS_INTs, numcols is really the number of elements in the collistp array.collistp - A pointer to the array of column numbers. The size of this array is numcols.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_orderby is necessary only if you want to mimic SQL Server's feature of returning order-by information. MOREINFO="NONE"srv_orderby allows an Open Server application to return information about sort order to a client. In the SQL command:REMAP="UN--Under"MOREINFO="NONE"select a, b, c, dorder by c, aREMAP="UN--Under"The sort order is column c followed by column a. The application returns this information to the client by listing column 3 followed by column 1 in the column number array.The first column in a select list is column 1.MOREINFO="NONE"srv_orderby must be called after a call to MOREINFO="NONE"srv_descfmt and before a call to MOREINFO="NONE"srv_bind.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE   ex_srv_orderby PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC     *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_ORDERBYREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine using srv_orderby to define and return to a **    client application the order-by list for a simple SQL**    command.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    This example uses the SQL command:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**        "select a,b,c,d from my_tab**         order by c,a"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp    A pointer to the internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED      Order-by list was successfully defined.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL         An error was detected..REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE            ex_srv_orderby(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC              *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* There are two columns specified in the order-by clause. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_INT        collist[2];REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_INT        numcols;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* Initialization. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    numcols = 2;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Initialize the collist array in the order the    ** columns occur in the order-by clause.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    **REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** "c" is the 1st column specified in the order-by,    ** and is the 3rd column specified in the select-list.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    collist[0] = (CS_INT)3;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** "a" is the 2nd column specified in the order-by,    ** and is the 1st column specified in the select-list.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    collist[1] = (CS_INT)1;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ** Define the order-by list.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if (srv_orderby(spp, numcols, collist) != CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the order-by list was successfully defined. REMAP="BO--Body"CS_FAILID="IN54113182105"srv_orderby
 if an error was detected.REMAP="BO--Body"srv_paramdataID="IN43139751"srv_paramdata
Return the value of a remote procedure call parameter. FORMAT="LINESPECIFIC"CS_VOID *srv_paramdata(spp, n)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_INT           n;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.n - The parameter of interest. The first parameter is number 1. The number of parameters in the procedure is available from MOREINFO="NONE"srv_numparams. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_paramdata returns a pointer to a particular remote procedure call ("RPC") parameter value. If you know the parameter name, you can get the parameter number via MOREINFO="NONE"srv_paramnumber. MOREINFO="NONE"srv_paramdata will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_bind and MOREINFO="NONE"srv_xferdata routines together provide the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID      *ex_srv_paramdata PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PRO      *sp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT       pnumREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_PARAMDATAREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to get the actual data of a remoteREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    procedure call parameter.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    sp A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    pnum The parameter number.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED The data address is returned.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID    *ex_srv_paramdata(sp, pnum)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID    *sp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     pnum;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_VOID *lp; /* Local pointer. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Initialization.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      lp = (CS_VOID *)NULL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Get a pointer to the parameter's data.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      lp = srv_paramdata(sp,pnum);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return lp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"A generic void pointer (CS_VOID) to the parameter value. If the n'th parameter is null or there is no n'th parameter or there is no RPC, (CS_VOID) NULL is returned. See AlsoREMAP="BO--Body"LINKEND="X30757"srv_bind
MOREINFO="NONE", LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X87885"srv_numparams
MOREINFO="NONE", LINKEND="X52699"srv_xferdata
ID="IN43139489"srv_paramdataID="INC4412911210"srv_paramlen
srv_paramlen
Return the actual data length of a remote procedure call parameter. FORMAT="LINESPECIFIC"CS_INT srv_paramlen(spp, n)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_INT           n;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure. n - The number of the parameter. The first parameter is 1. The number of parameters is available from MOREINFO="NONE"srv_numparams. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_paramlen returns the actual data length, in bytes, of a remote procedure call ("RPC") parameter. Each parameter has an actual and a maximum data length. For standard fixed length datatypes that don't allow nulls, both lengths are the same. For variable length datatypes, the lengths can vary. For example, a parameter declared as varchar(30) can have data that is only 10 bytes long. The parameter's actual length is 10 and its maximum length is 30. The function MOREINFO="NONE"srv_parammaxlen returns the maximum length of a parameter. srv_paramlen will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_descfmt routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_paramlen  PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          pnum,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          *plenREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_PARAMLENREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to get the actual length of a remoteREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    procedure call parameter.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    pnum The number of the parameter.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    plen A pointer to the length.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** ReturnsREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED     The length is returned.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL        An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_paramlen(spp, pnum, plen)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID         *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          pnum;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          *plen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Check arguments. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if(spp == (SRV_PROC *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                 return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Call srv_paramlen.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      *plen = srv_paramlen(spp,pnum);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if(*plen == -1)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"The actual length in bytes of the parameter data. If there is no n'th parameter or there is no RPC, -1 is returned. If the n'th parameter is null, 0 is returned. See AlsoREMAP="BO--Body"LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X87885"srv_numparams
ID="IN4412881518"srv_paramlenID="IN4515851919"srv_parammaxlen
srv_parammaxlen
Return the maximum data length of a remote procedure call parameter. FORMAT="LINESPECIFIC"CS_INT srv_parammaxlen(spp, n)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_INT           n;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.n - The number of the parameter. The first parameter is 1. The number of parameters is available from MOREINFO="NONE"srv_numparams. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_parammaxlen returns the maximum data length in bytes of a remote procedure call ("RPC") parameter. Each parameter has an actual and a maximum data length. For standard fixed length types that don't allow nulls, both lengths are the same. For variable length fields, the lengths may vary. For example, a parameter declared as varchar(30) may have data that is only 10 bytes long. The parameter's actual length is 10 and its maximum length is 30. The function MOREINFO="NONE"srv_paramlen returns the actual length of a parameter. srv_parammaxlen will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_descfmt routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <stdio.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_parammaxlen PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *srvproc,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          paramnumREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_PARAMMAXLENREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to retrieve the maximum length of the RPCREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    parameter.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    srvproc  A pointer to an internal thread control structure. REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    paramnum  The parameter number. REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEEDREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAILREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_parammaxlen(srvproc, paramnum)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *srvproc;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          paramnum;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_INT    maxlen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if ((maxlen = srv_parammaxlen(srvproc, paramnum)) == -1)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"             printf("Could not retrieve max length of parameterREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                      %d\n", paramnum);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"             return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      elseREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           printf("max length of parameter %d = %d\n", paramnum,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                    maxlen);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"The maximum length in bytes of the parameter data. If there is no n'th parameter or there is no RPC, -1 is returned. See AlsoREMAP="BO--Body"LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X87885"srv_numparams
ID="INA4515822227"srv_parammaxlenID="X65668"ID="IN4613792628"srv_paramname
srv_paramname
Return the name of a remote procedure call parameter. FORMAT="LINESPECIFIC"CS_CHAR *srv_paramname(spp, n, lenp)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_INT           n;FORMAT="LINESPECIFIC"CS_INT           *lenp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.n - The number of the parameter. The first parameter is 1. The number of parameters is available from MOREINFO="NONE"srv_numparams. lenp - A pointer to a CS_INT variable that receives the length, in bytes, of the parameter name. lenp can be (CS_INT *) NULL, in which case the length of the RPC parameter name is not returned. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_paramname returns the name of a remote procedure call ("RPC") parameter. srv_paramname will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_descfmt routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"extern CS_RETCODE   ex_srv_paramname PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID             *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT              paramnum,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR             *namepREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_PARAMNAMEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Determine the name of a parameterREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   spp       A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   paramnum  The parameter number.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   namep     Return the name of the parameter here.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED    Parameter name was successfully returned inREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**                 *namep.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_paramname(spp, paramnum, namep)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          paramnum;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *namep;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_INT    paramlen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      namep = srv_paramname(spp, paramnum, &paramlen);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if(paramlen == (CS_INT)(-1))REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"A pointer to a null terminated character string
that contains the parameter name. The length of the parameter name is stored in *lenp . If there is no n'th parameter or there is no RPC, (CS_CHAR *) NULL is returned, *lenp is set to -1, and an informational error message is raised. If the parameter name is null, *lenp is set to 0 and a null terminated empty string ("") is returned. See AlsoREMAP="BO--Body"LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X87885"srv_numparamsID="X84992"ID="IN4715763036"srv_paramnumber
srv_paramnumber
Return the position number of a parameter for the current remote procedure call. FORMAT="LINESPECIFIC"CS_INT srv_paramnumber(spp, namep, namelen)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_CHAR          *namep;FORMAT="LINESPECIFIC"CS_INT           namelen;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.namep - A pointer to the parameter name. namelen - The length of *namep. If *namep is null terminated, namelen can be set to CS_NULLTERM. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_paramnumber returns the number of the named remote procedure call ("RPC") parameter. srv_paramnumber will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_descfmt routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE  ex_srv_paramnumber PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC    *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR   *nameREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_PARAMNUMBERREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to get the position number of an RPCREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    parameter.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  spp      A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  name     The name of the parameter we are looking for.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED If we were successful getting the parameterREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    number.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL If we were unable to get the parameter number.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE ex_srv_paramnumber(spp, name)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC   *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR    *name;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_INT    num;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      num = srv_paramnumber(spp, name, SRV_NULLTERM);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (num == (CS_INT)0)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return (CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"The parameter number of the named parameter. The first parameter is 1. If there is no parameter named *namep or there is no RPC, 0 is returned.See AlsoREMAP="BO--Body"LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X87885"srv_numparams
ID="IN4715733344"srv_paramnumberID="X38434"ID="IN4812703745"srv_paramset
srv_paramset
Set the value of a remote procedure call return parameter. FORMAT="LINESPECIFIC"CS_RETCODE srv_paramset(spp, n, datap, len)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"int              n;FORMAT="LINESPECIFIC"CS_VOID          *datap;FORMAT="LINESPECIFIC"int              len;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure. n - The number of the parameter to set. The first parameter is 1. The total number of parameters is available from MOREINFO="NONE"srv_numparams. datap - A pointer to the data value that should be sent back to the client as the RPC return parameter. len - The actual length of the data to be returned. If the datatype of the parameter is a constant length and doesn't allow nulls, len is ignored. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_paramset defines the return value for a remote procedure call ("RPC") return parameter. Parameters contain data which is passed between clients and the Open Server via RPCs. The client can specify certain parameters as "return parameters". These return parameters can contain values that the Open Server application passes back to the client. It is an error to try to set the return value for a parameter that wasn't invoked as a return parameter. You can use MOREINFO="NONE"srv_paramstatus to determine how the parameter was invoked. MOREINFO="NONE"srv_paramset sets the return value for a parameter but doesn't actually send it to the client. Whether their values have been set via MOREINFO="NONE"srv_paramset or not, all return parameters are sent to the client when MOREINFO="NONE"srv_senddone is called with the SRV_DONE_FINAL status bit set. MOREINFO="NONE"srv_paramset provides the only way to reset return parameters when the current client command is an RPC. To send return values to the client program when the current command is not an RPC, see the LINKEND="X25021"Processing Parameter and Row Data
    topics page. The following rules apply to handling return parameters and return values: REMAP="UN--Under"RPCs: Call MOREINFO="NONE"srv_paramset once for each return parameter. Call MOREINFO="NONE"srv_senddone to send the return parameters to the client. REMAP="UN--Under"non-RPCs: Call MOREINFO="NONE"srv_descfmt andMOREINFO="NONE" srv_bind once for each return value. Call MOREINFO="NONE"srv_senddone to send the return values to the clientsrv_paramset will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_bind routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_paramset PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *sproc,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          n,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID         *datap,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          lenREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_PARAMSETREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    An example routine to set the value of the n'th parameter REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    which is a remote procedure call return parameter.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    sproc    A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    n        The nth parameter, which is the designated returnREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**             parameter.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    datap    A pointer to the data value which is sentREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**             back to the client as the RPC return parameter.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    len      The length of the data to be returned.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    If the parameter was set successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_paramset(sproc, n, datap, len)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *sproc;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          n;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID         *datap;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          len;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Check to make sure that the n'th parameter was declaredREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** as an RPC return parameter.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if ( srv_paramstatus(sproc, n) != SRV_PARAMRETURN )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Set the value of the parameter. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if ( srv_paramset(sproc, n, datap, len) != CS_SUCCEED )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the parameter value was successfully set; otherwise, CS_FAIL. CS_FAIL is returned if there is no current RPC, there is no n'th RPC parameter, the parameter is not a return parameter, or the len argument isn't legal. REMAP="BO--Body"If len is 0, NULL is returned.See AlsoREMAP="BO--Body"LINKEND="X30757"srv_bind
MOREINFO="NONE", LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X87885"srv_numparams
MOREINFO="NONE", LINKEND="X25021"Processing Parameter and Row Data
ID="IN4812674053"srv_paramsetID="IN4915644454"srv_paramstatus
srv_paramstatus
Return the status of a remote procedure call parameter. FORMAT="LINESPECIFIC"CS_INT srv_paramstatus(spp, n)FORMAT="LINESPECIFIC"SRV_PROC        *spp;FORMAT="LINESPECIFIC"CS_INT          n;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure. n - The number of the parameter. CommentsMARK="BULL" REMAP="BU--Bullet"The first parameter is number 1. The total number of parameters is available from MOREINFO="NONE"srv_numparams. MOREINFO="NONE"srv_paramstatus returns the status flags for a remote procedure call ("RPC") parameter. Parameters contain data that is passed between clients and the Open Server with RPCs. The client can specify certain parameters as "return parameters". These return parameters contain values that the Open Server application passes back to the client. Currently, the only status flag is one that indicates whether the parameter is a return parameter. Use MOREINFO="NONE"srv_paramset to set the value of a return parameter. srv_paramstatus will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_descfmt routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <stdio.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE  ex_srv_paramstatus PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC    *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_PARAMSTATUSREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to illustrate the use of srv_paramstatusREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    to get the status of an RPC parameter.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp  A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED    If the parameter status was successfullyREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**                 obtained or there are no parameters.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE   ex_srv_paramstatus (spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC     *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_INT   count;      /* The number of params for the RPC. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_INT   event_type; /* The event type. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      int  i;              /* The index variable. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_INTstatus;        /* The parameter status. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_RETCODE ret;      /* The return code. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Initialization. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ret = CS_SUCCEED; /* Assume success. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Get the event type.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_thread_props(spp, CS_GET, SRV_T_EVENT, &event_type,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           sizeof(CS_INT), (CS_INT *)NULL) == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (event_type != SRV_RPC)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           fprintf(stderr, "It is not an RPC event\n");REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Get the number of parameters in the current RPC. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_numparams(spp, &count) == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* If there are no parameters for the current RPC, return. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (count == 0)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           fprintf(stderr, "There are no parameters for theREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                   currrent RPC\n");REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return (CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Now get the status for each parameter. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      for (i = 1; i <= count; i++)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           status = srv_paramstatus(spp, (CS_INT)i);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           /* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           ** status -  If status is equal to -1, an error REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           **          occurred. Continue with the next.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           if (status < 0)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"               fprintf(stderr, "Error occurred in REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                      srv_paramstatus\n");REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"               ret = CS_FAIL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"               break;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           /* Print the parameter status. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           if (status & SRV_PARAMRETURN) REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"               fprintf(stderr, "%dth parameter is RETURN                   parameter\n", i);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           elseREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           fprintf(stderr, "%dth parameter is an INPUTREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                   parameter\n", i);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return (ret);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"An int mask that contains status flags for the parameter. Currently there is only one flag: SRV_PARAMRETURN. If there is no n'th parameter or there is no RPC, -1 is returned. See AlsoREMAP="BO--Body"LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X87885"srv_numparams
ID="IN4915614762"srv_paramstatusID="X47367"ID="IN5013585163"srv_paramtype
srv_paramtype
Return the datatype of a remote procedure call parameter. FORMAT="LINESPECIFIC"CS_INT srv_paramtype(spp, n)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_INT           n;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.n - The number of the parameter. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_paramtype returns the Open Server datatype of a remote procedure call ("RPC") parameter. The first parameter is 1. The total number of parameters is available from MOREINFO="NONE"srv_numparams.srv_paramtype will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_descfmt routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_paramtype PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC       *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT         paramnum,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT         *paramtypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_PARAMTYPEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Example routine to retrieve the datatype of an RPCREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   parameter using srv_paramtype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   spp           A pointer to an internal thread control REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**                 structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   paramnum      The number of the parameter we're interested REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**                 in.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   paramtype     A return pointer for the type of theREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**                 parameter.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED    The parameter type was successfully retrieved.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL       There is no parameter or there is no RPC.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_paramtype(spp, paramnum, paramtype)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          paramnum;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          *paramtype;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Retrieve the parameter type.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if ((*paramtype = srv_paramtype(spp, paramnum)) == -1)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"              return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"A token value for the datatype of the parameter. A readable description for the value is available using MOREINFO="NONE"srv_symbol. For a list of the Open Server datatypes, see the LINKEND="X87730"Types
 topics page. If there is no n'th parameter or there is no RPC, -1 is returned. See AlsoREMAP="BO--Body"LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X87885"srv_numparams
MOREINFO="NONE", LINKEND="X39758"srv_symbol
MOREINFO="NONE", LINKEND="X87730"Types
ID="IN5013555471"srv_paramtypeID="X78437"ID="IN5110525872"srv_pfield
srv_pfield
Return a field from a thread control structure. FORMAT="LINESPECIFIC"CS_CHAR *srv_pfield(spp, field, lenp)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_INT           field;FORMAT="LINESPECIFIC"CS_INT           *lenp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.field - The thread structure field to return. The following table lists the legal field values and what each returns: TOCENTRY="1"LBL="Table 3-41: "Values and Returns for field (srv_pfield)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="99*"COLNAME="C2" COLWIDTH="252*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Value COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Returns VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_SPID   COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The thread ID of the thread associated with spp. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NETSPID   COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The thread ID of the network thread. This will always 
return -1, as a character string.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TYPE   COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The thread type. There are three thread types: client, sub-proc, and site-handler. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_STATUS   COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The current status of the thread associated with spp. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_EVENT   COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The current event for the thread associated with spp.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MACHINECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The name of the machine that the client thread is 
logged in from. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_LANGUAGECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The client's language type. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_USER   COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The user name used by the client thread when it 
logged into the Open Server application. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_PWD   COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The user password used by the spp client thread when 
it logged into the Open Server application. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CPID   COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The process ID of the client thread on its source 
machine. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_APPLNAME   COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The application program name the client supplied 
when it logged into the Open Server application. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_RMTSERVER   COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If the client thread is really from another server, this 
field is the name of the remote server. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS   COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The version of the Tabular Data Stream (TDS) used by 
the client. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CLIB   COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The name of the library the client used to enable it to 
talk to a server. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_LIBVERS   COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The version of the client library. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_ROWSENT   COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of rows sent by the thread so far for the 
current set of results. lenp - A pointer to an int variable that will contain the length of field. lenp can be (int *) NULL, in which case the length of the string isn't returned. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_pfield returns a pointer to a null terminated string containing the current value for the specified field in the specified thread structure. It also returns the length of the string, in *lenp. MOREINFO="NONE"srv_pfield returns numeric thread structure fields as character strings. srv_pfield will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_thread_props routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <stdlib.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE    ex_srv_pfield PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC   *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     *thrdpREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_PFIELDREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to return the Open Server thread id of theREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    calling thread, using srv_pfield.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp      A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    thrdp    A pointer to an integer variable to hold the REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**             thread id.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    The thread id was successfully returned.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       The SRV_SPID field returned as an empty REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**                  string.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_pfield(spp, thrdp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          *thrdp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** The thread id returned by srv_pfield is in string format.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_CHAR  *thrdstr;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Initialization. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     *thrdp = (CS_INT)0;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Retrieve the thread id - the return string length isREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** not needed, since the decimal representation is known toREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** fit into a CS_INT.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     thrdstr = srv_pfield(spp, (CS_INT)SRV_SPID, (CS_INT *)NULL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if (*thrdstr == (CS_CHAR)'\0')REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"             return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Convert the thread id to its integer equivalent */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     *thrdp = atoi(thrdstr);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Don't free thrdstr, since it is a reusable static buffer.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"A pointer to a string that contains the field
value. If the field is empty, a valid pointer to an empty string is returned and *lenp will contain 0. If the field is unknown, (CS_CHAR *) NULL is returned and *lenp will contain -1. LimitationsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_pfield returns a pointer to a static character buffer. Since there is just one buffer, each call overwrites the result of the previous call. Copy the buffer to local storage if you need to retain the value.   MOREINFO="NONE"srv_pfield returns values in the same buffer for all threads that call it. Therefore, MOREINFO="NONE"srv_pfield is not re-entrant, and should be protected with a mutex if used in applications that have a multithread architecture. See AlsoREMAP="BO--Body"LINKEND="X68633"srv_free
MOREINFO="NONE", LINKEND="X51398"srv_thread_props
MOREINFO="NONE", LINKEND="X33074"srv_sfield
MOREINFO="NONE", LINKEND="X39758"srv_symbol
ID="IN5110496181"srv_pfieldID="X88281"srv_poll (UNIXID="IN5220466582"srv_poll (UNIX only)
 only)
Check for I/O events on file descriptors for a set of open streams. FORMAT="LINESPECIFIC"CS_INT srv_poll(fdsp, nfds, waitflag)FORMAT="LINESPECIFIC"SRV_POLLFD             *fdsp;FORMAT="LINESPECIFIC"CS_INT                 nfds;FORMAT="LINESPECIFIC"CS_INT                 waitflag;ParametersREMAP="RI--RefIndent"fdsp - A pointer to an array of SRV_POLLFD structures with one element for each open file descriptor of interest. The SRV_POLLFD structure has the following members: REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"CS_INT   srv_fd;         /* File descriptor. */CS_INT   srv_events;     /* Relevant events. */CS_INT   revents;        /* Returned events. */ nfds - The number of elements in the *fdsp array. waitflag - A CS_INT value that indicates whether the thread should be suspended until a file descriptor is available for the desired operation. If set to SRV_M_WAIT, the thread is suspended and will wake when any file descriptor represented in the *fdsp array is available for the specified operation. If the flag is set to SRV_M_NOWAIT, MOREINFO="NONE"srv_poll will perform a single check and return to the caller. A return status greater than zero indicates that a file descriptor was available for the desired operation. CommentsMARK="BULL" REMAP="BU--Bullet"An application can use MOREINFO="NONE"srv_poll to poll the file descriptor or to suspend a thread until there is I/O to be performed. The following table summarizes legal values for srv_events and srv_revents:REMAP="BO--Body"TOCENTRY="1"LBL="Table 3-42: "Values for srv_events and revents (srv_poll)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="108*"COLNAME="C2" COLWIDTH="150*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_POLLINCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Normal read event.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_POLLPRICOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Priority event received.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_POLLOUTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"File descriptor is writable.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_POLLERRCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Error occurred on file 
descriptor.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_POLLHUPCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A hang up occurred on the file 
descriptor. This value is valid 
in returned events only.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_POLLNVALCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Invalid file descriptor specified 
in SRV_POLLFD.MARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_poll is available on all UNIX platforms.If an application uses MOREINFO="NONE"srv_poll on a UNIX platform that supports the native poll(2) system call, the application must include <sys/poll.h> before ospublic.h.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_pollPROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"struct pollfd   *fdp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          nfdsREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_POLLREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   This routine demonstrates how to use srv_poll to pollREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   application-specific file descriptors.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**         fdp - The address of the file descriptor array.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**         nfds - The number of file descriptors to poll.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** ReturnsREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    If the data address is returned.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       If the call to srv_poll failed.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_poll(fdp, nfds)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"struct pollfd   *fdp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          nfds;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Initialization.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      lp = (CS_VOID *)NULL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Calls srv_poll to check if any of these file REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** descriptors are active; ask to sleep until at REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** least one of them is.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if( srv_poll(fdp, nfds, SRV_M_WAIT) == (CS_INT)-1 )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return CS_FAIL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** All done.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return CS_SUCCEED;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"The number of ready file descriptions or -1 if an error occurs or 0 if no file descriptions are ready.See AlsoREMAP="BO--Body"LINKEND="X77376"srv_capability
MOREINFO="NONE", LINKEND="X24148"srv_select (UNIX only)
ID="IN5220436890"srv_poll (UNIX only)ID="X84669"ID="IN539407291"srv_props
srv_props
Define and retrieve Open Server properties. FORMAT="LINESPECIFIC"CS_RETCODE srv_props(cp, cmd, property, bufp, buflen,FORMAT="LINESPECIFIC"                 outlenp)FORMAT="LINESPECIFIC"CS_CONTEXT       *cp;FORMAT="LINESPECIFIC"CS_INT           cmd;FORMAT="LINESPECIFIC"CS_INT           property;FORMAT="LINESPECIFIC"CS_VOID          *bufp;FORMAT="LINESPECIFIC"CS_INT           buflen;FORMAT="LINESPECIFIC"CS_INT           *outlenp;ParametersREMAP="RI--RefIndent"scp - A pointer to a CS_CONTEXT structure previously allocated using MOREINFO="NONE"cs_ctx_alloc.cmd - The action to take. The following table summarizes the legal values for cmd:TOCENTRY="1"LBL="Table 3-43: "Values for cmd (srv_props)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="72*"COLNAME="C2" COLWIDTH="288*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The Open Server application is setting the property. In this 
case, bufp should contain the value the property is to be set to, 
and buflen should specify the size, in bytes, of that value.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The Open Server application is retrieving the property. In this 
case, bufp should point to the buffer where the property value 
is placed, and buflen should be the size, in bytes, of the buffer.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CLEARCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The Open Server application is resetting the property to its 
default value. In this case, bufp, buflen, and outlenp are ignored.property - The property being set, retrieved or cleared. See below for a list of this argument's legal values.bufp - A pointer to the Open Server application data buffer where property value information is placed (CS_SET) or property value information is retrieved (CS_GET).buflen - The length, in bytes, of the buffer.outlenp -A pointer to a CS_INT variable, which Open Server will set to the size, in bytes, of the property value retrieved. This argument is only used when cmd is CS_GET, and is optional.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_props is called to define and retrieve server-wide configuration parameters and properties.The following table summarizes the server properties, whether they can be set or retrieved, and the datatype of each property value:TOCENTRY="1"LBL="Table 3-44: "Server Properties and Their Datatype (srv_props)COLS="5" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="125*"COLNAME="C2" COLWIDTH="100*"COLNAME="C3" COLWIDTH="34*"COLNAME="C4" COLWIDTH="113*"COLNAME="C5" COLWIDTH="113*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"PropertyCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SET/CLEARCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"GETCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"bufp when cmd is 
CS_SET:COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"bufp when cmd is 
CS_GET:VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_ALLOCFUNCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A function pointerCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The address of a 
function pointerCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_APICHKCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_ATTNREASONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_CURTHREADCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Not applicableCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The address of a 
thread pointerCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_DISCONNECTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_DEFQUEUESIZECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_ERRHANDLECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A function pointerCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The address of a 
function pointerCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_FREEFUNCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A function pointerCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The address of a 
function pointerCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_IFILECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A character stringCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A character stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_LOGFILECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A character stringCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A character stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_LOGSIZECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_MSGPOOLCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NETBUFSIZECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NETTRACEFILECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A character stringCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A character stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMCONNECTIONSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMMSGQUEUESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMMUTEXESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMREMBUFCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMREMSITESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMTHREADS COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMUSEREVENTSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_PREEMPTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_REALLOCFUNCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A function pointerCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The address of a 
function pointerCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_REQUESTCAPCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_CAP_TYPE 
structureCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_CAP_TYPE 
structureCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_RESPONSECAPCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_CAP_TYPE 
structureCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_CAP_TYPE 
structureCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_SERVERNAMECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A character stringCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A character stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_STACKSIZECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_TDSVERSIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_TIMESLICECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_TRACEFLAGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INT (bit mask)COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INT (bit mask)COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_TRUNCATELOGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_USESRVLANGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_VERSIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A character stringCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A character stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_VIRTCLKRATECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_VIRTTIMERCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLThe following table lists the default value for each server property:TOCENTRY="1"LBL="Table 3-45: "Legal Properties and Their Default Value (srv_props)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="153*"COLNAME="C2" COLWIDTH="171*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"PropertyCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DefaultVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_ALLOCFUNCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"malloc()COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_APICHKCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_ATTNREASONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No defaultCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_CURTHREADCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"N/A.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_DEFQUEUESIZECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_DEFQUEUESIZECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_DISCONNECTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_ERRHANDLECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"No error handlerCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_FREEFUNCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"free()COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_IFILECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"$SYBASE/interfacesCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_LOGFILECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0""srv.log"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_LOGSIZECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"max integer valueCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_MSGPOOLCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_MSGPOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NETBUFSIZECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_NETBUFSIZECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NETTRACEFILECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"sybnet.dbgCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMCONNECTIONSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_NUMCONNECTIONSCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMMSGQUEUESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_NUMMSGQUEUESCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMMUTEXESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_NUMMUTEXESCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMREMBUFCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_NUMREMBUFCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMREMSITESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_NUMREMSITESCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMTHREADSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_NUMTHREADSCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_NUMUSEREVENTSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_NUMUSEREVENTSCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_PREEMPTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_REALLOCFUNCCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"realloc()COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_REQUESTCAPCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"See the LINKEND="X89653"Capabilities topics.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_RESPONSECAPCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"See the LINKEND="X89653"Capabilities topics.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_SERVERNAMECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DSLISTEN environment variableCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_STACKSIZECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_STACKSIZECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_TDSVERSIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_5_0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_TIMESLICECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_TIMESLICECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_TRACEFLAGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"0COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_TRUNCATELOGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_USESRVLANGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRUECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_VERSIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Compile-time version stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_VIRTCLKRATECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DEF_VIRTCLKRATECOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_S_VIRTTIMERCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FALSEAll server properties that have a default and are settable can be reset back to the default value by calling MOREINFO="NONE"srv_props with cmd set to CS_CLEAR.All server properties can be retrieved at any time by calling MOREINFO="NONE"srv_props with cmd set to CS_GET. If the Open Server application has not defined a value for a property, the default value is returned. For a description of properties and their default values, see the LINKEND="X41578"Tailoring Your Open Server
 page.All properties must be set before MOREINFO="NONE"srv_init is called. When a property is being retrieved, if buflen indicates that the user buffer is not big enough to hold the property value, Open Server will place the number of bytes required in *outlenp, and the user buffer will not be modified. MOREINFO="NONE"srv_props replaces functionality previously provided by the MOREINFO="NONE"srv_config, MOREINFO="NONE"srv_setifile, and MOREINFO="NONE"srv_sfield routines and the MOREINFO="NONE"SRV_CURPROC, MOREINFO="NONE"SRV_GETVERSION, MOREINFO="NONE"SRV_TRACE, MOREINFO="NONE"SRV_TRACEOFF, and MOREINFO="NONE"SRV_TRACEON macros.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include<ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local prototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE ex_srv_set_propPROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CONTEXT *cp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     property,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID    *bufp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     buflenREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SET_PROPREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to set a property using srv_props.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    *cp       Pointer to a CS_CONTEXT structure previouslyREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**              allocated by cs_ctx_alloc.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    property  The property being set.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    *bufp     Pointer to the value the property is to beREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**              set to.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    buflen    The length of the value.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** ReturnsREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED   Arguments were valid and srv_props was called.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL      An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_set_prop(cp, property, bufp, buflen)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CONTEXT      *cp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          property;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID         *bufp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          buflen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Check arguments. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if(cp == (CS_CONTEXT *)NULL) REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if(buflen < 1)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            return(CS_FAIL);                             return(srv_props(cp,(CS_INT)CS_SET,property,bufp,buflen,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"  (CS_INT *)0));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the property was set, retrieved, or cleared.REMAP="BO--Body" CS_FAIL if no action was taken.See AlsoREMAP="BO--Body"LINKEND="X24609"srv_init
MOREINFO="NONE", LINKEND="X51398"srv_thread_props
MOREINFO="NONE", LINKEND="X41578"Tailoring Your Open Server
ID="IN539377599"srv_propsID="X32227"ID="IN54113479100"srv_putmsgq
srv_putmsgq
Put a message into a message queue. FORMAT="LINESPECIFIC"CS_RETCODE srv_putmsgq(msgqid, msgp, putflags)FORMAT="LINESPECIFIC"SRV_OBJID        msgqid;FORMAT="LINESPECIFIC"CS_VOID          *msgp;FORMAT="LINESPECIFIC"CS_INT           putflags;ParametersREMAP="RI--RefIndent"msgqid - The identifier for the message queue. If you want to reference the message queue by name, callMOREINFO="NONE" srv_getobjid to look up the name and return the message queue ID. msgp - A pointer to the message. The message data must be valid until it is received and processed. putflags - The values for putflags can be OR'd together. The following table describes each value's significance: TOCENTRY="1"LBL="Table 3-46: "Values for putflags (srv_putmsgq)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="99*"COLNAME="C2" COLWIDTH="261*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_M_NOWAITCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"When this flag is set, the call to MOREINFO="NONE"srv_putmsgq returns 
immediately after the message is placed in the message 
queue. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_M_WAITCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"When SRV_M_WAIT is set, MOREINFO="NONE"srv_putmsgq does not return 
until either the message is read or the queue is deleted. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_M_URGENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"If this flag is set, the message is put at the head of the list 
of messages in the message queue instead of at the end. 
If more than one urgent message is added to a given 
queue, the urgent messages will appear at the head of 
the queue in the order in which they were enqueued. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_putmsgq puts the message in *msgp into the message queue msgqid. A message is always passed as a pointer. The data the message points to must remain valid even if the thread sending the message changes context. REMAP="UN--Under"In particular, be cautious when passing a message that points to a stack address in the context of the thread that sends the message. If you do this, you must guarantee that the thread that sends the message does not return from the frame in which it sent the message until the message has been removed from the queue. Otherwise, the message may point to a stack that is being used for other purposes. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE ex_srv_putmsgq PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_OBJID  mqid,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     flagsREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_PUTMSGQREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to put a message into a message queue.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   msgqid    Message queue identifier.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   putflags  Special instructions for srv_putmsgq.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEEDREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAILREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_putmsgq(mqid, flags)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_OBJID      mqid;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT         flags;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_CHAR   msgp[20];REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     strcpy(msgp, "Hi there");REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return(srv_putmsgq(mqid, msgp, flags));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X63435"srv_createmsgq
MOREINFO="NONE", LINKEND="X72703"srv_deletemsgq
MOREINFO="NONE", LINKEND="X70696"srv_getmsgq
MOREINFO="NONE", LINKEND="X37417"srv_getobjid
ID="IN54113182108"srv_putmsgqID="X58541"ID="IN55112886109"srv_realloc
srv_realloc
Reallocate memory. FORMAT="LINESPECIFIC"CS_VOID* srv_realloc(mp,newsize)FORMAT="LINESPECIFIC"CS_VOID         *mp;FORMAT="LINESPECIFIC"CS_INT          newsize;ParametersREMAP="RI--RefIndent"mp - A pointer to the old block of memory.newsize - The number of bytes to reallocate. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_realloc reallocates memory dynamically. It changes the size of the block referenced by mp to newsize, and returns a pointer to the (possibly moved) block.Any memory allocated using MOREINFO="NONE"srv_realloc should be freed by calling MOREINFO="NONE"srv_free. Use MOREINFO="NONE"srv_realloc wherever the standard C memory-allocation routines would be used. Currently, MOREINFO="NONE"srv_realloc calls the C routine, realloc. A 10.0 Open Server application, however, can install its own memory management routines using the new MOREINFO="NONE"srv_props routine. The parameter-passing conventions of the user-installed routines must be the same as those of realloc. If the application is not configured to use the user-installed routines, Open Server will call realloc.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"extern CS_RETCODE ex_srv_realloc PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID       *mp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT       newsizeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_REALLOCREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Reallocate a memory chunk.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    mp        A pointer to existing memory block.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    newsize   The new size of the memory block.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED   Memory was allocated successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL      An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_realloc(mp, newsize)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID         *mp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          newsize;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      mp = srv_realloc(mp, newsize);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if(mp == (CS_VOID *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"A pointer to the newly allocated space. If newsize bytes cannot be allocated, a null pointer is returned. See AlsoREMAP="BO--Body"LINKEND="X95939"srv_alloc
MOREINFO="NONE", LINKEND="X68633"srv_free
MOREINFO="NONE", LINKEND="X84669"srv_props
ID="IN55112589117"srv_reallocID="X69557"ID="IN56162293118"srv_recvpassthru
srv_recvpassthru
Receive a protocol packet from a client. FORMAT="LINESPECIFIC"CS_RETCODE srv_recvpassthru(spp, recv_bufp, infop)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_BYTE          **recv_bufp;FORMAT="LINESPECIFIC"CS_INT           *infop;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure. recv_bufp - A pointer to a CS_BYTE pointer that will receive the starting address of the buffer containing the received protocol packet. infop - A pointer to a CS_INT that is set to SRV_I_UNKNOWN if MOREINFO="NONE"srv_recvpassthru returns CS_FAIL. The following table describes the possible values returned in *infop ifMOREINFO="NONE" srv_recvpassthru returns CS_SUCCEED: TOCENTRY="1"LBL="Table 3-47: "CS_SUCCEED Values (srv_recvpassthru)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="144*"COLNAME="C2" COLWIDTH="216*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_PASSTHRU_MORECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A protocol packet was read successfully and is 
not the end of message packet. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_PASSTHRU_EOMCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The packet is the end of message packet.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_recvpassthru receives a protocol packet without interpreting its contents. Once MOREINFO="NONE"srv_recvpassthru is called, the event handler that called it is in "pass-through" mode. Pass-through mode ends when SRV_I_PASSTHRU_EOM is returned in *infop. No other Server-Library routines can be called while the event handler is in pass-through mode. In pass-through mode, the SRV_CONNECT handler for the client must allow the client and remote server to negotiate the protocol packet format by calling MOREINFO="NONE"srv_getloginfo, MOREINFO="NONE"ct_setloginfo, ct_getloginfo, and MOREINFO="NONE"srv_setloginfo. This allows clients and remote servers running on dissimilar platforms to perform any necessary data conversions. MOREINFO="NONE"srv_recvpassthru can be called in all event handlers except SRV_START, SRV_CONNECT, SRV_STOP, SRV_DISCONNECT, SRV_URGDISCONNECT, and SRV_ATTENTION. Once it has called MOREINFO="NONE"srv_recvpassthru, an application cannot call any other routine that does I/O until it has issued a MOREINFO="NONE"srv_senddone. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include      <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_recvpassthru PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID         *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_RECVPASSTHRUREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Example routine to receive protocol packets from a client.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   spp    A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED If we were able to receive the packets.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL If were unsuccessful at receiving the packets.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE    ex_srv_recvpassthru(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC    *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_RETCODE    result;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_BYTE       *recvbuf;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_INT        info;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Read packets until we get the EOM flag.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     doREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            result = srv_recvpassthru(spp, &recvbuf, &info);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     while (result == CS_SUCCEED && info == SRV_I_PASSTHRU_MORE);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return (result);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X37685"srv_getloginfo
MOREINFO="NONE", LINKEND="X30039"srv_sendpassthru
MOREINFO="NONE", LINKEND="X72527"srv_setloginfo
ID="IN56161996126"srv_recvpassthruID="X14192"ID="IN571316100127"srv_regcreate
srv_regcreate
Complete the registration of a registered procedure. FORMAT="LINESPECIFIC"CS_RETCODE srv_regcreate(spp, infop)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_INT           *infop;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.infop - A pointer to a CS_INT. The following table describes the possible values returned in *infop if MOREINFO="NONE"srv_regcreate returns CS_FAIL: TOCENTRY="1"LBL="Table 3-48: "Values for infop (srv_regcreate)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="108*"COLNAME="C2" COLWIDTH="207*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_PEXISTSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The procedure is already registered. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_UNKNOWNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Some other error occurred. CommentsMARK="BULL" REMAP="BU--Bullet"After all information needed to register a procedure has been provided, MOREINFO="NONE"srv_regcreate completes the registration. The procedure's name and parameters must have been previously defined with MOREINFO="NONE"srv_regdefine and MOREINFO="NONE"srv_regparam respectively. Once registered, the procedure can be invoked by a client application or from within an Open Server application program. See  LINKEND="X64731"srv_regdefine
, for an example that registers a procedure. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT    ex_srv_regcreate PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC  *sprocREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_REGCREATEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    An example routine that completes the registration of aREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    registered procedure using srv_regcreate.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    sproc  A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED   If the procedure was registered successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL      If the supplied internal control structure isREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC" **                NULL.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    SRV_I_EXIST       If the procedure is already registered.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    SRV_I_UNKNOWN     If some other error occurred.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT    ex_srv_regcreate(sproc)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC  *sproc;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_INT    info;     /* The reason for failure */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Check whether the internal control structure is NULL.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if ( sproc == (SRV_PROC *)NULL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return((CS_INT)CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Now register the procedure alread defined byREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** srv_regdefine and(or) srv_regparam. If an error  REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** occurred, return the cause of error.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if ( srv_regcreate(sproc, &info) == CS_FAIL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"             return(info);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* The procedure is registered. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return((CS_INT)CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X64731"srv_regdefine
MOREINFO="NONE", LINKEND="X19057"srv_regdrop
MOREINFO="NONE", LINKEND="X50081"srv_reglist
MOREINFO="NONE", LINKEND="X60481"srv_regparam
ID="IN571313103135"srv_regcreateID="X64731"ID="IN581310107136"srv_regdefine
srv_regdefine
Initiate the process of registering a procedure. FORMAT="LINESPECIFIC"CS_RETCODE srv_regdefine(spp, procnamep, FORMAT="LINESPECIFIC"                    namelen, func)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_CHAR          *procnamep;FORMAT="LINESPECIFIC"CS_INT           namelen;FORMAT="LINESPECIFIC"SRV_EVENTHANDLE_FUNC(*funcp)();ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.procnamep - A pointer to the name of the procedure. namelen - The length of the
procedure name. If the string in *proc_namep  is null terminated, namelen can be CS_NULLTERM. funcp - A pointer to the function to be called each time the procedure is executed. Setting this parameter to null registers a "notification" procedure. Notification procedures are useful for inter-client communication. For more information on notification procedure, see the LINKEND="X80111"Registered Procedures
 
topics page.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_regdefine is the first step in the process of registering a procedure. Once it is registered, a procedure can be invoked by clients or from within the Open Server application program. After calling MOREINFO="NONE"srv_regdefine, define the procedure's parameters with MOREINFO="NONE"srv_regparam. Complete the processing of registering the procedure by calling MOREINFO="NONE"srv_regcreate. If a registered procedure exists with a name identical to the one in procnamep, the error is detected and reported when MOREINFO="NONE"srv_regcreate is called. All requested procedures should return SRV_CONTINUE.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <stdio.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_regdefine PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_SERVER      *serverREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      stop_serv PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local defines.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#define   STOP_SERV   "stop_serv"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** STOP_SERVREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    This function is called when the client sends the stop_serv REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    registered procedure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp A pointer to internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    SRV_CONTINUEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     stop_serv(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC   *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC" /* Queue a SRV_STOP event. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC" (CS_VOID)srv_log((SRV_SERVER *)NULL, CS_TRUE, REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           "Stopping Server\n", CS_NULLTERM);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Send a final DONE to client to acknowledge the command. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if (srv_senddone(spp, SRV_DONE_FINAL, CS_TRAN_UNDEFINED,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                (CS_INT)0)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            fprintf(stderr, "srv_senddone failed\n");REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Queue a SRV_STOP event to shut down the server. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC" if (srv_event(spp, SRV_STOP, (CS_VOID *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           fprintf(stderr, "Error queuing SRV_STOP event\n");REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC" return (SRV_CONTINUE);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_REGDEFINEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to illustrate the use of srv_regdefine to REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    register a procedure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   server       A pointer to the Open Server control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED  If procedure was registered successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL     If an error occurred in registering the REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**                  procedure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_regdefine (server)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_SERVER      *server;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      SRV_PROC  *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_INT    info;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Create a thread. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      spp = srv_createproc(server);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (spp == (SRV_PROC *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Define the procedure. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_regdefine(spp, STOP_SERV, CS_NULLTERM, stop_serv)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Complete the registration. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_regcreate(spp, &info) == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Terminate the thread created here. We do not care aboutREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** the return code from srv_termproc here.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      (CS_VOID)srv_termproc(spp);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return (CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X14192"srv_regcreate
MOREINFO="NONE", LINKEND="X19057"srv_regdrop
MOREINFO="NONE", LINKEND="X50081"srv_reglist
MOREINFO="NONE", LINKEND="X60481"srv_regparam
ID="IN58137110144"srv_regdefineID="X19057"ID="IN59114114145"srv_regdrop
srv_regdrop
Unregister a procedure. FORMAT="LINESPECIFIC"CS_RETCODE srv_regdrop(spp, procnamep, FORMAT="LINESPECIFIC"                    namelen, info)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_CHAR          *procnamep;FORMAT="LINESPECIFIC"CS_INT           namelen;FORMAT="LINESPECIFIC"CS_INT           *infop;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.procnamep - A pointer to the name of the procedure. namelen - The length of the registered procedure name. If the name is null terminated, namelen can be CS_NULLTERM. infop - A pointer to a CS_INT. If MOREINFO="NONE"srv_regdrop returns CS_FAIL, the flag is set to one of the following values: REMAP="UN--Under"SRV_I_PNOTKNOWN - The procedure was not registered. REMAP="UN--Under"SRV_I_UNKNOWN - Some other error occurred. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_regdrop unregisters a procedure previously registered with MOREINFO="NONE"srv_regcreate. Any client threads waiting for notification of this procedure are informed that the procedure has been unregistered. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_regdrop PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC       *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR        *name,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT         namelen,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT         *infopREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_REGDROPREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to unregister a registered procedure using REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    srv_regdrop. REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   spp       A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   name      The name of the registered procedure to drop.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   namelen   The length of the registered procedure name.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   infop     A return pointer to an integer containing moreREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**             descriptive error information if this routineREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**             returns CS_FAIL.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED    Registered procedure was successfully deleted.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL       Registered procedure was not deleted or does REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**                  not exist.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_regdrop(spp, name, namelen, infop)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC       *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR        *name;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT         namelen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT         *infop;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Initialization. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      *infop = (CS_INT)0;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Execute the procedure. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_regdrop(spp, name, namelen, infop) != CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           /* Open Server has set infop to a specific error. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X14192"srv_regcreate
MOREINFO="NONE", LINKEND="X64731"srv_regdefine
MOREINFO="NONE", LINKEND="X50081"srv_reglist
MOREINFO="NONE", LINKEND="X60481"srv_regparam
ID="IN59111117153"srv_regdropID="X27023"ID="IN6011-2121154"srv_regexec
srv_regexec
Execute a registered procedure. FORMAT="LINESPECIFIC"CS_RETCODE srv_regexec(spp, infop)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_INT           *infop;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.infop - A pointer to a CS_INT. The following table describes the possible values returned in *infop if MOREINFO="NONE"srv_regexec returns CS_FAIL: TOCENTRY="1"LBL="Table 3-49: "Values for infop (srv_regexec)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="126*"COLNAME="C2" COLWIDTH="234*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_PNOTKNOWNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The procedure is not registered. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_PPARAMERRCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"There is a parameter error. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_PNOTIFYERRCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"An error occurred while sending notifications. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_regexec executes a registered procedure. The procedure name and its parameters must be specified with MOREINFO="NONE"srv_reginit and MOREINFO="NONE"srv_regparam before calling MOREINFO="NONE"srv_regexec. Open Server system registered procedures send a final DONE. If an application executes a system registered procedure from an event handler using MOREINFO="NONE"srv_regexec, the application must not send a final DONE from the event handler code. Doing so will cause Open Server to raise a state error.REMAP="BO--Body"ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_regexec PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          &infopREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_REGEXECREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Example routine to complete the execution of a registeredREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   procedure using srv_regexec. This routine should be calledREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   after srv_reginit and srv_regparam.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   spp       A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   infop     A return pointer to an integer containing moreREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**             descriptive error information if this routineREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**             returns CS_FAIL.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    Registered procedure executed successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       Registered procedure not executed, or REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**                  notifications not completed successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE ex_srv_regexec(spp, infop)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC   *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     &infop;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Initialization. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      &infop = (CS_INT)0;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Execute the procedure. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_regexec(spp, infop) != CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           /* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           ** Open Server has set the argument to a specific REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           ** error. REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X59376"srv_reginit
MOREINFO="NONE", LINKEND="X60481"srv_regparam
ID="IN6011-5124162"srv_regexecID="X59376"ID="IN6111-8128163"srv_reginit
srv_reginit
Begin executing a registered procedure. FORMAT="LINESPECIFIC"CS_RETCODE srv_reginit(spp, procnamep, FORMAT="LINESPECIFIC"                    namelen, options)FORMAT="LINESPECIFIC"SRV_PROC           *spp;FORMAT="LINESPECIFIC"CS_CHAR            *procnamep;FORMAT="LINESPECIFIC"CS_INT             namelen;FORMAT="LINESPECIFIC"unsigned short     options;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure. procnamep - A pointer to the name of the registered procedure. namelen - The length of the procedure name. If the name is null terminated, namelen can be CS_NULLTERM. options - A flag that determines which threads to notify. The following table describes the legal values for options: TOCENTRY="1"LBL="Table 3-50: "Values for options (srv_reginit)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="126*"COLNAME="C2" COLWIDTH="234*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_M_PNOTIFYALLCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Notify all waiting threads in the notification list. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_M_PNOTIFYNEXTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Notify only the thread that has been waiting the 
longest. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_reginit is the first step in the process of executing a registered procedure. The procedure's parameters are defined with MOREINFO="NONE"srv_regparam after MOREINFO="NONE"srv_reginit has been called. Call MOREINFO="NONE"srv_regexec to execute the registered procedure. If the procedure does not exist, the error is detected and reported by MOREINFO="NONE"srv_regexec. When a registered procedure is executed, Open Server notifies the threads in the procedure's notification list. The options parameter specifies whether notifications are sent to all threads in the list, or just the one that has been waiting the longest. An Open Server application can nest registered procedures up to a maximum of 16 levels.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_reginit  PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC       *sp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR        *pname,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT         nlenREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_REGINITREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    This routine demonstrates how to use srv_reginit toREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    initiate the execution of a registered procedure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**         sp       A pointer to an internal thread control REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                    structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**         pname    The name of the procedure to execute.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**         nlen     The length of the procedure name.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** ReturnsREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    If the registered procedure began execution.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       If an error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_reginit(sp, pname, nlen)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *sp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *pname;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          nlen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Call srv_reginit to initiate the execution of thisREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** registered procedure; ask that all threads waiting forREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** notification of this event be notified.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if( srv_reginit(sp, pname, nlen, SRV_M_PNOTIFYALL) ==REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            CS_FAIL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           ** An error was already raised.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return CS_FAIL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** All done.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return CS_SUCCEED;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X27023"srv_regexec
MOREINFO="NONE", LINKEND="X60481"srv_regparam
ID="IN6111-11131171"srv_reginitID="X50081"ID="IN6211-14135172"srv_reglist
srv_reglist
Obtain a list of all of the procedures registered in the Open Server. FORMAT="LINESPECIFIC"CS_RETCODE srv_reglist(spp, proclistp)FORMAT="LINESPECIFIC"SRV_PROC              *spp;FORMAT="LINESPECIFIC"SRV_PROCLIST          **proclistp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.proclistp - A pointer to a SRV_PROCLIST pointer that will be set to the address of a SRV_PROCLIST containing the results. The Open Server allocates the space for this structure at the time MOREINFO="NONE"srv_reglist is called. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_reglist returns a list of all currently registered procedures for the thread. The parameter proclistp is set to point to a structure that is allocated and initialized by the Open Server. The SRV_PROCLIST structure is defined as follows: REMAP="COW10--CompOutWide10pt" FORMAT="LINESPECIFIC"typedef struct srv__proclist {      CS_INT        num_procs;      /* The number of procedures */      CS_CHAR       **proc_list;    /* Array of procedure names */ } SRV_PROCLIST; The SRV_PROCLIST structure should be deallocated with MOREINFO="NONE"srv_reglistfree when it is no longer needed. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_reglist PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROCLIST    **proclpREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_REGLISTREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   spp       Pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   proclp    Pointer to a SRV_PROCLIST pointer that will be setREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**             to point to the result.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** ReturnsREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED    srv_reglist was successful.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL       An argument was invalid or srv_reglist failed.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_reglist (spp, proclp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROCLIST    **proclp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Check arguments. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if(spp == (SRV_PROC *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(srv_reglist(spp,proclp));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X25775"srv_reglistfree
ID="IN6211-17138180"srv_reglistID="X25775"ID="IN6315-20142181"srv_reglistfree
srv_reglistfree
Free a previously allocated SRV_PROCLIST structure. FORMAT="LINESPECIFIC"CS_RETCODE srv_reglistfree(spp, proclistp)FORMAT="LINESPECIFIC"SRV_PROC            *spp;FORMAT="LINESPECIFIC"SRV_PROCLIST        *proclistp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.proc_list - A pointer to a SRV_PROCLIST structure previously allocated by MOREINFO="NONE"srv_reglist or MOREINFO="NONE"srv_regwatchlist. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_reglistfree deallocates a SRV_PROCLIST structure allocated by MOREINFO="NONE"srv_reglist or MOREINFO="NONE"srv_regwatchlist. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_reglistfree PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *srvproc,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROCLIST    *reglistpREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_REGLISTFREEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Example routine to free a previously allocated reglist.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  srvproc    A pointer to an internal thread control structure. REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  reglistp   A pointer to the list to free.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEEDREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAILREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_reglistfree(srvproc, reglistp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *srvproc;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROCLIST    *reglistp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"       return(srv_reglistfree(srvproc, reglistp));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X50081"srv_reglist
MOREINFO="NONE", LINKEND="X96451"srv_regwatchlist
ID="IN6315-23145189"srv_reglistfreeID="X76628"ID="IN6414-26149190"srv_regnowatch
srv_regnowatch
Remove a client thread from the notification list for a registered procedure. FORMAT="LINESPECIFIC"CS_RETCODE srv_regnowatch(spp, procnamep, FORMAT="LINESPECIFIC"                       namelen, infop)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_CHAR          *procnamep;FORMAT="LINESPECIFIC"CS_INT           namelen;FORMAT="LINESPECIFIC"CS_INT           *infop;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure. procnamep - A pointer to the name of the procedure. namelen - The length of the procedure name. If the name is null terminated, namelen can be CS_NULLTERM. infop - A pointer to a CS_INT. The following table describes the possible values returned in *infop if MOREINFO="NONE"srv_regnowatch returns CS_FAIL:TOCENTRY="1"LBL="Table 3-51: "Values for infop (srv_regnowatch)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="135*"COLNAME="C2" COLWIDTH="225*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_PNOTCLIENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A non-client thread was specified. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_PNOTKNOWNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The procedure is not known to the Open Server 
application. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_PNOPENDINGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The thread is not on the notification list for this 
procedure. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_PPARAMERRCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A parameter error occurred.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_UNKNOWNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Some other error occurred.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_regnowatch removes a client thread from the list of threads to notify when the specified procedure executes. The maximum length of a procedure name is SRV_MAXNAME.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"extern CS_RETCODE  ex_srv_regnowatch PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID         *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *procnamep,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          namelenREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_REGNOWATCHREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Remove a client thread from the notification list for theREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    specified registered procedure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   spp           A pointer to an internal thread control REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                   structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   procnamep     A pointer to the name of the registered REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                   procedure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   namelen       The length of the registered procedure name.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED    The thread was removed from notification list.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_regnowatch(spp, procnamep, namelen)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *procnamep;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          namelen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if(srv_regnowatch(spp, procnamep, namelen, (CS_INT *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X39840"srv_regwatch
MOREINFO="NONE", LINKEND="X96451"srv_regwatchlist
ID="IN6414-29152198"srv_regnowatchID="X60481"ID="IN6512-32156199"srv_regparam
srv_regparam
Describe a parameter for a registered procedure being defined, or supply data for the execution of a registered procedure. FORMAT="LINESPECIFIC"CS_RETCODE srv_regparam(spp, param_namep, namelen, FORMAT="LINESPECIFIC"                     type, datalen, datap)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_CHAR          *param_namep;FORMAT="LINESPECIFIC"CS_INT           namelen;FORMAT="LINESPECIFIC"CS_INT           type;FORMAT="LINESPECIFIC"CS_INT           datalen;FORMAT="LINESPECIFIC"CS_BYTE          *datap;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.param_namep - A pointer to the name of the parameter. When registering the procedure, this parameter is mandatory. When invoking the procedure, this parameter can be null if the parameters are given in the same sequence they were defined when the procedure was registered. namelen - The length of the parameter name. If the param_namep is null terminated, namelen can be CS_NULLTERM. type - The datatype of the parameter. See the LINKEND="X87730"Types
 topics page, for a list of Open Server datatypes. datalen - The length of the parameter's data. This parameter is ignored for fixed length datatypes. Set datalen to 0 to indicate a null data value. If a client fails to provide parameter values, the Open Server application can set the length of a default value here. To define a parameter with no default value, set datalen to SRV_NODEFAULT. datap - A pointer to the data. If registering the procedure, the value in *datap is the default value for future invocations of the procedure. If invoking the procedure, set datap to NULL to accept the default value. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_regparam specifies a procedure parameter for an invocation of, or the registration of, a procedure. A call to MOREINFO="NONE"srv_reginit or MOREINFO="NONE"srv_regdefine must precede MOREINFO="NONE"srv_regparam. A registered procedure can have up to 255 parameters.When registering a procedure, use MOREINFO="NONE"srv_regparam to define the properties of the procedure's parameters and any default values. When invoking a procedure, call MOREINFO="NONE"srv_regparam for each parameter except those with acceptable default values. To indicate a null data value, set datalen to 0. To accept the default value for a parameter when executing a procedure, set datap to NULL. It is not necessary to callMOREINFO="NONE" srv_regparam for a parameter if a default value has been provided and that value is to be used for the execution of the procedure. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE  ex_srv_regparam PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC    *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local defines.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#define PARAMNAME (CS_CHAR *)"myparam" /* Parameter name. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#define PARAMDEFAULT (CS_INT)100REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**The default value for the parameter.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#define PARAMVAL (CS_INT)20 /* The value for this invocation. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_REGPARAMREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to describe a parameter for a registeredREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    procedure. REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   spp   A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED If we were able to describe the parameter.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL If an error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_regparam(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_RETCODE    result;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_INT        param;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Define the parameter with a default. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      param = PARAMDEFAULT;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      result = srv_regparam(spp, PARAMNAME, CS_NULLTERM,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"             CS_INT_TYPE, sizeof(CS_INT), (CS_BYTE *)&param);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (result == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Define the parameter with no default. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      result = srv_regparam(spp, PARAMNAME, CS_NULLTERM,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"               CS_INT_TYPE, SRV_NODEFAULT, (CS_BYTE *)NULL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (result == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Give a non-default value for the parameter. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      param = PARAMVAL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      result = srv_regparam(spp, PARAMNAME, CS_NULLTERM,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                CS_INT_TYPE, sizeof(CS_INT), (CS_BYTE *)&param);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return (result);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X14192"srv_regcreate
MOREINFO="NONE", LINKEND="X64731"srv_regdefine
MOREINFO="NONE", LINKEND="X59376"srv_reginit
MOREINFO="NONE", LINKEND="X27023"srv_regexec
MOREINFO="NONE", LINKEND="X87730"Types
ID="IN6512-35159207"srv_regparam
ID="IN6512-38162208"srv_regwatchID="X39840"srv_regwatch
Add a client thread to the notification list for a specified procedure. FORMAT="LINESPECIFIC"CS_RETCODE srv_regwatch(spp, proc_namep, namelen,FORMAT="LINESPECIFIC"                     options, infop)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_CHAR          *proc_namep;FORMAT="LINESPECIFIC"CS_INT           namelen;FORMAT="LINESPECIFIC"CS_INT           options;FORMAT="LINESPECIFIC"CS_INT           *infop;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure. proc_namep - The name of the procedure. namelen - The length of the procedure name. If the procedure name is null terminated, namelen can be CS_NULLTERM. options - A flag that specifies whether this is a one-time notification request, or a permanent request. The following table describes the legal values for options: TOCENTRY="1"LBL="Table 3-52: "Values for options (srv_regwatch)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="126*"COLNAME="C2" COLWIDTH="234*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NOTIFY_ONCECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"After the first notification, the client thread is 
removed from the notification list for the 
procedure. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NOTIFY_ALWAYSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The client thread will be notified each time the 
procedure executes until MOREINFO="NONE"srv_regnowatch is used to 
remove the thread from the procedure's 
notification list. infop - The following table describes the possible values returned in *infop if MOREINFO="NONE"srv_regwatch returns CS_FAIL: TOCENTRY="1"LBL="Table 3-53: "Values for infop (srv_regwatch)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="126*"COLNAME="C2" COLWIDTH="234*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_PNOTKNOWNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The procedure is not known to the Open Server 
application. The thread was not added to the 
notification list. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_PINVOPTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"An invalid options value was specified. The thread 
was not added to the notification list. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_PNOTCLIENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A non-client thread was specified. The thread was 
not added to the notification list. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_PNOTIFYEXISTSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The thread is already on the notification list for the 
specified procedure. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_regwatch adds a thread to the list of threads to notify when the specified procedure executes. The options flag specifies whether the thread is notified every time the procedure executes or just once-the next time the procedure executes. Use MOREINFO="NONE"srv_regnowatch to cancel a notification request. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include     <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT      ex_srv_regwatch PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC    *sproc,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR     *procedure_nameREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_REGWATCHREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   An example routine to add a client thread to theREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   notification list for a specified procedure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   sproc              A pointer to an internal thread controlREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**                      structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   procedure_name     The null terminated procedure name.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED            If the thread was added to the REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**                         notification list.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   SRV_I_PNOTKNOWN       The procedure is not known to the OpenREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**                         Server application.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   SRV_I_PNOTCLIENT      A non-client thread was specified.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   SRV_I_PNOTIFYEXISTS   The thread is already on theREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**                         notification list for the specifiedREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**                         procedure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL               The attempt to add the thread to the REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**                         notification failed due to otherREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**                         errors.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT      ex_srv_regwatch(sproc, procedure_name)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC    *sproc;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR     *procedure_name;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_INT    info;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if ( srv_regwatch(sproc, procedure_name, CS_NULLTERM, REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            SRV_NOTIFY_ALWAYS, &info) == CS_FAIL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            if ( (info == SRV_I_PNOTKNOWN)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            || (info == SRV_I_PNOTCLIENT)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            || (info == SRV_I_PNOTIFYEXISTS) )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                return(info);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           elseREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                return((CS_INT)CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return((CS_INT)CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X76628"srv_regnowatch
MOREINFO="NONE", LINKEND="X96451"srv_regwatchlist
ID="IN6612-41166216"srv_regwatchID="X96451"ID="IN6716-44170217"srv_regwatchlist
srv_regwatchlist
Return a list of all registered procedures for which a client thread has notification requests pending. FORMAT="LINESPECIFIC"CS_RETCODE srv_regwatchlist(spp, proclistp)FORMAT="LINESPECIFIC"SRV_PROC            *spp;FORMAT="LINESPECIFIC"SRV_PROCLIST        **proclistp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure. proclistp - A pointer to a pointer to a structure that contains the number of registered procedures and the names of each registered procedure. Open Server allocates the space for this structure. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_regwatchlist returns a list of registered procedures for which the client thread has requested notification. The proclistp parameter points to a SRV_PROCLIST structure that is allocated and initialized by Open Server. The SRV_PROCLIST structure looks like this: REMAP="COW10--CompOutWide10pt" FORMAT="LINESPECIFIC"typedef struct srv__proclist REMAP="COW10--CompOutWide10pt" FORMAT="LINESPECIFIC"{ REMAP="COW10--CompOutWide10pt" FORMAT="LINESPECIFIC"    CS_INT       num_procs;     /* The number of procedure names */     CS_CHAR      **proc_list;   /* The list of procedure names */ REMAP="COW10--CompOutWide10pt" FORMAT="LINESPECIFIC"} SRV_PROCLIST; An application deallocates the SRV_PROCLIST structure by calling MOREINFO="NONE"srv_reglistfree.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_regwatchlist PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC       *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_REGWATCHLISTREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to get a list of all registered proceduresREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    for which a client thread has notifications pending.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp      A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    The list returned successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_regwatchlist(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     SRV_PROCLIST  *listp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if (srv_regwatchlist(spp, &listp) == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      **   Process the information in the list and free the REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      **   memory allocated for the list.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      (CS_VOID)srv_reglistfree(spp, listp);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return (CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X25775"srv_reglistfree
ID="IN6716-47173225"srv_regwatchlistID="IN6813-50177226"srv_returnval
srv_returnval
Define a return value that is not associated with a remote procedure call.FORMAT="LINESPECIFIC"CS_RETCODE srv_returnval(spp, valuenamep, len, status, FORMAT="LINESPECIFIC"                  type, maxlen, datalen, valuep)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_CHAR          *valuenamep;FORMAT="LINESPECIFIC"CS_INT           len;FORMAT="LINESPECIFIC"CS_BYTE          status;FORMAT="LINESPECIFIC"CS_INT           type;FORMAT="LINESPECIFIC"CS_INT           maxlen;FORMAT="LINESPECIFIC"CS_INT           datalen;FORMAT="LINESPECIFIC"CS_VOID          *valuep;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.valuenamep - A pointer to the name of the return value. It can be (CS_CHAR *) NULL since a return value is not required to have a name. Its length is specified by the len parameter. The name of a return value can be up to SRV_MAXNAME characters long. len - The length in bytes of the name of the return value. If the name is null terminated, len can be set to CS_NULLTERM. status - The status of the return value. Currently, SRV_PARAMRETURN is the only legal status. type - The datatype of the return value that will be sent back to the Open Server client. The appropriate datatype must be specified even if the data is null. For a list of datatypes Open Server uses, see the LINKEND="X87730"Types
 topics page. maxlen - The maximum length of the return value in bytes. Open Server ignores it for fixed length datatypes that don't allow nulls, such as, CS_INT_TYPE, CS_MONEY_TYPE. For variable length datatypes, maxlen is the maximum length that the data can be. datalen - The actual length of the value. datalen is ignored for fixed length datatypes. datalen is the actual length, in bytes, of the return value. If datalen is 0, then a null value is returned. valuep - A pointer to the program variable that contains the return value. The return value data is copied into the private thread structure space at the time MOREINFO="NONE"srv_returnval is called. The return value or values are actually sent when MOREINFO="NONE"srv_senddone is called. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_returnval defines the type and value of a return value when a remote procedure call is not involved. Multiple return values can be sent to a client in a set of results. Call MOREINFO="NONE"srv_returnval once for each return value. The return values are sent back to the client in the order in which they are defined. They are not actually sent until MOREINFO="NONE"srv_senddone is called.  Use MOREINFO="NONE"srv_bind to return RPC parameter values.   To send a null value, set datalen to 0. When MOREINFO="NONE"srv_returnval is called, the data at location valuep is copied into the thread's own private data space; it's safe to reuse valuep. MOREINFO="NONE"srv_returnval will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_descfmt,MOREINFO="NONE" srv_bind, and MOREINFO="NONE"srv_xferdata routines together provide the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include
<ospublic.h> REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE  ex_srv_returnval PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC    *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR     *name,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT      namelen,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT      *valuepREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_RETURNVALREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to receive the return value for a non-RPCREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    using srv_returnval. This routine assumes that the valueREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    being returned is an integer.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp      A pointer to the internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    name     The name of the return value.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    namelen  The length in bytes of the name of the return               value.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    valuep   A pointer to a program variable that contains the               return value.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    The return value was successfully definedREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE  ex_srv_returnval(spp, name, namelen, valuep)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC    *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR     *name;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT      namelen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT      *valuep;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_INT  fixed_len;  /* Indicate fixed length type. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Initialization. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     fixed_len = 0;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Define an integer return value.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_returnval(spp, name, namelen, SRV_PARAMRETURN,           CS_INT_TYPE,fixed_len, fixed_len, (CS_VOID *)valuep)           !=CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X30757"srv_bind
MOREINFO="NONE", LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X38434"srv_paramset
MOREINFO="NONE", LINKEND="X15984"srv_senddone
MOREINFO="NONE", LINKEND="X52699"srv_xferdata
ID="IN6813-53180234"srv_returnvalID="X51516"ID="IN699-56184235"srv_rpcdb
srv_rpcdb
Return the database component of the current remote procedure name. FORMAT="LINESPECIFIC"CS_CHAR *srv_rpcdb(spp, lenp)FORMAT="LINESPECIFIC"SRV_PROC        *spp;FORMAT="LINESPECIFIC"CS_INT          *lenp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.lenp - A pointer to an int variable that will contain the length of the database name. lenp can be NULL, in which case the length of the database name isn't returned. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_rpcdb returns a CS_CHAR pointer to a null terminated string containing the database name component of the current remote procedure call name. MOREINFO="NONE"srv_rpcdb returns only the database name part of the RPC's designation and doesn't include anything else, such as optional specifiers for owner or RPC number. A fully qualified stored procedure name takes the form database.owner.rpcname;number. MOREINFO="NONE"srv_rpcdb returns only the database part of the object name. To get the other parts of the object name, if any, use MOREINFO="NONE"srv_rpcname, MOREINFO="NONE"srv_rpcowner, and MOREINFO="NONE"srv_rpcnumber. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include        <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_rpcdb PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         **dbp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          *lenpREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_RPCDBREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Example routine to return the database component name of the**   current remote procedure call name, using srv_rpcdb.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   spp   A pointer to an internal thread control structure.**   dbp   A return pointer to the null terminated database name.**   lenp  A return pointer to an integer containing the length**         of the database name.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED   Database component name returned successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL      An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_rpcdb(spp, dbp, lenp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC       *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR        **dbp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT         *lenp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Initialization.*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      *lenp = (CS_INT)0;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Retrieve the database component name. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if ((*dbp = (CS_CHAR *)srv_rpcdb(spp, lenp)) == (CS_CHAR           *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"A CS_CHAR pointer to the null terminated database component of the current RPC's name. If there is not a current RPC, (CS_CHAR *) NULL is returned, lenp is set to -1, and Open Server error is raises an informational error. See AlsoREMAP="BO--Body"LINKEND="X87885"srv_numparams
MOREINFO="NONE", LINKEND="X65526"srv_rpcname
MOREINFO="NONE", LINKEND="X54040"srv_rpcnumber
MOREINFO="NONE", LINKEND="X63324"srv_rpcoptions
MOREINFO="NONE", LINKEND="X41752"srv_rpcowner
ID="IN699-59187243"srv_rpcdbID="X65526"ID="IN7011-62191244"srv_rpcname
srv_rpcname
Return the name component of the current remote procedure call's designation. FORMAT="LINESPECIFIC"CS_CHAR *srv_rpcname(spp, lenp)FORMAT="LINESPECIFIC"SRV_PROC        *spp;FORMAT="LINESPECIFIC"CS_INT          *lenp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.lenp - A pointer to the buffer that will contain the length of the RPC name. lenp can be NULL, in which case the length of the RPC name is not returned. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_rpcname returns a CS_CHAR pointer to a null terminated string containing the name component of the current remote procedure call ("RPC") designation. MOREINFO="NONE"srv_rpcname returns only the RPC name and doesn't include anything else, such as optional specifiers for database, owner, or RPC number. For example, a fully qualified object name for an RPC in the SQL Server is database.owner.rpcname;number. MOREINFO="NONE"srv_rpcname returns only the rpcname part of the object name. To get the other parts of the object name, if any, use MOREINFO="NONE"srv_rpcdb, MOREINFO="NONE"srv_rpcowner, and MOREINFO="NONE"srv_rpcnumber. A user can determine whether an RPC exists by calling MOREINFO="NONE"srv_rpcname. If the RPC does not exist, Open Server will return a SRV_ENORPC error. A user can code his or her error handler to ignore this error if detected. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include        <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_rpcname PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *sp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *buf,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          buflen,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          *lenpREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_RPCNAMEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    This routine demonstrates how to use srv_rrpcname to obtain**    the name of the remote procedure call received by this**    thread.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   sp       A pointer to an internal thread control **            structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   buf      The address of the buffer in which the RPC **            name will be returned.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   buflen   The size of the name buffer.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   lenp     The address of an integer variable, which **            will be set to the length of the name **            returned.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** ReturnsREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED       If the RPC name is returned.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL          If an error occurred.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_rpcname(sp, buf, buflen, lenp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *sp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *buf;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          buflen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          *lenp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_CHAR         *np;    /* The procedure name pointer. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Initialization.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     np = (CS_CHAR *)NULL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     *lenp = (CS_INT)0;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Get the procedure name.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     np = srv_rpcname(sp, lenp);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if( np == (CS_CHAR *)NULL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           ** An error was already raised.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return CS_FAIL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Copy the RPC name to the output buffer.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     (void)strncpy(buf, np, buflen);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** All done.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return CS_SUCCEED;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"A CS_CHAR pointer to the null terminated name component of the current RPC's designation. If there is not a current RPC, (CS_CHAR *) NULL is returned and lenp is set to -1. See AlsoREMAP="BO--Body"LINKEND="X87885"srv_numparams
MOREINFO="NONE", LINKEND="X51516"srv_rpcdb
MOREINFO="NONE", LINKEND="X54040"srv_rpcnumber
MOREINFO="NONE", LINKEND="X63324"srv_rpcoptions
MOREINFO="NONE", LINKEND="X41752"srv_rpcowner
ID="IN7011-65194252"srv_rpcnameID="X54040"ID="IN7113-68198253"srv_rpcnumber
srv_rpcnumber
Return the number component of the current remote procedure call's designation. FORMAT="LINESPECIFIC"CS_INT srv_rpcnumber(spp)FORMAT="LINESPECIFIC"SRV_PROC  *spp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_rpcnumber returns the number component of the current remote procedure call ("RPC") designation. MOREINFO="NONE"srv_rpcnumber returns only the number component of the RPC's designation and doesn't include anything else, such as optional specifiers for owner or RPC name. A fully qualified object name for an RPC takes the form database.owner.rpcname;number. MOREINFO="NONE"srv_rpcnumber returns only the number part of the object name. To get the other parts of the object name, if any, use MOREINFO="NONE"srv_rpcname, MOREINFO="NONE"srv_rpcowner, and MOREINFO="NONE"srv_rpcdb. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     ex_srv_rpcnumber PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC   *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_RCPNUMBERREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to show hiw to get the number of the**    current RPC designation.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   spp   A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    The number component of the current RPC's designation. If**    the client used no number component when it invoked the**    RPC, 0 is returned. If there is not a current RPC, -1 is**    returned and Open Server raises an informational error. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     ex_srv_rpcnumber(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC   *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Check arguments. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if(spp == (SRV_PROC *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"             return(-1);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return((CS_INT)srv_rpcnumber(spp));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"The number component of the current RPC's designation. If the client used no number component when it invoked the RPC, 0 is returned. If there is not a current RPC, -1 is returned and Open Server raises an informational error. See AlsoREMAP="BO--Body"LINKEND="X87885"srv_numparams
MOREINFO="NONE", LINKEND="X51516"srv_rpcdb
MOREINFO="NONE", LINKEND="X65526"srv_rpcname
MOREINFO="NONE", LINKEND="X63324"srv_rpcoptions
MOREINFO="NONE", LINKEND="X41752"srv_rpcowner
ID="IN7113-71201261"srv_rpcnumberID="X63324"ID="IN7214-74205262"srv_rpcoptions
srv_rpcoptions
Return the run-time options for the current remote procedure call. FORMAT="LINESPECIFIC"CS_INT          srv_rpcoptions(spp)FORMAT="LINESPECIFIC"SRV_PROC        *spp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_rpcoptions returns a CS_INT value containing the run-time flags for the current remote procedure call. Currently, the only flag is SRV_PARAMRETURN. If SRV_PARAMRETURN is CS_TRUE, the RPC must be recompiled before it is executed. This is significant only if the RPC is a stored procedure executing on a SQL Server. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_rpcoptions PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_RPCOPTIONSREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to retrieve RPC run-time optionsREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   spp   A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEEDREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAILREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_rpcoptions(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   CS_INT        options;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   if ( (options = srv_rpcoptions(spp)) == 0 )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"         return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"A CS_INT containing the run-time flags for the current RPC.If there is not a current RPC, 0 is returned and an error message is raised. See AlsoREMAP="BO--Body"LINKEND="X87885"srv_numparams
MOREINFO="NONE", LINKEND="X51516"srv_rpcdb
MOREINFO="NONE", LINKEND="X65526"srv_rpcname
MOREINFO="NONE", LINKEND="X54040"srv_rpcnumber
MOREINFO="NONE", LINKEND="X41752"srv_rpcowner
ID="IN7214-77208270"srv_rpcoptionsID="X41752"ID="IN7312-80212271"srv_rpcowner
srv_rpcowner
Return the owner component of the current remote procedure call's designation. FORMAT="LINESPECIFIC"CS_CHAR *srv_rpcowner(spp, lenp)FORMAT="LINESPECIFIC"SRV_PROC      *spp;FORMAT="LINESPECIFIC"CS_INT        *lenp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.lenp - A pointer to a buffer that will contain the length of the owner name. lenp can be NULL, in which case the length of the database owner is not returned. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_rpcowner returns a CS_CHAR pointer to a null terminated string containing the owner component of the current remote procedure call ("RPC") designation. MOREINFO="NONE"srv_rpcowner returns only the owner component of the RPC's designation and doesn't include anything else, such as optional specifiers for database or RPC number. A fully qualified object name for an RPC takes the form database.owner.rpcname;number. MOREINFO="NONE"srv_rpcowner returns only the owner part of the object name. To get the other parts of the object name, if any, use MOREINFO="NONE"srv_rpcname, MOREINFO="NONE"srv_rpcdb, and MOREINFO="NONE"srv_rpcnumber. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"extern CS_RETCODE    ex_srv_rpcowner PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID              *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR        *ownerpREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_RPCOWNERREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Determine the owner component of an RPC destination.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   spp     A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   ownerp  A pointer to the buffer to which Open Server **           returns the owner component.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED      Owner component returned successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL         An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_rpcowner(spp, ownerp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC       *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR        *ownerp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_INT    len;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ownerp = srv_rpcowner(spp, &len);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if(len == (CS_INT)(-1))REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"A CS_CHAR pointer to the null terminated owner component of the current RPC's designation. If there is not a current RPC, (CS_CHAR *) NULL is returned, lenp is set to -1, and an informational Open Server error is raised. See AlsoREMAP="BO--Body"LINKEND="X87885"srv_numparams
MOREINFO="NONE", LINKEND="X51516"srv_rpcdb
MOREINFO="NONE", LINKEND="X65526"srv_rpcname
MOREINFO="NONE", LINKEND="X54040"srv_rpcnumber
MOREINFO="NONE", LINKEND="X63324"srv_rpcoptions
ID="IN7312-83215279"srv_rpcownerID="IN7413-86219280"srv_rpcparams
srv_rpcparams
Return the number of parameters for the current remote procedure call. FORMAT="LINESPECIFIC"CS_INT srv_rpcparams(spp)FORMAT="LINESPECIFIC"SRV_PROC      *spp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_rpcparams returns the number of parameters in the current remote procedure call ("RPC"). Remote procedure call parameters must be passed either by name or by position (unnamed). If the RPC is invoked with some parameters passed by name and some parameters passed positionally, an error will result. The SRV_RPC handler will still be called, but MOREINFO="NONE"srv_rpcparams will return 0. MOREINFO="NONE"srv_rpcparams will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_numparams routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include      <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_rpcparams PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_RPCPARAMSREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to get the number of parameters for**    the current remote procedure. REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp    A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED      If we were able to get the number of**                    parameters.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL         If an error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_rpcparams(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_INT    paramcount;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      paramcount = srv_rpcparams(spp);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (paramcount == -1)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return (CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"The number of parameters in the RPC. If the RPC has no parameters, or if there is not a current RPC, -1 is returned and an informational error message is raised. See AlsoREMAP="BO--Body"LINKEND="X87885"srv_numparams
MOREINFO="NONE", LINKEND="X65668"srv_paramname
MOREINFO="NONE", LINKEND="X84992"srv_paramnumber
MOREINFO="NONE", LINKEND="X65526"srv_rpcname
MOREINFO="NONE", LINKEND="X63324"srv_rpcoptions
ID="IN7413-89222288"srv_rpcparamsID="X48116"ID="IN757-92226289"srv_run
srv_run
Start up the Open Server application. FORMAT="LINESPECIFIC"CS_RETCODE srv_run(ssp)FORMAT="LINESPECIFIC"SRV_SERVER     *ssp;ParametersREMAP="RI--RefIndent"ssp - A pointer to the Open Server control structure. This is an optional argument.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_run starts, or restarts, the Open Server application. MOREINFO="NONE"srv_run returns when the server is stopped by a SRV_STOP event. Once started, the server listens for a client request, calls the function defined to handle the request, and then continues listening for further requests. If a server has stopped, it must be re-initialized using MOREINFO="NONE"srv_init before it is restarted. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include     <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE       ex_srv_run PROTOTYPE((CS_VOID));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_RUNREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   An example routine to start up an Open Server using srv_run.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   None.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    SRV_STOP    If the server is stopped.  REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL     If the server can't be brought up.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE ex_srv_run()REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(srv_run((SRV_SERVER *)NULL));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED for a stopped server. It returns CS_FAIL if an error was detected while starting the Open Server application. If MOREINFO="NONE"srv_run returns CS_FAIL, the application must call MOREINFO="NONE"srv_init before calling MOREINFO="NONE"srv_run again.In pre-10.0 Open Server releases, MOREINFO="NONE"srv_run returned SRV_STOP. If your application expects this return value, you must alter your code accordingly. See  the LINKEND="X16149"Migration from 2.0 to 10.0
 topics page, for other code changes that you may need to make your existing application run in a 10.0 environment.See AlsoREMAP="BO--Body"LINKEND="X24609"srv_init
MOREINFO="NONE", LINKEND="X84669"srv_props
MOREINFO="NONE", LINKEND="X78566"Events
ID="IN757-95229297"srv_runID="X24148"ID="IN7622-98233298"srv_select (UNIX only)
srv_select (UNIX only)
Check to see if a file descriptor is ready for a specified I/O operation. FORMAT="LINESPECIFIC"CS_INT srv_select(nfds, readmaskp, writemaskp, FORMAT="LINESPECIFIC"                 exceptmaskp, waitflag)FORMAT="LINESPECIFIC"CS_INT                nfds;FORMAT="LINESPECIFIC"SRV_MASK_ARRAY        *readmaskp;FORMAT="LINESPECIFIC"SRV_MASK_ARRAY        *writemaskp;FORMAT="LINESPECIFIC"SRV_MASK_ARRAY        *exceptmaskp;FORMAT="LINESPECIFIC"CS_INT                waitflag;ParametersREMAP="RI--RefIndent"nfds - The highest number file descriptor to check. readmaskp - A pointer to a SRV_MASK_ARRAY structure initialized with the mask of file descriptors to check for read availability. writemaskp - A pointer to a SRV_MASK_ARRAY structure initialized with the mask of file descriptors to check for write availability. exceptmaskp - A pointer to a SRV_MASK_ARRAY structure initialized with the mask of file descriptors to check for exceptions. waitflag - A CS_INT that indicates whether the thread should be suspended until any file descriptor is available for the desired operation. See below, MOREINFO="NONE"Comments, for a description of the legal values for waitflag. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_select is available only on BSD-style UNIX platforms. Use MOREINFO="NONE"srv_select when you want to know if a network I/O operation can be performed on a file descriptor without requesting the I/O. Open Server will include the designated file descriptor in the global mask that it uses when it checks for file descriptor availability. A SRV_MASK_ARRAY is defined as follows:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"#define SRV_MASK_SIZE            (CS_INT)40#define SRV_MAXMASK_LENGTH(CS_INT)(SRV_MASK_SIZE*CS_BITS_PER_LONG)     typedef struct        srv_mask_array{     long      mask_bits[SRV_MASK_SIZE];} SRV_MASK_ARRAY;REMAP="UN--Under"SRV_MASK_SIZE indicates the number of elements in the SRV_MASK_ARRAY and SRV_MAXMASK_LENGTH indicates the maximum number of file descriptors that can be represented in the SRV_MASK_ARRAY.An Open Server application that uses external file descriptors must close them in an orderly fashion. An application thread must wait for a pending MOREINFO="NONE"srv_select call to complete before closing an external file descriptor. I f not, Open Server will exit. The following table summarizes the legal values for waitflag: TOCENTRY="1"LBL="Table 3-54: "Values for waitflag (srv_select)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="177*"COLNAME="C2" COLWIDTH="163*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_M_WAITCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The thread is suspended and will 
wake up when any file descriptor 
represented in the masks is 
available for the specified 
operation. The return status 
indicates whether any file 
descriptors are available for the 
desired operations.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_M_NOWAITCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The routine will return 
immediately after the next 
network check. The return status 
indicates whether any file 
descriptors are available for the 
desired operations.An application can use MOREINFO="NONE"srv_select to poll the file descriptor and return immediately or not return until one of the file descriptors is ready.MOREINFO="NONE"srv_select cannot be used in a SRV_START or SRV_ATTENTION handler. REMAP="BO--Body"ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*** Local Prototype.*/CS_RETCODE     ex_srv_select PROTOTYPE((CS_INT         readfd));/* ** EX_SRV_SELECT****   Example routine to illustrate the use of srv_select.**** Arguments:**   readfd  -  fd to be checked if it is ready for a read **                operation.**** Returns:**  CS_SUCCEED      If readfd is ready for a read operation.**  CS_FAIL         If readfd is not ready for a read operation.*/CS_RETCODE      ex_srv_select(readfd)CS_INT          readfd;{      SRV_MASK_ARRAY       readmask;      CS_BOOL              ready;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* Initialization. */     (CS_VOID)srv_mask(CS_ZERO, &readmask, (CS_INT)0, (CS_BOOL             *)NULL);      ready = CS_FALSE;      /* Set readfd in the mask. */      (CS_VOID)srv_mask(CS_SET, &readmask, readfd, (CS_BOOL            *)NULL);      /*       ** Check whether the descriptor is ready for a read      ** operation. If it is not, return.      */      if (srv_select(readfd+1, &readmask, (SRV_MASK_ARRAY *)NULL,           (SRV_MASK_ARRAY *)NULL, SRV_M_NOWAIT) <= 0 )           return (CS_FAIL);      /*      ** A file descriptor is ready for a read operation.      */      (CS_VOID)srv_mask(CS_GET, &readmask, readfd, &ready);      return ((ready) ? CS_SUCCEED : CS_FAIL);}ReturnsREMAP="BO--Body"The total number of file descriptors that are ready for any of the indicated operations. If an error occurs, -1 is returned. See AlsoREMAP="BO--Body"LINKEND="X43703"srv_mask
ID="IN7622-101236306"srv_select (UNIX only)ID="X43143"ID="IN7713-104240307"srv_send_text
srv_send_text
Send a text or image data stream to a client, in chunks. FORMAT="LINESPECIFIC"CS_RETCODE srv_send_text(spp, bp, buflen)FORMAT="LINESPECIFIC"SRV_PROC        *spp;FORMAT="LINESPECIFIC"CS_BYTE         *bp;FORMAT="LINESPECIFIC"CS_INT          buflen;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.bp - A pointer to a buffer containing the data to send to the client. This determines the size of a section.buflen - The size of the *bp buffer.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_send_text is used to send a single column of text or image data to a client.The Open Server application must always call MOREINFO="NONE"srv_text_info prior to the first call to MOREINFO="NONE"srv_send_text for the data stream, in order to set the total length of the data to be sent. The application then calls MOREINFO="NONE"srv_send_text to send a chunk. MOREINFO="NONE"srv_send_text is called as many times as there are chunks. The item being sent to the client must have previously been described using MOREINFO="NONE"srv_descfmt.An Open Server application can also write text and image data to a client using MOREINFO="NONE"srv_bind and MOREINFO="NONE"srv_xferdata. MOREINFO="NONE"srv_send_text allows the application to send the data in chunks, whereas the standard MOREINFO="NONE"srv_bind/MOREINFO="NONE"srv_xferdata method requires that all the data in the column be sent at once.   A column sent with MOREINFO="NONE"srv_send_text must be of type text or image.Open Server treats text and image data streams identically except for character set conversion, which is only performed on text data.An Open Server application can only use MOREINFO="NONE"srv_send_text to send a row if that row contains a single column and that column contains text or image data.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ctpublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE ex_srv_send_text PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC    *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_COMMAND  *cmdREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SEND_TEXTREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Example routine to demonstrate how to write text to a client**   using srv_send_text. This routine will send all the text**   read from a server back to the client.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   spp   A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   cmd   The command handle for the command that is returning**         text data.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED   Result set sent successfully to client.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL      An error was detected. REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_send_text(spp, cmd)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC       *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_COMMAND     *cmd;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   CS_BOOL     ok;            /* Error control flag.*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   CS_INT      ret;           /* ct_fetch return value.*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   CS_INT      len_read;      /* Amount of data read.*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   CS_BYTE     data[1024];    /* Buffer for text data.*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   /* Initialization. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   ok = CS_TRUE;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   /* Read the text from the server. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   while ((ret = ct_get_data(cmd, 1, data, CS_SIZEOF(data),         &len_read))REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"         == CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"         /* Write text to client a chunck at a time */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"         if (srv_send_text(spp, data, len_read) != CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"         {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                ok = CS_FALSE;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                break;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"         }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   switch(ret)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   case CS_SUCCEED:    /* The routine completed successfully. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   case CS_END_ITEM:   /* Reached the end of this item's value. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   case CS_END_DATA:   /* Reached the end of this item's value. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        break;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   case CS_FAIL:       /* The routine failed.  */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   case CS_CANCELED:  /* The get data operation was cancelled. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   case CS_PENDING:    /* Asynchronous network I/O is in effect. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   case CS_BUSY:       /* An asynchronous operation is pending. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   default:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          ok = CS_FALSE;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"   return (ok ? CS_SUCCEED : CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the text or image data was successfully written to a client.REMAP="BO--Body"CS_FAIL if an error was detected.See AlsoREMAP="BO--Body"LINKEND="X30757"srv_bind
MOREINFO="NONE", srv_bulk_type, LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X23785"srv_get_text
MOREINFO="NONE", LINKEND="X13415"srv_text_info
MOREINFO="NONE", LINKEND="X52699"srv_xferdata
MOREINFO="NONE",LINKEND="X12233"Text and Image
ID="IN7713-107243315"srv_send_textID="X15984"ID="IN7812-110247316"srv_senddone
srv_senddone
Send a results completion message or flush results to a client. FORMAT="LINESPECIFIC"CS_RETCODE srv_senddone(spp, status, transtate, count)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_INT           status;FORMAT="LINESPECIFIC"CS_INT           transtate;FORMAT="LINESPECIFIC"CS_INT           count;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.status - A 2-byte bit mask composed of one or more flags OR'd together. The following table describes each flag: TOCENTRY="1"LBL="Table 3-55: "Values for status (srv_senddone)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="117*"COLNAME="C2" COLWIDTH="243*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"StatusCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Description VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DONE_FINALCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The current set of results is the final set of results. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DONE_MORECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The current set of results is not the final set of 
results. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DONE_COUNTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The count parameter contains a valid count. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DONE_ERRORCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The current client command got an error. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DONE_FLUSHCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The current result set will be sent to the client 
without waiting for a full packet.transtate - The current state of the transaction. The following table describes the legal values for transtate:TOCENTRY="1"LBL="Table 3-56: "Values for transtate (srv_senddone)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="182*"COLNAME="C2" COLWIDTH="168*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Transaction StateCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRAN_UNDEFINEDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Not currently in a transaction.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRAN_COMPLETEDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The current transaction completed 
successfully.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRAN_FAILCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The current transaction failed.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRAN_IN_PROGRESSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Currently in a transaction.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRAN_STMT_FAILCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The current transaction statement 
failed.count - A 4-byte field containing a count for the current set of results. The count is valid if the SRV_DONE_COUNT flag is set in the status field. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_senddone sends a message to the client that the current set of results is complete. A client request can cause the server to execute a number of commands and to return a number of results sets. For each set of results, a completion message must be returned to the client with MOREINFO="NONE"srv_senddone. If the current results are not the last set of results for the client command batch, the Open Server must set the status mask's SRV_DONE_MORE field. Otherwise, the Open Server application must set the status field to SRV_DONE_FINAL to indicate that there are no more results for the current command batch. The count field indicates how many rows were affected by a particular command. If count actually contains a count, the SRV_DONE_COUNT bit should be set in the status field. This enables the client to distinguish between an actual count of 0 and an unused count field. If the SRV_CONNECT handler rejects the client login, the application must set the SRV_DONE_ERROR flag in the status parameter when MOREINFO="NONE"srv_senddone is called, and must call MOREINFO="NONE"srv_sendinfo must be called with the msgno parameter set to SRV_MSGLOGINFAIL. The SRV_CONNECT handler must then send a DONE packet to the client with MOREINFO="NONE"srv_senddone. In any case, MOREINFO="NONE"srv_senddone must be called only once before the SRV_CONNECT handler returns and the SRV_DONE_FINAL status flag must be set. When a write is in progress and the network buffer fills up, Open Server flushes its contents. Issuing MOREINFO="NONE"srv_senddone with status set to SRV_DONE_FINAL or SRV_DONE_FLUSH causes a flush of the network buffer, regardless of how full it is. SRV_DONE_FLUSH can be set with or without SRV_DONE_MORE.Setting status to SRV_DONE_FLUSH allows an application to flush to a client results that have accumulated over a long period of time. An application cannot set the status argument to SRV_DONE_FLUSH inside a SRV_CONNECTION error handler.Open Server does not provide any transaction management. It is the responsibility of the Open Server application to use the transtate argument as required to notify a client of the current transaction state.The transtate argument replaces the info argument in the Open Server 2.0 version of srv_senddone.This change will cause run-time errors in existing applications if the value of info in the existing application is not 0. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include     <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_senddone PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Constants and data definitions.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#define    NUMROWS         3  REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#define    MAXROWDATA      6REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_STATIC CS_CHAR  *row_data[NUMROWS] = {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                    "Larry",REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                    "Curly",REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                    "Moe"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                    };REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SENDDONEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine illustrating the use of srv_senddone. This**    routine will send a set of results to the client**    application, and then send the results completion message.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp     A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    Results set sent successfully to client.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_senddone(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_DATAFMT      fmt;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_INT          row_len;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_INT          idx;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Describe the format of the row data, with the single      ** dummy column.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      srv_bzero((CS_VOID *)&fmt, (CS_INT)sizeof(fmt));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      fmt.datatype = CS_CHAR_TYPE;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      fmt.maxlength = MAXROWDATA;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_descfmt(spp, (CS_INT)CS_SET, (CS_INT)SRV_ROWDATA,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                (CS_INT)1, &fmt) != CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"             (CS_VOID)srv_senddone(spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                (CS_INT)(SRV_DONE_FINAL | SRV_DONE_ERROR),REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                (CS_INT)CS_TRAN_FAIL, (CS_INT)0);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"             return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"       }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      for (idx = 0; idx < NUMROWS; ++idx)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           ** Bind the row_data array element. REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           row_len = (CS_INT)strlen(row_data[idx]);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           if (srv_bind(spp, (CS_INT)CS_SET, (CS_INT)SRV_ROWDATA,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"               (CS_INT)1, &fmt, (CS_BYTE *)(row_data[idx]),               &row_len, (CS_SMALLINT *)NULL) != CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                /* Communicate failure, and number of rows sent.                  */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                (CS_VOID)srv_senddone(spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                     (CS_INT)(SRV_DONE_FINAL |REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                              SRV_DONE_ERROR | SRV_DONE_COUNT),REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                     (CS_INT)CS_TRAN_FAIL, (CS_INT)idx);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           ** Transfer the row data.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           if (srv_xferdata(spp, (CS_INT)CS_SET, SRV_ROWDATA)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                                 != CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                /* Communicate failure, and number of rows sent.                 */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                (CS_VOID)srv_senddone(spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                    (CS_INT)(SRV_DONE_FINAL |REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                        SRV_DONE_ERROR | SRV_DONE_COUNT),REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                    (CS_INT)CS_TRAN_FAIL, (CS_INT)idx);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Send a status value. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_sendstatus(spp, (CS_INT)0) != CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            /* Communicate failure, and number of rows sent. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            (CS_VOID)srv_senddone(spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                (CS_INT)(SRV_DONE_FINAL |REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                    SRV_DONE_ERROR | SRV_DONE_COUNT),REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                (CS_INT)CS_TRAN_FAIL, (CS_INT)NUMROWS);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Send the final DONE message, with the row count. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_senddone(spp, (CS_INT)(SRV_DONE_FINAL |             SRV_DONE_COUNT),REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                (CS_INT)CS_TRAN_COMPLETED,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                (CS_INT)NUMROWS) != CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            /* Communicate failure, and number of rows sent. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            (CS_VOID)srv_senddone(spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                (CS_INT)(SRV_DONE_FINAL |REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                        SRV_DONE_ERROR | SRV_DONE_COUNT),REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                (CS_INT)CS_TRAN_FAIL, (CS_INT)NUMROWS);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X30757"srv_bind
MOREINFO="NONE", LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X42299"srv_sendstatus
MOREINFO="NONE", LINKEND="X52699"srv_xferdata
ID="IN7812-113250324"srv_senddoneID="X37615"ID="IN7912-116254325"srv_sendinfo
srv_sendinfo
Send error messages to the client. FORMAT="LINESPECIFIC"CS_RETCODE srv_sendinfo(spp, errmsgp, transtate)FORMAT="LINESPECIFIC"SRV_PROC           *spp;FORMAT="LINESPECIFIC"CS_SERVERMSG       *errmsgp;FORMAT="LINESPECIFIC"CS_INT             transtate;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.errmsgp - A pointer to the CS_SERVERMSG structure containing the error message information to be sent to the client. See  the LINKEND="X99328"CS_SERVERMSG Structure
 topics page. transtate - The current state of the transaction. The following table describes the legal values for transtate:TOCENTRY="1"LBL="Table 3-57: "Values for transtate (srv_sendinfo)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="182*"COLNAME="C2" COLWIDTH="168*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Transaction StateCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRAN_UNDEFINEDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Not currently in a transaction.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRAN_COMPLETEDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The current transaction completed 
successfully.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRAN_FAILCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The current transaction failed.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRAN_IN_PROGRESSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Currently in a transaction.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TRAN_STMT_FAILCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The current transaction statement 
failed.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_sendinfo sends error messages to the client. It must be called once for each message sent. An application can call MOREINFO="NONE"srv_sendinfo before or after it sends result rows. However, an application cannot call MOREINFO="NONE"srv_sendinfo between calls to MOREINFO="NONE"srv_descfmt or between a call to MOREINFO="NONE"srv_descfmt and a call to MOREINFO="NONE"srv_xferdata.If an Open Server application wants to send parameter data pertaining to an error message, it must set the status field of the CS_SERVERMSG structure to CS_HASEED. The application must describe, bind and send the error parameters immediately after calling MOREINFO="NONE"srv_sendinfo, before sending other results and before a call to MOREINFO="NONE"srv_senddone. The application must invoke MOREINFO="NONE"srv_descfmt, MOREINFO="NONE"srv_bind and srv_xferdata with a type argument of SRV_ERRORDATA.If an application calls MOREINFO="NONE"srv_sendinfo with the status field of the CS_SERVERMSG structure set to CS_HASEED but fails to send error parameters, a fatal process error is raised when the application calls MOREINFO="NONE"srv_senddone.When an application calls MOREINFO="NONE"srv_sendinfo with the status field of the CS_SERVERMSG structure set to CS_HASEED, Open Server will verify that the CS_RES_NOEED response capability is not set. If it is set, Open Server will raise an error. Any subsequent calls to MOREINFO="NONE"srv_descfmt to describe error parameters will also provoke an error.For more information on sending error messages to clients, see  the LINKEND="X83099"Client Command Errors
 topics page.For more information on extended error data, see  the LINKEND="X83099"Client Command Errors
 topics page.For more information on the MOREINFO="NONE"CS_SERVERMSG structure, see page 2-34, its topics page.MOREINFO="NONE"srv_sendinfo replaces the old MOREINFO="NONE"srv_sendmsg routine.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_sendinfo  PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *sp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *msg,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          msglen,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          msgnumREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SENDINFOREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    This routine demonstrates how to use srv_sendinfo to send**    an error message to a client.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**         sp       A pointer to an internal thread control**                  structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**         msg      The message text to send.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**         msglen   The length of the message text to send.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**         msgnum   The message number to send.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** ReturnsREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**         CS_SUCCEED     If the message is sent.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**         CS_FAIL        If an error occurred.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_sendinfo(sp, msg, msglen, msgnum)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *sp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *msg;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          msglen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          msgnum;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_SERVERMSG    mrec;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Initialization.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      srv_bzero(&mrec, sizeof(CS_SERVERMSG));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** First, determine if the message string will fit      ** in the message structure. If not, truncate it.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if( msglen > CS_MAX_MSG )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          msglen = CS_MAX_MSG;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Now copy the message string over.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      srv_bmove(msg, mrec.text, msglen);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      mrec.textlen = msglen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Set the message number we want to send.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      mrec.msgnumber = msgnum;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Now we're ready to send the message.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if( srv_sendinfo(sp, &mrec, CS_TRAN_UNDEFINED) == CS_FAIL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            ** An error was already raised.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            return CS_FAIL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** All done.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return CS_SUCCEED;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if a message is sent successfully.REMAP="BO--Body"CS_FAIL if an error occurred while sending the message.See AlsoREMAP="BO--Body"LINKEND="X30757"srv_bind
MOREINFO="NONE", LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X15984"srv_senddone
MOREINFO="NONE", LINKEND="X52699"srv_xferdata
MOREINFO="NONE", LINKEND="X83099"Client Command Errors
ID="IN7912-119257333"srv_sendinfoID="IN8011-122261334"srv_sendmsg
srv_sendmsg
Send a message to the client. FORMAT="LINESPECIFIC"CS_RETCODE srv_sendmsg(spp, msgtype, msgnum, severity,FORMAT="LINESPECIFIC"                state, rpcnamep, rpcnamelen, linenum,FORMAT="LINESPECIFIC"                messagep, msglen)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_INT           msgtype;FORMAT="LINESPECIFIC"CS_INT           msgnum;FORMAT="LINESPECIFIC"CS_INT           severity;FORMAT="LINESPECIFIC"CS_INT           state;FORMAT="LINESPECIFIC"CS_CHAR          *rpcnamep;FORMAT="LINESPECIFIC"CS_INT           rpcnamelen;FORMAT="LINESPECIFIC"CS_INT           linenum;FORMAT="LINESPECIFIC"CS_CHAR          *messagep;FORMAT="LINESPECIFIC"CS_INT           msglen;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.msgtype - Either SRV_MSG_INFO or SRV_MSG_ERROR, depending on whether the server is sending an informational or an error message. msgnum - The 4-byte message number. severity - The severity of the error. state - The current message's error state number. These numbers provide information about the context of the error. rpcnamep - A pointer to the remote procedure name to which the message applies. If there is no applicable RPC, rpcnamep should be (CS_CHAR *) NULL. rpcnamelen - The length, in bytes, of the remote procedure name. If the name is null terminated, set rpcnamelen to CS_NULLTERM. linenum - The line number of the language command batch to which the message applies. Command batches start with line 1. linenum should be 0 if it does not apply to the message. messagep - A pointer to the actual text of the message. msglen - The length, in bytes, of message. If message is null terminated, msglen can be set to CS_NULLTERM. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_sendmsg sends error or informational messages to the client. It is called once for each message sent. Messages can be sent in any order, before or after result rows have been sent with MOREINFO="NONE"srv_sendrow. Messages cannot, however, be sent between a call to MOREINFO="NONE"srv_describe and a call to MOREINFO="NONE"srv_sendrow. All messages must be sent to the client before the completion status is sent with MOREINFO="NONE"srv_senddone. MOREINFO="NONE"srv_sendmsg will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_sendinfo routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_sendmsg      PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          msgtype,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          msgnum,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          severity,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          state,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *rpcnamep,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          rcpnamelen,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          linenum,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *msgp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          msglenREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_sendmsgREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Send a message to the client.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp           A pointer to an internal thread control**                  structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    msgtype       Either SRV_MSG_INFO or SRV_MSG_ERROR.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    msgnum        Message number.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    severity      Severity of error.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    state         The current message's error state number.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    rpcnamep      Pointer to the remote procedure name to which**                  the message applies.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    rpcnamelen    The length of the rpcname.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    linenum       The line number of the language command batch**                  to which the message applies.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    msgp          A pointer to the actual text of the message.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    msglen        The length in bytes of the message text.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** ReturnsREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED  REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL    REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODEex_srv_sendmsg(spp,msgtype,msgnum,severity,state,                           rpcnamep,rpcnamelen,linenum,msgp,                           msglen)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC    *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT      msgtype;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT      msgnum;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     severity;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     state;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR    *rpcnamep;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     rpcnamelen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     linenum;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR    *msgp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     msglen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Check arguments. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if(spp == (SRV_PROC *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(srv_sendmsg(spp,msgtype,msgnum,severity,state,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                  rpcnamep,rpcnamelen,linenum,msgp,msglen));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body" LINKEND="X15984"srv_senddone
MOREINFO="NONE", LINKEND="X37615"srv_sendinfo
MOREINFO="NONE", LINKEND="X24762"Errors
ID="IN8011-125264342"srv_sendmsgID="X30039"ID="IN8116-128268343"srv_sendpassthru
srv_sendpassthru
Send a protocol packet to a client. FORMAT="LINESPECIFIC"CS_RETCODE srv_sendpassthru(spp, send_bufp, infop)FORMAT="LINESPECIFIC"SRV_PROC        *spp;FORMAT="LINESPECIFIC"CS_BYTE         *send_bufp;FORMAT="LINESPECIFIC"CS_INT          *infop;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.send_bufp - A pointer to a buffer that contains the protocol packet.infop - A pointer to a CS_INT that is set to SRV_I_UNKNOWN if MOREINFO="NONE"srv_sendpassthru returns CS_FAIL. The following table describes the possible values returned in *infop if the routine returns CS_SUCCEED: TOCENTRY="1"LBL="Table 3-58: "CS_SUCCEED Values (srv_sendpassthru)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="153*"COLNAME="C2" COLWIDTH="207*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Description VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_PASSTHRU_MORECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The protocol packet was sent successfully 
and it is not the end of message packet.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_PASSTHRU_EOMCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The end of message protocol packet was 
sent successfully. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_sendpassthru sends a protocol packet received from a client program or SQL Server without interpreting its contents.   MOREINFO="NONE"srv_sendpassthru performs byte ordering on protocol header fields. Once called, the thread that called it is in pass-through mode. Pass-through mode ends when the SRV_PASSTHRU_EOM is returned. No other Server-Library routines can be called while the event handler is in pass-through mode. To use pass-through mode, the SRV_CONNECT handler for the client must allow the client and remote server to negotiate the protocol format by calling MOREINFO="NONE"srv_getloginfo, MOREINFO="NONE"ct_setloginfo, ct_getloginfo, and MOREINFO="NONE"srv_setloginfo. This allows clients and remote servers running on dissimilar platforms to perform any necessary data conversions. MOREINFO="NONE"srv_sendpassthru can be used in all event handlers except SRV_CONNECT, SRV_DISCONNECT, SRV_START, SRV_STOP, SRV_URGDISCONNECT, and SRV_ATTENTION. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <stdio.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_sendpassthru PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SENDPASSTHRUREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  Example routine to send a protocol packet to a client.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  spp  A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_SUCCEED REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_FAILREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_sendpassthru(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_BYTE    sendbuf[20];REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_INT     info;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      strcpy(sendbuf, "Here's what to send");REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_sendpassthru(spp, sendbuf, &info) == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      elseREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            if (info == SRV_I_PASSTHRU_MORE)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                printf("more to come...\n");REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            else if (info == SRV_I_PASSTHRU_EOM)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                printf("That's all.\n");REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            elseREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                printf("Unknown flag returned.\n");REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X37685"srv_getloginfo
MOREINFO="NONE", LINKEND="X69557"srv_recvpassthru
MOREINFO="NONE", LINKEND="X72527"srv_setloginfo
ID="IN8116-131271351"srv_sendpassthruID="X82466"ID="IN8211-134275352"srv_sendrow
srv_sendrow
Send a row to a client. FORMAT="LINESPECIFIC"CS_RETCODE srv_sendrow(spp)FORMAT="LINESPECIFIC"SRV_PROC      *spp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_sendrow sends a row of data to an Open Server client connection. Each column of the row must first be defined with MOREINFO="NONE"srv_describe. MOREINFO="NONE"srv_sendrow must be called once for each row to be sent to the client. All rows must be sent to the client before a DONE is sent with MOREINFO="NONE"srv_senddone. Sending a row that hasn't had all its columns defined via MOREINFO="NONE"srv_describe causes Open Server to raise an informational error and return CS_FAIL to the client. The row is not sent in this case. When you call MOREINFO="NONE"srv_sendrow, the run-time system can suspend the thread to allow other server processes to execute. MOREINFO="NONE"srv_sendrow will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_xferdata routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include      <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"extern CS_RETCODE        ex_srv_sendrow PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID         *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SENDROWREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Send a row to a client.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp    A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED      Row was sent successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL         An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_sendrow(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if(srv_sendrow(spp) == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"               return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X30757"srv_bind
MOREINFO="NONE", LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X59720"srv_describe
MOREINFO="NONE", LINKEND="X15984"srv_senddone
MOREINFO="NONE", LINKEND="X52699"srv_xferdata
ID="IN8211-137278360"srv_sendrowID="X42299"ID="IN8314-140282361"srv_sendstatus
srv_sendstatus
Send a status value to a client. FORMAT="LINESPECIFIC"CS_RETCODE srv_sendstatus(spp, value)FORMAT="LINESPECIFIC"SRV_PROC        *spp;FORMAT="LINESPECIFIC"CS_INT          value;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.value - The status of the request. By convention, 0 means the request completed normally. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_sendstatus sends a return status value to the client in response to a client request. When a request is received, the programmer-installed event handler routine is called to service it. Part of the response to a request can be to return a status value. The status value sent by MOREINFO="NONE"srv_sendstatus is both optional and application-specific. It is not related to the MOREINFO="NONE"srv_senddone status parameter. A status value can be sent after all rows, if any, have been sent to the client with MOREINFO="NONE"srv_sendrow and before the completion status is sent with MOREINFO="NONE"srv_senddone. A status value cannot be sent between a call to MOREINFO="NONE"srv_describe and a call to MOREINFO="NONE"srv_sendrow.Only one status value can be sent for each set of results. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE        ex_srv_sendstatus PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC          *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SENDSTATUSREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  Example routine to send a status value to a client.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp      A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_SUCCEED if we were able to send the status.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_FAIL if an error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE    ex_srv_sendstatus(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC      *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_RETCODE      result;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Send an OK status.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      result = srv_sendstatus(spp, (CS_INT)0);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return (result);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X15984"srv_senddone
ID="IN8314-143285369"srv_sendstatusID="X65415"ID="IN8414-146289370"srv_setcoldata
srv_setcoldata
Specify the address of a column's data. FORMAT="LINESPECIFIC"CS_RETCODE srv_setcoldata(spp, column, datap)FORMAT="LINESPECIFIC"SRV_PROC        *spp;FORMAT="LINESPECIFIC"CS_INT          column;FORMAT="LINESPECIFIC"CS_VOID         *datap;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.column - The column whose data address is being specified. The first column is 1. datap - A generic void pointer (CS_VOID*) that addresses the column data. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_setcoldata tells Open Server where to locate a column's data. Column data addresses are initially set with the MOREINFO="NONE"srv_describe function. If the address of the column data changes, MOREINFO="NONE"srv_setcoldata must be called to specify the new address of the data. Null data is represented by setting the column's length to 0 with MOREINFO="NONE"srv_setcollen. The data address is then ignored. Each column of the row must first be defined with MOREINFO="NONE"srv_describe. MOREINFO="NONE"srv_setcoldata will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_bind routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include  <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE ex_srv_setcoldata PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     SRV_PROC  *sprocREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SETCOLDATAREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   An example routine to set the data source for two columns ofREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   data using srv_setcoldata.  REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   sproc    A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED      If both columns were set successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL        If an error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODEex_srv_setcoldata(sproc)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC*sproc;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_CHAR    *colname1 = "NAME";REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_CHAR    *colname2 = "AGE";REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_CHAR    *row1[2] = {"Calvin", "6",};REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_CHAR    *row2[2] = {"Hobbes", "4",};REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_INT     count;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* We need to define each of the two columns. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if ( srv_describe(sproc, 1, colname1, CS_NULLTERM, SRVCHAR,           10, SRVCHAR, 10, NULL) == CS_FAIL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if ( srv_describe(sproc, 2, colname2, CS_NULLTERM, SRVINT2,          NULL, SRVCHAR, 5, NULL) == CS_FAIL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Now set the data source for both columns for the first      ** row.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      for ( count = 0; count < 2; count++ )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            if ( srv_setcoldata(sproc, 1, (CS_VOID *)row1[count]) REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                == CS_FAIL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Now set the data source for both columns for the second      ** row.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      for ( count = 0; count < 2; count++ )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            if ( srv_setcoldata(sproc, 1, (CS_VOID *)row2[count]) REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                  == CS_FAIL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"                  return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X30757"srv_bind
ID="IN8414-149292378"srv_setcoldataID="X94031"ID="IN8513-152296379"srv_setcollen
srv_setcollen
Specify the current length of a column's data. FORMAT="LINESPECIFIC"SRV_RETCODE srv_setcollen(spp, column, len)FORMAT="LINESPECIFIC"SRV_PROC        *spp;FORMAT="LINESPECIFIC"int             column;FORMAT="LINESPECIFIC"int             len;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.column - The column whose data length is being specified. The first column is 1. len - The length of the column data, in bytes. A length of 0 means the column has a null data value. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_setcollen specifies a column's data length in bytes. Column data lengths are initially set by MOREINFO="NONE"srv_describe. For fixed length fields that don't allow nulls, there is no need to set the column data lengths again. However, MOREINFO="NONE"srv_describe defines the maximum length of variable length data. For variable length data, the actual data length usually changes for each row, requiring the use of MOREINFO="NONE"srv_setcollen. Call MOREINFO="NONE"srv_setcollen separately for each column whose data length changes. Only certain pre-10.0 datatypes are nullable. See the LINKEND="X87730"Types
 topics page, for details.Represent a null value by setting the column length to 0. The data length is taken to be whatever it was set to by the last call to MOREINFO="NONE"srv_describe or MOREINFO="NONE"srv_setcollen. If the actual data length changes between rows, MOREINFO="NONE"srv_setcollen must be called to set it to the new length. Each column of the row must first be defined with MOREINFO="NONE"srv_describe. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_setcollen PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC     *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SETCOLLENREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to specify the current length of a column's**    data.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    This example describes a single column row, changes its**    length with srv_setcollen, and sends it to the client with**    srv_sendrow.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp    A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    The language request was copied successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       The length of the buffer not sufficient or **                  some other error was detected. REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_setcollen(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_BOOL   ok;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_CHAR   char_buf[CS_MAX_CHAR-1];REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_INT    status;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Initialization. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ok = CS_TRUE;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      status = SRV_DONE_FINAL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Describe the row. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_describe(spp, 1, "Char Column", CS_NULLTERM,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            SRVCHAR, CS_MAX_CHAR-1, SRVCHAR, 0, (CS_VOID *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            ok = CS_FALSE;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Make up some data. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      strcpy(char_buf, "First Data sample...");REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Set the column length. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (ok && (srv_setcollen(spp, 1, strlen(char_buf)) ==            CS_FAIL))REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            ok = CS_FALSE;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Set the column data. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (ok && (srv_setcoldata(spp, 1, (CS_VOID *)char_buf) ==            CS_FAIL))REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            ok = CS_FALSE;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Send the row. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (ok && (srv_sendrow(spp) == CS_FAIL))REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            ok = CS_FALSE;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** You can change the data length here, and then call      ** srv_sendrow to send more rows.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Finally call srv_senddone. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (!ok)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            status |= SRV_DONE_ERROR;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_senddone(spp, status, CS_TRAN_UNDEFINED, (CS_INT)0)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            ok = CS_FALSE;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return ((ok) ? CS_SUCCEED : CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X30757"srv_bind
MOREINFO="NONE", LINKEND="X59720"srv_describe
MOREINFO="NONE", LINKEND="X65415"srv_setcoldata
ID="IN8513-155299387"srv_setcollenID="IN8615-158303388"srv_setcolutype
srv_setcolutype
Define the user datatype to be associated with a column.FORMAT="LINESPECIFIC"CS_RETCODE srv_setcolutype(spp, column,utype)REMAP="SY--Syntax" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="SY--Syntax" FORMAT="LINESPECIFIC"CS_INT          column;REMAP="SY--Syntax" FORMAT="LINESPECIFIC"CS_INT          utype;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.column - The column number of the column with which to associate the user datatype. The first column is 1.utype - The user-defined datatype to be associated with the column. CommentsMARK="BULL" REMAP="BU--Bullet"The datatype set via MOREINFO="NONE"srv_setcolutype is the datatype the client application will receive via the DB-Library call dbcolutype or via the CT-Library call ct_describe.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE       ex_srv_setcolutype PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC         *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT           column,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT           utypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SETCOLUTYPEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Example routine to define the user datatype to be associated**   with a column using srv_setcolutype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  spp        A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  column     The column number associated with the type.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  utype      The type to be associated with the column.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_SUCCEED      The datatype was successfully associated with**                  the column.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  CS_FAIL         An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_setcolutype(spp, column, utype)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC       *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT         column;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT         utype;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Associate the type with the column.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_setcolutype(spp, column, utype) != CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsID="IN8615-161306394"srv_setcolutypeREMAP="BO--Body"CS_SUCCEED, CS_FAILID="IN8714-164310395"srv_setcontrol
srv_setcontrol
Describe user control or format information for columns. FORMAT="LINESPECIFIC"CS_RETCODE srv_setcontrol(spp, colnum, ctrlinfop,FORMAT="LINESPECIFIC"                 ctrllen)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_INT           colnum;FORMAT="LINESPECIFIC"CS_BYTE          *ctrlinfop;FORMAT="LINESPECIFIC"CS_INT           ctrllen;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.colnum - The number of the column to which the control information applies. The first column in a row is column number 1.ctrlinfop - A pointer to the control data. Its length is given by the ctrllen parameter.ctrllen - The length, in bytes, of the control data. There are, at most, SRV_MAXCHAR bytes of control information per column.CommentsMARK="BULL" REMAP="BU--Bullet"An Open Server application uses MOREINFO="NONE"srv_setcontrol to tell a client about any user-defined format information pertinent to a particular column. For example, a client may want to send a particular string along with a particular column.MOREINFO="NONE"srv_setcontrol must be called after a call to MOREINFO="NONE"srv_descfmt and before calls to MOREINFO="NONE"srv_xferdata. If called from any other context, it will return CS_FAIL.Control information can be associated with columns in any order. The only requirement is that the column must first be defined with MOREINFO="NONE"srv_descfmt.It is not necessary to call MOREINFO="NONE"srv_setcontrol for every column in a row. If an Open Server application does not set control information for a column, a null control string is returned for the column.An application should not return control information unless the client has specifically requested such information, via the client option toggle, CS_OPT_CONTROL.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_setcontrol PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC      *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Constants.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#define MAXROWDATA        20REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#define COLCONTROL        "Emp name: %s"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SETCONTROLREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to describe format information for a column**    using srv_setcontrol. In this example, a simple character**    column contains an employee name.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp    A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED      Control information successfully defined.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL    An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE       ex_srv_setcontrol(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC         *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_DATAFMTfmt;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Describe the format of the row data for the column. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      srv_bzero((CS_VOID *)&fmt, (CS_INT)sizeof(fmt));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      fmt.datatype = CS_CHAR_TYPE;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      fmt.maxlength = MAXROWDATA;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_descfmt(spp, (CS_INT)CS_SET, (CS_INT)SRV_ROWDATA,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            (CS_INT)1, &fmt) != CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Define the control information for the column. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_setcontrol(spp, (CS_INT)1, (CS_BYTE *)COLCONTROL,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            (CS_INT)strlen(COLCONTROL)) != CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if control information was successfully associated with the column.REMAP="BO--Body"CS_FAIL if an error was detected. See AlsoREMAP="BO--Body"LINKEND="X30757"srv_bind
MOREINFO="NONE", LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X52699"srv_xferdata
ID="IN8714-167313403"srv_setcontrolID="IN8812-170317404"srv_setifile
srv_setifile
Specify the name and location of the SYBASE interfaces file. FORMAT="LINESPECIFIC"CS_VOID srv_setifile(filenamep, len)FORMAT="LINESPECIFIC"CS_CHAR        *filenamep;FORMAT="LINESPECIFIC"CS_INT         len;ParametersREMAP="RI--RefIndent"filenamep - A pointer to the name of the interfaces file. If filenamep is (CS_CHAR *) NULL, Open Server uses the default interfaces file. len - The length, in bytes, of the file name. If the *filenamep string is null terminated, len can be CS_NULLTERM. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_setifile specifies the name and location of the interfaces file Open Server searches when the Open Server is being initialized. The interfaces file contains the name and network address of every server available on the network. You must call MOREINFO="NONE"cs_ctx_alloc to allocate a CS_CONTEXT structure prior to calling MOREINFO="NONE"srv_setifile. If you do not, Open Server will raise an error and the MOREINFO="NONE"srv_setifile command will abort. For more information on the CS_CONTEXT structure, see  the LINKEND="X61449"CS-Library
.The default interfaces file is used if MOREINFO="NONE"srv_setifile has not been called, or if filenamep is (CS_CHAR *)NULL. The default interfaces file is determined as follows: Open Server tries to use a file named interfaces in the directory specified by the SYBASE environment variable or logical name. If SYBASE has not been set, Open Server tries to use a file named interfaces in the home directory of the user sybase. MOREINFO="NONE"srv_setifile will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_props routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID     ex_srv_setifile PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR     *filename,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT      namelenREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SETIFILEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to define the location of the interfaces**    file via srv_setifile.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**          filename   The full path name of the interfaces file.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**          namelen    The length of the filename.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**          Nothing.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID     ex_srv_setifile(filename, namelen)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR     *filename;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT      namelen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Call srv_setifile to define the interfaces file name.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      srv_setifile(filename, namelen);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** All done.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"None. See AlsoREMAP="BO--Body"LINKEND="X24609"srv_init
MOREINFO="NONE", LINKEND="X84669"srv_props
ID="IN8812-173320412"srv_setifileID="X72527"ID="IN8914-176324413"srv_setloginfo
srv_setloginfo
Return protocol format information from a remote server to a client. FORMAT="LINESPECIFIC"CS_RETCODE srv_setloginfo(spp, loginfop)FORMAT="LINESPECIFIC"SRV_PROC        *spp;FORMAT="LINESPECIFIC"CS_LOGINFO      *loginfop;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.loginfop - A pointer to a CS_LOGINFO structure that has been updated by ct_getloginfo. CommentsMARK="BULL" REMAP="BU--Bullet"Use MOREINFO="NONE"srv_setloginfo in gateway server applications that pass protocol (Tabular Data Stream) packets between clients and remote SYBASE servers without interpreting the contents of the packet. When a client connects directly to a server, the two programs negotiate the protocol format they will use to send and receive data. When you use protocol pass-through in a gateway application, the Open Server forwards protocol packets between the client and a remote server.MOREINFO="NONE"srv_setloginfo is the fourth of four calls, two of them are CT-Library calls, that allow a client and remote server to negotiate a TDS format. The calls, which can only be made in a SRV_CONNECT event handler, are: NUMERATION="ARABIC" REMAP="S1--StepOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"MOREINFO="NONE"srv_getloginfo - Allocate a CS_LOGINFO structure and fill it with TDS information from the client thread. ct_setloginfo - Prepare a CS_LOGINFO structure with the protocol information retrieved in step 1, then log into the remote server with ct_connect. ct_getloginfo - Transfer protocol login response information from a CS_CONNECTION structure to the newly allocated CS_LOGINFO structure. MOREINFO="NONE"srv_setloginfo - Send the remote server's response, retrieved in step 3, to the client, then release the CS_LOGINFO structure. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_setloginfo     PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_LOGINFO      *loginfopREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SETLOGINFOREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Return protocol format information from a remote server to**    a client.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp      A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    loginfop A pointer to a CS_LOGINFO structure that has been**             updated by ct_getloginfo.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** ReturnsREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED  REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL    REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_setloginfo(spp, loginfop)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_LOGINFO      *loginfop;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Check arguments. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if(spp == (SRV_PROC *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"             return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(srv_setloginfo(spp,loginfop));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X37685"srv_getloginfo
MOREINFO="NONE", LINKEND="X69557"srv_recvpassthru
MOREINFO="NONE", LINKEND="X30039"srv_sendpassthru
ID="IN8914-179327421"srv_setloginfoID="X23761"ID="IN9010-182331422"srv_setpri
srv_setpri
Modify the scheduling priority of a thread. FORMAT="LINESPECIFIC"CS_RETCODE srv_setpri(spp, mode, priority_value)FORMAT="LINESPECIFIC"SRV_PROC        *spp;FORMAT="LINESPECIFIC"CS_INT          mode;FORMAT="LINESPECIFIC"CS_INT          priority_value;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.mode - SRV_C_DELTAPRI, if priority_value is to adjust the current priority, or SRV_C_NEWPRI, if priority_value is the new priority. priority_value - If mode is SRV_C_NEWPRI, priority_value is the new priority for the thread. If mode is SRV_C_DELTAPRI, a negative priority_value reduces the current priority by its absolute value and a positive priority_value increases the current priority. CommentsMARK="BULL" REMAP="BU--Bullet"When a thread is started as the result of a client logging into the Open Server or as the result of a call to MOREINFO="NONE"srv_createproc or MOREINFO="NONE"srv_spawn, it has a priority of SRV_C_DEFAULTPRI. MOREINFO="NONE"srv_setpri can change the priority by specifying the new value or by adjusting the current value up or down by a specified value. If a thread sets the priority of another thread to a level higher than its own, the other thread is scheduled to run immediately. Otherwise, the new priority of the affected thread takes effect the next time the scheduler runs.If a thread that never sleeps has a priority higher than other threads, the lower priority threads will never have a chance to execute. Internal Open Server threads run with a priority of SRV_C_DEFAULTPRI. If you raise the priority of a thread above SRV_C_DEFAULTPRI, it must sleep occasionally to allow these internal processes to run. It is an error to reduce the priority to less than SRV_C_LOWPRIORITY or to increase it to a value greater than SRV_C_MAXPRIORITY. MOREINFO="NONE"srv_setpri cannot be used in a SRV_START handler. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE       ex_srv_setpri PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC         *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT           mode,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT           priorityREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SETPRIREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to change a thread's scheduling priority.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  spp        A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  mode       Indicates whether a priority is relative or **              absolute.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  priority   The change in priority value or the nrew                priority value.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEEDREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAILREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE    ex_srv_setpri(spp, mode, priority)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC      *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT        mode;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT        priority;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(srv_setpri(spp, mode, priority));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the priority was successfully modified; otherwise, CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X35449"srv_createproc
MOREINFO="NONE", LINKEND="X60232"srv_spawn
ID="IN9010-185334430"srv_setpriID="IN9115-188338431"srv_setuserdata
srv_setuserdata
Save a pointer to private data space in a thread structure. FORMAT="LINESPECIFIC"CS_RETCODE srv_setuserdata(spp, ptr)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_VOID          *udp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.udp - A pointer to the private data space. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_setuserdata saves a pointer to private data space in the thread structure. The data can be accessed later with MOREINFO="NONE"srv_getuserdata. Since Open Server routines should be re-entrant, this allows you to avoid using global or static variables to hold private data. udp is not manipulated in any way by Open Server. It is provided only for the convenience of Open Server programmers. To allocate memory for user data, use MOREINFO="NONE"srv_alloc. MOREINFO="NONE"srv_setuserdata will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_thread_props routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include      <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"extern CS_RETCODE      ex_srv_setuserdata PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC               *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID                *dpREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SETUSERDATAREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Associate a data pointer with a thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp      A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    dp       A pointer to a private data space.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED     The data pointer was successfully associated **                   with the thread.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL        An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_setuserdata(spp, dp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID         *dp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if(srv_setuserdata(spp, dp) == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X95939"srv_alloc
MOREINFO="NONE", LINKEND="X12814"srv_getuserdata
MOREINFO="NONE", LINKEND="X51398"srv_thread_props
MOREINFO="NONE", LINKEND="X78566"Events
ID="IN9115-191341439"srv_setuserdataID="IN9213-194345440"srv_setustate
srv_setustate
Set the user state field in the thread structure. This field is displayed by the MOREINFO="NONE"sp_ps and MOREINFO="NONE"sp_who system registered procedures. FORMAT="LINESPECIFIC"CS_RETCODE srv_setustate(spp, state_stringp,FORMAT="LINESPECIFIC"                      namelen)FORMAT="LINESPECIFIC"SRV_PROC        *spp;FORMAT="LINESPECIFIC"CS_CHAR         *state_stringp;FORMAT="LINESPECIFIC"CS_INT          namelen;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.state_stringp - A pointer to a string indicating the state of the thread structure. namelen - An integer that contains the number of bytes in the *state_stringp string. If the string is null terminated, namelen can be CS_NULLTERM. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_setustate sets a thread structure field with a string that is displayed by the MOREINFO="NONE"sp_ps and MOREINFO="NONE"sp_who built-in registered procedures. This is useful for debugging and for administering a production server. The MOREINFO="NONE"sp_ps system registered procedure, supplied with Open Server, displays state information for active threads. The field that MOREINFO="NONE"srv_setustate sets is initialized to NULL each time a thread begins execution. Once set to a value, you must explicitly set it to NULL if you do not want MOREINFO="NONE"sp_ps to display a string for the thread. MOREINFO="NONE"srv_setustate cannot be used in a SRV_START handler. MOREINFO="NONE"srv_setustate will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_thread_props routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_setustate PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC       *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local defines.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#define USTATE "SETUSTATE_THREAD"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SETUSTATEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Example routine to set the user state field.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   spp  A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_SUCCEED     If we were able to set the user state.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   CS_FAIL        If an error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_setustate(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC       *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_RETCODE   result;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      result = srv_setustate(spp, USTATE, CS_NULLTERM);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return (result);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X23967"sp_ps
MOREINFO="NONE", LINKEND="X31322"sp_who
MOREINFO="NONE", LINKEND="X51398"srv_thread_props
ID="IN9213-197348448"srv_setustateID="X33074"srv_sfieldID="IN9310-200352449"srv_sfield
Return a field from a SRV_CONFIG structure. FORMAT="LINESPECIFIC"CS_CHAR *srv_sfield(ssp, field, lenp)FORMAT="LINESPECIFIC"SRV_SERVER      *ssp;FORMAT="LINESPECIFIC"CS_INT          field;FORMAT="LINESPECIFIC"CS_INT          *lenp;ParametersREMAP="RI--RefIndent"ssp - A pointer to the Open Server control structure. field - The SRV_CONFIG field to return. lenp - A pointer to an application buffer that will contain the length of the value for field. lenp can be (int *) NULL, in which case the length of the string is not returned. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_sfield returns a pointer to a null terminated string containing the current value for field in the SRV_CONFIG structure. The values of the SRV_CONFIG structure used in the call to MOREINFO="NONE"srv_init are stored in a SRV_CONFIG structure referenced by the SRV_SERVER structure. The values returned by MOREINFO="NONE"srv_sfield are taken from this SRV_CONFIG structure. MOREINFO="NONE"srv_sfield converts numeric values to their character string representations before storing them in the character buffer. MOREINFO="NONE"srv_sfield will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_props routine provides the same functionality.LimitationsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_sfield returns a pointer to a static character buffer. Since there is just one buffer, each call overwrites the result of the previous call. You should copy the buffer to local storage if you need to save the value. MOREINFO="NONE"srv_sfield returns values in the same buffer for all threads that call it. Therefore, MOREINFO="NONE"srv_sfield is not re-entrant, and should be protected with a mutex if you use it in multi-user programs created with Release 2.0.   OptionsREMAP="BO--Body"The table below describes the legal values for the field argument and what each returns. See the LINKEND="X71144"srv_config
 reference page, for more information about these options. TOCENTRY="1"LBL="Table 3-59: "Values and Returns for field (srv_sfield)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="127*"COLNAME="C2" COLWIDTH="232*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CONNECTIONSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of physical connections for which the 
server is configured. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_LOGFILECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The name of the log file used by MOREINFO="NONE"srv_log. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAXNETBUFCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The maximum size of a network buffer for a 
thread. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MUTEXESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of mutexes allocated when the Open 
Server is initialized. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MSGPOOLCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of message structures allocated when 
the Open Server application is initialized. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MSGQUEUESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of message queues allocated when 
the Open Server application is initialized. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_REMPREREADCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of network read buffers allocated for 
each remote connection.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_REMSITESCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The maximum number of site handlers that can 
execute at a time. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_SERVERNAMECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The name of the Open Server application. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_STACKSIZECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The size of the stack allocated for a client thread 
when a new connection is made to the Open 
Server application or when a thread is spawned 
with MOREINFO="NONE"srv_spawn and the stacksize parameter is 
SRV_DEFAULT_STACKSIZE. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_SRVPROCSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The maximum number of threads an application 
can create with MOREINFO="NONE"srv_spawn or MOREINFO="NONE"srv_createproc.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TIMESLICECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of clock ticks a thread consumes 
before the callback routine is called. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_USEREVENTSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of programmer-defined events that 
can be defined. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_VIRTCLKRATECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The clock rate, in microseconds. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_VIRTTIMERCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0""TRUE" if time slice callbacks are enabled, 
"FALSE" if not.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <stdio.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#define    FPRINTF (CS_VOID)fprintfREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID        ex_srv_sfield PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_SERVER     *serverREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SFIELDREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   An example routine to print out certain server configuration**   values using srv_sfield.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   server    A pointer to the Open Server control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Nothing.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID        ex_srv_sfield(server)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_SERVER     *server;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Print the Open Server application name. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     FPRINTF(stderr, "The Open Server Name: %s\n", REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          srv_sfield(server, SRV_SERVERNAME, (CS_INT *)NULL) );REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Print the configured maximum number of connections. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     FPRINTF(stderr, "The configured max connections: %s\n",REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           srv_sfield(server, SRV_CONNECTIONS, (CS_INT *)NULL) );REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Print the current server log file name. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      FPRINTF(stderr, "The Open Server log file name: %s\n",REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      srv_sfield(server, SRV_LOGFILE, (CS_INT *)NULL) );REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"A CS_CHAR pointer to a null terminated string containing the field value. The string length is returned in *lenp. If the field is empty, a valid CS_CHAR pointer to an empty string is returned and *lenp is set to 0. If the field is unknown, (CS_CHAR *) NULL is returned and *lenp is set to -1. See AlsoREMAP="BO--Body"LINKEND="X71144"srv_config
MOREINFO="NONE", LINKEND="X55932"SRV_GETSERVER
MOREINFO="NONE", LINKEND="X24609"srv_init
MOREINFO="NONE", LINKEND="X78437"srv_pfield
MOREINFO="NONE", LINKEND="X84669"srv_props
ID="IN9310-203355459"srv_sfieldID="X51454"ID="IN9423-206359460"srv_sigdump (UNIX only)
srv_sigdump (UNIX only)
Display the UNIX signal handlers that have been installed with MOREINFO="NONE"srv_sigvec or MOREINFO="NONE"srv_signal. FORMAT="LINESPECIFIC"CS_RETCODE srv_sigdump(sig)FORMAT="LINESPECIFIC"int         sig;ParametersREMAP="RI--RefIndent"sig - The number of the UNIX signal for which to display the current state. If you specify 0, all signal handlers are displayed. REMAP="UN--Under"For example, if signal handlers have been installed for SIGINT and SIGURG, srv_sigdump(0) produces the following output: REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"SIGINT  status=ORIGINAL     custvec=%x25f64       handler=%x324a   mask=%x0  SIGURG  status=SUPERCEDED custvec=%x260ec       handler=%x324a   mask=%x0 sybvec=%x260f8   handler=%x3226   mask=%x0 REMAP="BO--Body""ORIGINAL" means that the signal handler was originally installed by MOREINFO="NONE"srv_sigvec or MOREINFO="NONE"srv_signal. "SUPERCEDED" means that the signal handler that is currently seen in the custvec signal handler was discovered when Open Server installed a signal handler. The custvec signal handler was superseded by the Open Server signal handler and will be executed after it. The example shows that a programmer-installed signal handler is installed for SIGINT. The display for SIGURG shows that both a programmer-installed signal handler and a Server-Library installed signal handler exist, and that the programmer-installed signal handler was discovered when the Open Server handler signal was installed. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_sigdump is a diagnostic tool. It is used when a conflict between a signal handler installed by Open Server and a programmer-installed signal handler is suspected. It displays the current state of the Open Server data structure that is used to manage signals. Only signal handlers that have been installed by MOREINFO="NONE"srv_sigvec or MOREINFO="NONE"srv_signal, or signal handlers that have been found by Open Server when installing a signal handler for SIGIO or SIGURG, are displayed. If no signal handler is installed, no output is produced. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_sigdump PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT         sigREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SIGDUMPREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Example routine to illustrate the use of srv_sigdump.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    sig   The number of the UNIX signal for which to display **          current state.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL      If the application passed an invalid signal **                 number.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED   If the call succeeded.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_sigdump(sig)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          sig;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"       return (srv_sigdump(sig));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"If an invalid signal number is passed, MOREINFO="NONE"srv_sigdump returns CS_FAIL and prints out an error message. Otherwise, it returns CS_SUCCEED. See AlsoREMAP="BO--Body"LINKEND="X57619"srv_signal (UNIX only)
MOREINFO="NONE", LINKEND="X38186"srv_sigvec (UNIX only)
ID="IN9423-209362468"srv_sigdump (UNIX only)ID="X57619"ID="IN9522-212366469"srv_signal (UNIX only)
srv_signal (UNIX only)
Install a signal handler. FORMAT="LINESPECIFIC"SRV_SIGNAL_FUNC  srv_signal(sig, handler)FORMAT="LINESPECIFIC"CS_INT           sig;FORMAT="LINESPECIFIC"SRV_SIGNAL_FUNC  handler;ParametersREMAP="RI--RefIndent"sig - The number of the UNIX signal for which a handler is installed. This is defined in sgs/signal.hhandler - A pointer to a function that is called when sig is delivered to Open Server. Setting handler to SIG_DFL restores the default handler. Setting handler to SIG_IGN cause sig to be ignored.CommentsMARK="BULL" REMAP="BU--Bullet"Open Server installs UNIX signal handlers for SIGIO and SIGURG. These handlers must always be active once an Open Server is started. If they are not active, the Server-Library I/O and attention handling routines will either fail to function or will be unreliable. Installing a UNIX signal handler using sigvec(2) or signal(2) can cause unpredictable results. Applications should use MOREINFO="NONE"srv_signal.Open Server guarantees that all other signals are blocked while the application is in the signal handler. UNIX documentation on signal for more information.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <errno.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <stdio.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <signal.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_STATIC CS_VOID         ex_sigio_handler PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT                    sigREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE       ex_srv_signal PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT           *uerrnoREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Static storage.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_STATIC CS_INT io_events = 0;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SIGNALREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to install a UNIX signal handler for SIGIO,**    using srv_signal.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    uerrno    A pointer to a user's error number indicator.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    Handler successfully installed.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       Handler not installed, UNIX global errno set.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_signal(uerrno)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          *uerrno;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Install the handler.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      (CS_VOID)srv_signal((int)SIGIO,                        (SRV_SIGNAL_FUNC)ex_sigio_handler);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Was there an error condition? */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if ((*uerrno = errno) != 0)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SIGIO_HANDLERREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example signal handler to count I/O events. It prints a **    message when the Open Server application has been up long **    enough to get 100,000 I/O events.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    sig  The signal number, always SIGIO.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Nothing.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_STATIC CS_VOID     ex_sigio_handler(sig)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT                sig;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if (io_events == 100000)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           fprintf(stderr, "The server has been up a long                   time!!\n");REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           io_events = 0;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      elseREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           io_events++;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"On success, MOREINFO="NONE"srv_signal returns a pointer to the previously installed handler function, or a null pointer if no handler is installed. ErrorsREMAP="BO--Body"MOREINFO="NONE"srv_signal fails and no new signal handler is installed if sig is not a valid signal number. See AlsoREMAP="BO--Body"LINKEND="X51454"srv_sigdump (UNIX only)
MOREINFO="NONE", LINKEND="X38186"srv_sigvec (UNIX only)
ID="IN9522-215369478"srv_signal (UNIX only)ID="X38186"ID="IN9622-218373479"srv_sigvec (UNIX only)
srv_sigvec (UNIX only)
Install a UNIX signal handler for the SIGIO or SIGURG signals. FORMAT="LINESPECIFIC"int srv_sigvec(sig, vecp, ovecp)FORMAT="LINESPECIFIC"int                    sig;FORMAT="LINESPECIFIC"struct sigvec          *vecp;FORMAT="LINESPECIFIC"struct sigvec          *ovecp;ParametersREMAP="RI--RefIndent"sig - The number of the UNIX signal for which a handler is to be installed. vecp - If vecp is non-null, MOREINFO="NONE"srv_sigvec determines whether the handler being installed is for a Server-Library handled signal. If it is, all the fields in vecp are copied to an internal data structure that Open Server uses to manage programmer-installed signal handlers. If the signal is not handled by Open Server, sigvec(2) is called directly with the arguments passed to MOREINFO="NONE"srv_sigvec. ovecp - If ovecp is non-null, information about the currently installed handler is copied into the appropriate fields in ovec. If the signal has a Server-Library installed handler, the programmer signal handler information is copied to the data structure used by Open Server to manage programmer-installed signal handlers. Otherwise, sigvec is called directly and fills in ovecp appropriately. You can determine if a handler already exists for a particular signal without changing the existing handler by specifying a null vecp and a non-null ovecp. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_sigvec enables the installation of UNIX handlers for the signals that Open Server already handles. Installing a UNIX signal handler with MOREINFO="NONE"srv_sigvec insures that Open Server executes it when the signal is delivered. Open Server signal handlers always execute first. When a UNIX signal handler is installed with MOREINFO="NONE"srv_sigvec, it is called from within the Open Server signal handler, with the same arguments that were passed to the Open Server signal handler. MARK="DASH" REMAP="BS--BulletSub"MOREINFO="NONE"srv_init installs signal handlers for SIGIO and SIGURG as part of its processing. If these handlers are not active when the Open Server is running, the Server-Library I/O and attention handlers either fail to function or are unreliable. MOREINFO="NONE"srv_sigvec first determines whether a handler already exists for the signal. If so, the existing handler is saved, and it continues to execute when the signal is delivered. Note that the Open Server handler executes first. In most other respects, MOREINFO="NONE"srv_sigvec behaves just as sigvec(2) does. In fact, if MOREINFO="NONE"srv_sigvec is used to install a handler for a signal Open Server doesn't handle, Open Server calls sigvec(2) directly. Installing a SIGIO or SIGURG handler with the
SV_ONSTACK, SV_INTERRUPT, or SV_RESETHAND flags set in the
vecpname='rArrow' font='symbol' code='174'  charset='fontspecific'sv_flags field, causes those flags to be ignored. Installing a UNIX signal handler for SIGIO or SIGURG with sigvec(2) or signal(3), then restoring the Open Server handler, can cause unpredictable results. site handler MOREINFO="NONE"srv_sigvec will not be supported in future Open Server releases.The existing Server-Library routine, MOREINFO="NONE"srv_signal, provides the same functionality. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include <values.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include <signal.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototypes.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE       ex_srv_sigvec PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_STATIC CS_VOID           user_sigio_hdlr PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"int                         sigREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Static storage.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_STATIC CS_INT io_events = 0;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SIGVECREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to install a user-defined signal handler**    for SIGIO, using srv_sigvec.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    None.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    Handler successfully installed.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       Handler not installed, UNIX global errno set.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_sigvec()REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      struct sigvec vec;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Initialization. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      vec.sv_handler = user_sigio_hdlr;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      vec.sv_mask = 0;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      vec.sv_flags = 0;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Install the handler. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if (srv_sigvec((int)SIGIO, &vec, (struct sigvec *)NULL) < 0)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"         return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** USER_SIGIO_HDLRREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example signal handler to count IO events. It prints a**    message when the Open Server application has been up long**    enough to get MAXINT I/O events.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    sig   The signal number, always SIGIO.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Nothing.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_STATIC CS_VOID  user_sigio_hdlr(sig)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"int                sig;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (io_events == (CS_INT)MAXINT)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            printf("The server has been up a long time!!\n");REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            io_events = 0;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      elseREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            ++io_events;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"MOREINFO="NONE"srv_sigvec returns 0 if the call succeeded. If any error occurred, it returns -1 and sets the global variable errno with to actual error condition.    REMAP="BO--Body"MOREINFO="NONE"srv_sigvec fails and no new signal handler is installed if one of the following occurs: MARK="BULL" REMAP="BU--Bullet"EFAULT - Either vec or ovec is not a null pointer and points to memory that is not a valid part of the process address space. EINVAL - sig is not a valid signal number. EINVAL - An attempt was made to ignore or supply a handler for SIGKILL or SIGSTOP. EINVAL - An attempt was made to ignore SIGCONT (by default, SIGCONT is ignored). See AlsoREMAP="BO--Body"LINKEND="X51454"srv_sigdump (UNIX only)
MOREINFO="NONE", LINKEND="X57619"srv_signal (UNIX only)ID="IN9712-221377487"SRV_SITEPROC
SRV_SITEPROC
Test whether a thread is a site handler. FORMAT="LINESPECIFIC"CS_BOOL SRV_SITEPROC(spp)FORMAT="LINESPECIFIC"SRV_PROC     *spp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.CommentsMARK="BULL" REMAP="BU--Bullet"A site handler is a thread that connects a SQL Server with the Open Server application. The SRV_SITEPROC macro returns CS_TRUE when its argument is a site handler thread. Otherwise it returns CS_FALSE. This macro can be used in a SRV_CONNECT event handler to avoid executing code intended for processing normal client connections. SRV_SITEPROC will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_thread_props routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_BOOL     ex_srv_siteproc PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC    *spREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SITEPROCREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to check whether a given thread is a site**    handler.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**          sp  A pointer to an internal thread control**              structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**        CS_TRUE      If the given thread is a site handler.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**        CS_FALSE     If the given thread is not a site handler.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_BOOL      ex_srv_siteproc(sp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC     *sp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"       return SRV_SITEPROC(sp);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"If the thread is a site handler, CS_TRUE is returned. Otherwise, CS_FALSE is returned. See AlsoREMAP="BO--Body"LINKEND="X51398"srv_thread_props
ID="IN9712-224380495"SRV_SITEPROCID="X32792"srv_sleepID="IN989-227384496"srv_sleep
Suspend the currently executing thread. FORMAT="LINESPECIFIC"CS_RETCODE srv_sleep(sleepeventp, sleeplabelp, FORMAT="LINESPECIFIC"                  sleepflags, infop, reserved1,FORMAT="LINESPECIFIC"                  reserved2)FORMAT="LINESPECIFIC"CS_VOID         *sleepeventp;FORMAT="LINESPECIFIC"CS_CHAR         *sleeplabelp;FORMAT="LINESPECIFIC"CS_INT          sleepflags;FORMAT="LINESPECIFIC"CS_INT          *infop;FORMAT="LINESPECIFIC"CS_VOID         *reserved1;FORMAT="LINESPECIFIC"CS_VOID         *reserved2;ParametersREMAP="RI--RefIndent"sleepeventp - A generic void pointer that MOREINFO="NONE"srv_wakeup uses to wake up the thread or threads. The pointer should be unique for the operating system event the threads are sleeping on. For example, if a message is passed to another thread, the sending thread could sleep until the message was processed. The pointer to the message would be a useful sleepevent that the receiving thread could pass to MOREINFO="NONE"srv_wakeup to wake up the sender. sleeplabelp - A pointer to a null terminated character string that identifies the event that the thread is sleeping on. This is useful for determining why a thread is sleeping. An application can display this information using the Open Server system registered procedure MOREINFO="NONE"sp_ps.sleepflags - The value of this flag determines the manner in which the thread will wake up. The following table summarizes the legal values for sleepflags:TOCENTRY="1"LBL="Table 3-60: "Values for sleepflags (srv_sleep)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="140*"COLNAME="C2" COLWIDTH="129*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Meaning of ValueVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_M_ATTNWAKECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The thread wakes up if it 
receives an attention.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_M_NOATTNWAKECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Attentions cannot wake 
up the thread.infop - A pointer to a CS_INT. The following table describes the possible values returned in *infop if MOREINFO="NONE"srv_sleep returns CS_FAIL: TOCENTRY="1"LBL="Table 3-61: "Values for infop (srv_sleep)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="126*"COLNAME="C2" COLWIDTH="234*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_INTERRUPTEDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The thread was woken unconditionally by 
MOREINFO="NONE"srv_ucwakeup. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_I_UNKNOWNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Some other error occurred. For example, the 
thread is already sleeping or is invalid. reserved1 - A platform-dependent handle to a mutex. This argument is ignored on non-preemptive platforms. Set it to (CS_VOID*)0 on non-preemptive platforms.reserved2 - This parameter is not currently used. Set it to 0.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_sleep suspends the currently executing thread and initiates rescheduling. The thread will sleep until MOREINFO="NONE"srv_wakeup is called on the same event.Depending on the value of sleepflags, a thread that is sleeping can also wake up by receiving an attention. A thread resumes execution on the statement just following the call to MOREINFO="NONE"srv_sleep. MOREINFO="NONE"srv_sleep cannot be used in a SRV_START handler. MOREINFO="NONE"srv_sleep should not be called from interrupt level code. Any number of problems could occur if this rule is violated. Call MOREINFO="NONE"srv_capability to determine whether your platform supports preemptive scheduling.The reserved1 parameter prevents a race condition that could occur with preemptive scheduling if the wakeup event occurred before the thread finished going to sleep. See the Open Client/Server Supplement for your platform for an example of preemptive scheduling.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include     <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_sleep  PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID         *sleepevnt,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *sleeplbl,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          *infopREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SLEEPREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   This routine will suspend the currently executing thread.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   sleepevnt A void pointer that srv_wakeup uses to wake up **             the thread. REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   sleeplbl  A pointer to a null terminated string that**             identifies the event being the thread is sleeping**             on. This is primarily used for debugging.**    infop    A pointer to a CS_INT that is set to one of the **             following values:**             SRV_I_INTERRUPTED - srv_ucwakeup **             unconditionally woke the thread.**             SRV_I_UNKNOWN - Some other error occurred.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** ReturnsREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEEDREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAILREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_sleep(sleepevnt,sleeplbl,infop)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID         *sleepevnt;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *sleeplbl;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          *infop;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Check arguments.  */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if(sleepevnt == (CS_VOID *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ** Using SRV_M_ATTNWAKE means the thread should wake up     ** unconditionally if it receives an attention.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"  return(srv_sleep(sleepevnt,sleeplbl,SRV_M_ATTNWAKE,infop,(CS_VOID*)0,(CS_VOID*)0));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X24476"srv_wakeup
ID="IN989-230387504"srv_sleep
 ID="IN989-233390505"srv_spawnID="X60232"srv_spawn
Allocate a service thread. FORMAT="LINESPECIFIC"CS_RETCODE srv_spawn(sppp, stacksize, funcp, FORMAT="LINESPECIFIC"                  argp, priority)FORMAT="LINESPECIFIC"SRV_PROC        **sppp;FORMAT="LINESPECIFIC"CS_INT          stacksize;FORMAT="LINESPECIFIC"CS_RETCODE      (*funcp)();FORMAT="LINESPECIFIC"CS_VOID         *argp;FORMAT="LINESPECIFIC"CS_INT          priority;ParametersREMAP="RI--RefIndent"sppp - A pointer to a thread structure pointer. If the call is successful, the address of an internal thread structure is returned in sppp. stacksize - The size of the stack; it must be at least SRV_C_MINSTACKSIZE. The maximum stack size is the amount of memory that can be allocated by a call to malloc. Specify SRV_DEFAULT_STACKSIZE to use the stack size set with MOREINFO="NONE"srv_props. funcp - A pointer to a function that is the entry point for the newly-created thread. The thread begins by executing the routine located at funcp. The thread is freed when that routine returns or MOREINFO="NONE"srv_termproc is called. argp - A pointer that is passed to the routine in *funcp when the thread begins execution. priority - An integer between SRV_C_LOWPRIORITY and SRV_C_MAXPRIORITY that indicates the base priority of the spawned thread. The default priority is SRV_C_DEFAULTPRI.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_spawn allocates a "service" thread-one that is neither event-driven nor associated with any client. The thread runs under the control of the scheduler. Threads created by MOREINFO="NONE"srv_spawn are called "service" threads because they often provide services required by the event-driven threads, such as accessing shared devices and data objects. MOREINFO="NONE"srv_spawn informs the Open Server about a new thread and makes the thread runnable. The thread does not begin execution immediately. The moment that it actually does start execution is determined by many factors, such as the priority of the spawned thread and the priorities of other runnable threads. Code executed by multiple threads must be re-entrant. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <stdio.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE       entryfunc PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR          *messageREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE       ex_srv_spawn PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC         *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT           stacksize,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT           priorityREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE    entryfunc(message)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR       *message;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      printf("Welcome to a new thread - %s!\n", message);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SPAWNREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to allocate a service threadREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp      A pointer to an internal thread control **             structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    stacks   The desired thread stack size.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    priority The desired thread scheduling priority.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEEDREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAILREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE    ex_srv_spawn(spp, stacksize, priority)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC      *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT        stacksize;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT        priority;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    CS_CHAR      msgarg[20];REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    strcpy(msgarg, "come in");REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(srv_spawn(&spp, stacksize, entryfunc, msgarg,             priority));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"MOREINFO="NONE"srv_spawn returns CS_SUCCEED if the thread is successfully spawned. This guarantees only that sufficient Open Server internal resources are available. It does not validate the correctness of the entry point routine or its argument. If the thread cannot be spawned, MOREINFO="NONE"srv_spawn returns CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X97955"srv_callback
, LINKEND="X35449"srv_createproc
, LINKEND="X75457"srv_termproc
ID="IN999-236394513"srv_spawn
 ID="X39758"ID="IN10010-239398514"srv_symbol
srv_symbol
Convert an Open Server token value to a readable string. FORMAT="LINESPECIFIC"CS_CHAR *srv_symbol(type, symbol, lenp)FORMAT="LINESPECIFIC"CS_INT          type;FORMAT="LINESPECIFIC"CS_INT          symbol;FORMAT="LINESPECIFIC"CS_INT          *lenp;ParametersREMAP="RI--RefIndent"type - The type of token. The following table describes the legal token types: TOCENTRY="1"LBL="Table 3-62: "Token Types Corresponding to type (srv_symbol)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="117*"COLNAME="C2" COLWIDTH="135*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Token TypeCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Description VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_EVENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"An event typeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DONECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A DONE status typeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_ERRORCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"An error severity tokensymbol - The actual token value. lenp - A pointer to a CS_INT variable that will contain the length of the returned string. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_symbol returns a pointer to a readable null terminated string that describes an Open Server token value. Routines such as MOREINFO="NONE"srv_paramtype return Open Server token values. The following table summarizes the tokens MOREINFO="NONE"srv_symbol can convert: TOCENTRY="1"LBL="Table 3-63: "Convertible Tokens (srv_symbol)COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="156*"COLNAME="C2" COLWIDTH="152*"COLNAME="C3" COLWIDTH="166*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Token TypeCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TokenCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Description VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_ERRORCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_INFOCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Error severity typeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_ERRORCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_FATAL_PROCESSCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Error severity type.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_ERRORCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_FATAL_SERVERCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Error severity typeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DONECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DONE_MORECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DONE packet status fieldCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DONECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DONE_ERRORCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DONE packet status fieldCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DONECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DONE_FINALCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DONE packet status fieldCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DONECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DONE_FLUSHCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DONE packet status fieldCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DONECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DONE_COUNTCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DONE packet status fieldCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CHAR_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Char datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_BINARY_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Binary datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_TINYINT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1-byte integer datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SMALLINT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"2-byte integer datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_INT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4-byte integer datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_REAL_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Real datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_FLOAT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Float datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_BIT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Bit datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATETIME_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Datetime datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_DATETIME4_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4-byte datetime datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_MONEY_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Money datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_MONEY4_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4-byte money datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVCHARCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Char datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVVARCHARCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Variable-length char datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVBINARYCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Binary datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVVARBINARYCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Variable-length binary datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVINT1COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"1-byte integer datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVINT2COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"2-byte integer datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVINT4COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4-byte integer datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVINTNCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Integer datatype, nulls allowedCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVBITCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Bit datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVDATETIMECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Datetime datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVDATETIME4COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4-byte datetime datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVDATETIMNCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Datetime datatype, nulls allowedCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVMONEYCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Money datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVMONEY4COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4-byte money datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVMONEYNCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Money datatype, nulls allowedCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVREALCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4-byte float datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVFLT8COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"8-byte float datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVFLTNCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"8-byte float datatype, nulls 
allowed COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_LONGCHAR_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Long char datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_LONGBINARY_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Long binary datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TEXT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Text datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_IMAGE_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Image datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NUMERIC_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Numeric datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DECIMAL_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Decimal datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DATATYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRVVOIDCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Void datatypeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_EVENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_ATTENTIONCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server event typeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_EVENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_BULKCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server event typeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_EVENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CONNECTCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server event typeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_EVENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CURSORCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server event type COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_EVENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DISCONNECTCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server event type COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_EVENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DYNAMICCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server event type COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_EVENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_LANGUAGECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server event type COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_EVENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MSGCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server event type COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_EVENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_OPTIONCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server event type COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_EVENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_RPCCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server event type COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_EVENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_STARTCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server event type COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_EVENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_STOPCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server event typeCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_EVENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_URGDISCONNECTCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server event type ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local PrototypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"extern CS_RETCODE       ex_srv_symbol PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT type,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT symbol,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR *namepREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_SYMBOLREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Retrieve a printable string representation of an Open Server **   symbolREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     type         Symbol typeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     symbol       Symbol for which to retrieve stringREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     namep        Return symbol string hereREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_SUCCEED       Symbol string was retrieved successfullyREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_FAIL          An error was detectedREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE           ex_srv_symbol(type, symbol, namep)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT               type;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT               symbol;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR           *namep;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_INT          len;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     namep = srv_symbol(type, symbol, &len);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if(namep == (CS_CHAR *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"A pointer to a null terminated character string that is a readable translation of an Open Server token value. If the type or symbol is unknown, the routine returns (CS_CHAR *) NULL and sets len to -1. The pointer points to space that is never overwritten, so it is safe to call MOREINFO="NONE"srv_symbol more than once in the same statement. See AlsoREMAP="BO--Body"LINKEND="X47367"srv_paramtype
MOREINFO="NONE", LINKEND="X33058"srv_descfmtID="X62977"ID="IN10114-242402522"srv_tabcolname
srv_tabcolname
Associate browse mode
 result columns with result tables.FORMAT="LINESPECIFIC"CS_RETCODE srv_tabcolname(spp, colnum, brwsdescp)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_INT           colnum;FORMAT="LINESPECIFIC"CS_BROWSEDESC    *brwsdescp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure. colnum - The number used to identify the column that was previously described using MOREINFO="NONE"srv_descfmt.brwsdescp - A pointer to a structure containing browse information about the column in question. Specifically, it should contain the number of the table (previously described via MOREINFO="NONE"srv_tabname) containing the column and the original column name and name length. Note that the original column name and name length are only needed if the column has been renamed in the select statement (indicated by a status of CS_RENAMED in the CS_BROWSEDESC structure). For more information on the MOREINFO="NONE"CS_BROWSEDESC structure, see its topics page.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_tabcolname is used to send browse mode result information to a client. The information an application can send includes:REMAP="UN--Under"- The name of the table to which a result column maps.REMAP="UN--Under"- The real name of a column that was renamed in the client query's select statement.The column must have previously been defined using MOREINFO="NONE"srv_descfmt.The table must have previously been defined using MOREINFO="NONE"srv_tabname.MOREINFO="NONE"srv_tabcolname is called once for each result column that is a column in a result row.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include          <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE         ex_srv_tabcolname PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC           *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT             colnum,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_BROWSEDESC      *bdpREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_TABCOLNAMEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to associate a browse mode result column**    with result tables.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp      A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    colnum   The column number.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    bdp      A pointer to the browse descriptor for the**             column.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_SUCCEED   If we successfully associated this result**                  column with its table.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     CS_FAIL      If an error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE          ex_srv_tabcolname(spp, colnum, bdp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC           *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT             colnum;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_BROWSEDESC      *bdp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_RETCODE         result;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     result = srv_tabcolname(spp, colnum, bdp);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return (result);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the requested action completed successfully.REMAP="BO--Body"CS_FAIL if no action was taken.See AlsoREMAP="BO--Body"LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X37002"srv_tabname
MOREINFO="NONE", LINKEND="X90209"Browse Mode
ID="IN10114-245405530"srv_tabcolnameID="X37002"ID="IN10211-248409531"srv_tabname
srv_tabname
Provide the name of the table or tables associated with a set of browse mode results.FORMAT="LINESPECIFIC"CS_RETCODE srv_tabname(spp, tablenum, tablenamep,FORMAT="LINESPECIFIC"                  namelen)FORMAT="LINESPECIFIC"SRV_PROC          *spp;FORMAT="LINESPECIFIC"CS_INT            tablenum;FORMAT="LINESPECIFIC"CS_CHAR           *tablenamep;FORMAT="LINESPECIFIC"CS_INT            namelen;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.tablenum - The number used to identify the table in subsequent calls to MOREINFO="NONE"srv_tabcolname.tablenamep - A pointer to the name of the table. It cannot be null, as tables always have names.namelen - The length, in bytes, of the table name. If namelen is CS_NULLTERM, then Server Library expects the table name to be null terminated. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_tabname is used to send to a client the name of the table or tables associated with browse mode results.An Open Server application must call MOREINFO="NONE"srv_tabname once for each table involved in the browse mode results.The tablenum must be unique for all the tables described. Tables can be described in any order.An application links browse mode result columns to particular result tables using the MOREINFO="NONE"srv_tabcolname routine. A call to MOREINFO="NONE"srv_tabname must always precede a call to MOREINFO="NONE"srv_tabcolname.REMAP="BO--Body"REMAP="BO--Body"ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include          <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_tabname PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *sproc,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          tablenum,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *tablenameREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_TABNAMEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    An example routine to provide the name of the table**    associated with a set of browse mode results.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    sproc         A pointer to an internal thread control**                  structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    tablenum      The number that will be used to identify**                  the table in subsequent calls to**                  srv_tabcolname.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    tablename     A null terminated string specifying the**                  table name.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED   If the table is successfully described.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL      If an error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE         ex_srv_tabname(sproc, tablenum, tablename)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC           *sproc;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT             tablenum;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR            *tablename;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return( srv_tabname(sproc, tablenum, tablename,               CS_NULLTERM) );REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the table was successfully described.REMAP="BO--Body"CS_FAIL if no action was taken.See AlsoREMAP="BO--Body"LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X62977"srv_tabcolname
MOREINFO="NONE", LINKEND="X90209"Browse Mode
ID="IN10211-251412539"srv_tabname
ID="IN10214-254415540"SRV_TDSVERSIONSRV_TDSVERSION
Retrieve the version number of the TDS protocol that the specified thread uses to communicate with its client connection.FORMAT="LINESPECIFIC"int SRV_TDSVERSION(spp)FORMAT="LINESPECIFIC"SRV_PROC          *spp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"SRV_TDSVERSION retrieves the version number of the TDS (Tabular Data Stream) protocol that the specified thread uses to communicate with a DB-Library client program or SQL Server connection. The version number is returned as an integer. The following table describes the constants defined in ospublic.h as legal return values: TOCENTRY="1"LBL="Table 3-64: " Returns and TDS Version Numbers (MOREINFO="NONE"SRV_TDSVERSION)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="126*"COLNAME="C2" COLWIDTH="121*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ConstantCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_4_0COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TDS Version 4.0. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_4_0_2COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TDS Version 4.0.2. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_4_2COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TDS Version 4.2. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_4_6COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TDS Version 4.6. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_4_9_5COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TDS Version 4.9.5.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_5_0COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TDS Version 5.0.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TDS_NONECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The thread does not have 
a network connection. SRV_TDSVERSION will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_thread_props routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include        <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include        <stdio.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE            ex_srv_tdsversion PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC              *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT                *tdsverREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_TDSVERSIONREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to get the TDS version for a client **     connection.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp     A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    tdsver  A pointer to the variable in which the TDS **            version is returned.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    TDS version obtained successfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE          ex_srv_tdsversion(spp, tdsver)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC            *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT              *tdsver;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_INT       proc_type;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Make sure this thread is of type SRV_TCLIENT. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_thread_props(spp, CS_GET, SRV_T_TYPE, &proc_type,               sizeof(CS_INT), (CS_INT *)NULL) == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Verify that TDS version is valid for this thread. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if ((proc_type != SRV_TCLIENT) && (proc_type !=          SRV_TSUBPROC))REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           fprintf(stderr, "Tds version not valid for this                    thread\n");REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     /* Get the TDS version. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     *tdsver = SRV_TDSVERSION(spp);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return (CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"SRV_TDS_2_0, SRV_TDS_3_4, SRV_TDS_3_4, SRV_TDS_4_0, SRV_TDS_4_0_2, SRV_TDS_4_2, SRV_TDS_4_6, SRV_TDS_4_9_5, SRV_TDS_5_0, or SRV_TDS_NONE. See AlsoREMAP="BO--Body"LINKEND="X78437"srv_pfield
ID="IN10314-257419548"SRV_TDSVERSIONID="X75457"ID="IN10412-260423549"srv_termproc
srv_termproc
Terminate the execution of a thread. FORMAT="LINESPECIFIC"CS_RETCODE srv_termproc(spp)FORMAT="LINESPECIFIC"SRV_PROC       *spp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.CommentsMARK="BULL" REMAP="BU--Bullet"Using MOREINFO="NONE"srv_createproc, Open Server applications can create event driver threads that are not associated with a client connection. MOREINFO="NONE"srv_termproc cannot be used in a SRV_START handler. Do not call MOREINFO="NONE"srv_termproc from interrupt level code; the results are unpredictable. Mutexes, mutex locks, registered procedures, queued events, and messages associated with a thread are destroyed when the thread terminates. The following code fragment illustrates the use of MOREINFO="NONE"srv_termproc:ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include          <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE         ex_srv_termproc PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC           *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_TERMPROCREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Example routine to terminate the execution of a thread using**   srv_termproc.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   spp    A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    Thread successfully terminatedREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE          ex_srv_termproc(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC            *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Terminate the thread.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_termproc(spp) != CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"              return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the thread exists; otherwise, CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X35449"srv_createproc
MOREINFO="NONE", LINKEND="X94254"srv_event
MOREINFO="NONE", LINKEND="X40599"srv_event_deferred
MOREINFO="NONE", LINKEND="X60232"srv_spawn
ID="IN10413-263426557"srv_text_infoID="X13415"srv_text_info
Set or get a description of text or image data. FORMAT="LINESPECIFIC"CS_RETCODE srv_text_info(spp, cmd, item, iodescp)FORMAT="LINESPECIFIC"SRV_PROC      *spp;FORMAT="LINESPECIFIC"CS_INT        cmd;FORMAT="LINESPECIFIC"CS_INT        item;FORMAT="LINESPECIFIC"CS_IODESC     *iodescp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.cmd - The direction of data flow. The following table summarizes the legal values for cmd:TOCENTRY="1"LBL="Table 3-65: "Values for cmd (srv_text_info)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="78*"COLNAME="C2" COLWIDTH="224*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The Open Server application is setting internal 
Server-Library structures to describe text or 
image data. The MOREINFO="NONE"srv_text_info call will update a 
text or image column (inside Open Server) with 
the information in iodescp. (The application 
must have previously described the column 
using MOREINFO="NONE"srv_descfmt.) Typically, this will be 
followed by a call to MOREINFO="NONE"srv_send_text, or MOREINFO="NONE"srv_bind 
and MOREINFO="NONE"srv_xferdata.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Open Server is updating the iodescp structure 
with the total length of the text or image data to 
be read from a client. Typically, this will be 
followed by a call to MOREINFO="NONE"srv_get_text. See the 
comments section below for limitations 
regarding the CS_GET direction. item - The column number of the column being described. The first column in a row is column 1. This parameter is ignored when cmd is CS_GET.iodescp - A pointer to a structure that describes the object name, text pointer, and timestamp for a text column. See the LINKEND="X51586"CS_IODESC Structure
 topics page for details.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_text_info is used to describe text or image columns for sending a result row or retrieving a parameter.If cmd is CS_GET, MOREINFO="NONE"srv_text_info must be called from the SRV_BULK event handler. If cmd is CS_GET, MOREINFO="NONE"srv_text_info must be called prior to a call to MOREINFO="NONE"srv_get_text.If cmd is CS_SET, MOREINFO="NONE"srv_text_info must be called for each text or image datatype column in a row before MOREINFO="NONE"srv_xferdata or MOREINFO="NONE"srv_send_text is called.Text and image data is transferred to a client using either MOREINFO="NONE"srv_bind followed by MOREINFO="NONE"srv_xferdata, or MOREINFO="NONE"srv_send_text.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include          <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_text_info PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          itemREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_IODESC       *iodpREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_TEXT_INFOREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Example routine to set a column's text or image data**     description before transferring a data row, using**     srv_text_info. This example routine would be used in a**     gateway application, where the Open Client application has**     initiated an update of text or image data.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp   A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    item  The column number of the column being described.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    iodp  A pointer to a CS_IODESC structure that describes the **          text or image data (This stucture is passed from the**          Open Client application).REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    Text or image data successfully described.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL      An error occurred was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_text_info(spp, item, iodp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          item;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_IODESC       *iodp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Describe the text or image data for the column.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_text_info(spp, (CS_INT)CS_SET, item, iodp) !=            CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"            return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the text or image data was successfully described.REMAP="BO--Body"CS_FAIL if no action was taken.See AlsoREMAP="BO--Body"LINKEND="X30757"srv_bind
MOREINFO="NONE", srv_bulk_type, LINKEND="X33058"srv_descfmt
MOREINFO="NONE", LINKEND="X23785"srv_get_text
MOREINFO="NONE", LINKEND="X43143"srv_send_text
MOREINFO="NONE", LINKEND="X52699"srv_xferdata
MOREINFO="NONE", LINKEND="X12233"Text and Image
ID="IN10513-266430565"srv_text_infoID="X51398"ID="IN10616-269434566"srv_thread_props
srv_thread_props
Define and retrieve thread properties. FORMAT="LINESPECIFIC"CS_RETCODE srv_thread_props(spp, cmd, property, bufp,FORMAT="LINESPECIFIC"                  buflen, outlenp)FORMAT="LINESPECIFIC"SRV_PROC          *spp;FORMAT="LINESPECIFIC"CS_INT            cmd;FORMAT="LINESPECIFIC"CS_INT            property;FORMAT="LINESPECIFIC"CS_VOID           *bufp;FORMAT="LINESPECIFIC"CS_INT            buflen;FORMAT="LINESPECIFIC"CS_INT            *outlenp;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.cmd - The action to take. The following table summarizes the legal values for cmd:TOCENTRY="1"LBL="Table 3-66: "Values for cmd (srv_thread_props)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="72*"COLNAME="C2" COLWIDTH="288*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The Open Server application is setting the property. In this 
case, bufp should contain the value the property is to be set to, 
and buflen should specify the size, in bytes, of that value.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The Open Server application is retrieving the property. In this 
case, bufp should point to the buffer where the property value 
is placed, and buflen should be the size, in bytes, of the buffer.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CLEARCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The Open Server application is resetting the property to its 
default value. In this case, bufp, buflen, and outlenp are ignored.property - The property being set, retrieved or cleared. See below for a list of this argument's legal values.bufp - A pointer to the Open Server application data buffer where property value information from the client is placed or property value information is retrieved.buflen - The length, in bytes, of the buffer.outlenp - A pointer to a CS_INT variable, which Open Server will set to the size, in bytes, of the property value retrieved. This argument is only used when cmd is CS_GET, and is optional.CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_thread_props is called to define, retrieve, and reset thread properties.The following table summarizes legal property values, whether they can be set or retrieved, and each value's datatype:TOCENTRY="1"LBL="Table 3-67: "Thread Properties and Their Datatypes (srv_thread_props)COLS="5" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="135*"COLNAME="C2" COLWIDTH="72*"COLNAME="C3" COLWIDTH="44*"COLNAME="C4" COLWIDTH="81*"COLNAME="C5" COLWIDTH="82*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"PropertyCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SET/CLEARCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"GETCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"bufp when cmd 
is CS_SET:COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"bufp when cmd 
is CS_GET:VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_APPLNAMECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
character stringCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
character stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_BYTEORDERCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_BULKTYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_BYTEORDERCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_CHARTYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_CLIBCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
character stringCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
character stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_CLIBVERSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
character stringCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
character stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_CLIENTLOGOUTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_BOOLCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_CONVERTSHORTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_BOOLCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_DUMPLOADCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_BOOLCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_EVENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_EVENTDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_VOID 
pointerCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The address of 
a CS_VOID 
pointerCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_FLTTYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_GOTATTENTIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_HOSTNAMECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
character stringCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
character stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_HOSTPROCIDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
character string COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
character stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_IODEADCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_BOOLCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_LOCALECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_LOCALE 
pointerCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_LOCALE 
pointerCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_LOGINTYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_MACHINECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
character stringCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
character stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_NEGLOGINCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_NOTIFYCHARSETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_BOOLCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_NOTIFYDBCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_BOOLCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_NOTIFYLANGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_BOOLCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_NUMRMTPWDSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_PACKETSIZECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_PASSTHRUCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_BOOLCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_PRIORITYCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_PWDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
character stringCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
character stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_RMTPWDSCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to an 
array of 
SRV_RMTPWD
 structuresCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to an 
array of 
SRV_RMTPWD
 structuresCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_RMTSERVERCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
character stringCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
character stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_ROWSENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_SPIDCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_STACKLEFTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_TDSVERSIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_TYPECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_INTCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_USERCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NoCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
character stringCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
character stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_USERDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A CS_VOID 
pointerCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The address of 
a CS_VOID 
pointerCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_USERVLANGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_BOOLCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
CS_BOOLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_USTATECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"YesCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
character stringCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A pointer to a 
character stringThe following table lists the default values for the thread properties that can be defined (CS_SET).TOCENTRY="1"LBL="Table 3-68: "Definable Thread Properties and Their Default Values 
(srv_thread_props)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="135*"COLNAME="C2" COLWIDTH="162*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Property COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Default VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_USERDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(CS_VOID *)NULLCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_USTATECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"NULL stringCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_TDSVERSIONCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Min(client's, server's default)COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_USESRVLANGCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Value of SRV_S_USESRVLANGCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_T_LOCALECOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(CS_LOCALE *)NULLMOREINFO="NONE"srv_thread_props replaces the MOREINFO="NONE"srv_getuserdata, MOREINFO="NONE"srv_pfield, MOREINFO="NONE"srv_setuserdata, and MOREINFO="NONE"srv_setustate routines.MOREINFO="NONE"srv_thread_props replaces the MOREINFO="NONE"SRV_EVENTDATA, MOREINFO="NONE"SRV_GOT_ATTENTION, MOREINFO="NONE"SRV_IODEAD, MOREINFO="NONE"SRV_SITEPROC, and MOREINFO="NONE"SRV_TDSVERSION macros.When the property is being retrieved (CS_GET), if buflen indicates that the user buffer is not big enough to hold the property value, Open Server will place the required number of bytes in *outlenp, and the application buffer will not be modified.See the LINKEND="X51278"Thread Properties
 Topics page, for descriptions and default values for each thread property. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include          <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_thread_props PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *sp,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *user,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          ulen,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          *lenpREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_THREAD_PROPSREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**     Example routine to obtain a client thread's user name via**     srv_thread_props.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**         sp       A pointer to an internal thread control                    structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**         user     A pointer to the address of the user name **                  buffer.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**         ulen     The size of the user name buffer.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**         lenp     A pointer to an integer variable, that will**                  be set to the length of the user name string.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**         CS_TRUE    If the user name was returned succesfully.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**         CS_FALSE   If an error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_thread_props(sp, user, ulen, lenp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *sp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *user;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          ulen;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT          *lenp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Call srv_thread_props to get the user name.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if( srv_thread_props(sp, CS_GET, SRV_T_USER, user,                ulen, lenp) == CS_FAIL )REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           ** An error was already raised.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return CS_FAIL;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** All done.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return CS_SUCCEED;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the property was set, retrieved or cleared.REMAP="BO--Body" CS_FAIL if no action was taken.See AlsoREMAP="BO--Body"LINKEND="X84669"srv_props
MOREINFO="NONE", LINKEND="X51278"Thread Properties
ID="IN10616-272437574"srv_thread_propsID="X66283"ID="IN1079-275441575"SRV_TRACE
SRV_TRACE
Check the status of the specified trace flag. FORMAT="LINESPECIFIC"CS_INT SRV_TRACE(flag)FORMAT="LINESPECIFIC"CS_INT           flag;ParametersREMAP="RI--RefIndent"flag - The trace flag of interest. Trace flags are described below. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"SRV_TRACE checks whether the specified trace flag is enabled or disabled. Trace flags are used for debugging. They cause output to be written to the Open Server log file. Most of the trace flags are used for debugging the Open Server internal code. The following table describes the available trace flags: TOCENTRY="1"LBL="Table 3-69: "Trace Flags Available for SRV_TRACECOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="117*"COLNAME="C2" COLWIDTH="243*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV__TR_TDSHDRCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Display the TDS (Tabular Data Stream) protocol 
packet header information, such as packet type and 
length. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV__TR_TDSDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Display TDS packet contents in hexadecimal and 
ASCII. This displays the actual TDS traffic between 
the client and the Open Server. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV__TR_RUNQCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Display information about the internal run queue. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV__TR_MSGQCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Display information about the message queue. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV__TR_MSGUTILCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Display information about message processing. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV__TR_IOCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Display information about client I/O processing. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV__TR_ATTNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Display information about attention signals from 
the client. REMAP="BO--Body"SRV_TRACE will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_props routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include     <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE ex_srv_trace PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     CS_INT        traceflagREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     ));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_TRACEREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to examine the specified trace flag. REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    traceflag           The flag to check.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEEDREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAILREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_trace(traceflag)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT         traceflag;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     if (SRV_TRACE(traceflag) == 0)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"          return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      elseREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"0 if the trace flag is not set, non-zero otherwise. See AlsoREMAP="BO--Body"LINKEND="X84669"srv_props
ID="IN1079-278444583"SRV_TRACEID="IN10812-281448584"SRV_TRACEOFF
SRV_TRACEOFF
Disable the specified trace flag. FORMAT="LINESPECIFIC"CS_INT SRV_TRACEOFF(flag)FORMAT="LINESPECIFIC"CS_INT             flag;ParametersREMAP="RI--RefIndent"flag - The trace flag of interest. The trace flags are described below. CommentsMARK="BULL" REMAP="BU--Bullet"SRV_TRACEOFF disables the specified trace flag. Trace flags are used for debugging. They cause output to be written to the Open Server log file. Most of the trace flags are used for debugging the Open Server internal code. The following table describes the available trace flags: TOCENTRY="1"LBL="Table 3-70: "Trace Flags Available for SRV_TRACEOFFCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="108*"COLNAME="C2" COLWIDTH="252*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_TDSHDRCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Display the TDS (Tabular Data Stream) protocol packet 
header information, such as packet type and length. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_TDSDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Display TDS packet contents in hexadecimal and ASCII 
format. This displays the actual TDS traffic between the 
client and the Open Server. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_MSGQCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Display information about the message queue. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_ATTNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Display information about attention signals from the 
client. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_TDSTOKE
NCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Display information about the TDS token stream.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_EVENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Display information about which events Open Server 
has triggered.SRV_TRACEOFF will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_props routine provides the same functionality.For further information on tracing behavior, see the LINKEND="X41578"Tailoring Your Open Server
 topics page.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include     <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"extern CS_RETCODE ex_srv_traceoff PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_INT flagREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_TRACEOFFREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Turn off the specified trace parameter.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    flag       Trace flag to disable.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    Trace was successfully disabled.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE ex_srv_traceoff(flag)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT        flag;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if(SRV_TRACEOFF(flag) == (CS_INT)0)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"A non-zero integer. See AlsoREMAP="BO--Body"LINKEND="X84669"srv_props
MOREINFO="NONE", LINKEND="X66283"SRV_TRACE
MOREINFO="NONE", LINKEND="X89645"SRV_TRACEON
MOREINFO="NONE", LINKEND="X41578"Tailoring Your Open Server
ID="IN10812-284451592"SRV_TRACEOFF
ID="IN10811-287454593"SRV_TRACEONID="X89645"SRV_TRACEON
Enable the specified trace flag. FORMAT="LINESPECIFIC"int SRV_TRACEON(flag)FORMAT="LINESPECIFIC"int            flag;ParametersREMAP="RI--RefIndent"flag - The trace flag of interest. The trace flags are described below. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"SRV_TRACEON enables the specified trace flag. Trace flags are used for debugging. They cause output to be written to the standard error output and, in some cases, to the Open Server log file. Most of the trace flags are used for debugging the Open Server internal code. The following table describes the available trace flags: TOCENTRY="1"LBL="Table 3-71: "Trace Flags Available for SRV_TRACEONCOLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="117*"COLNAME="C2" COLWIDTH="234*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_TDSHDRCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Display the TDS (Tabular Data Stream) protocol 
packet header information, such as packet type 
and length. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_TDSDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Display TDS packet contents in hexadecimal and 
ASCII format. This displays the actual TDS traffic 
between the client and the Open Server. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_RUNQCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Display information about the internal run queue. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_MSGQCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Display information about the message queue. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_MSGUTILCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Display information about message processing. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_ATTNCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Display information about attention signals from 
the client. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_TDSTOKENCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Display information about the TDS token stream.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_TR_EVENTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Display information about which events Open 
Server has triggered.SRV_TRACEON will not be supported in future Open Server releases. The new Server-Library MOREINFO="NONE"srv_props routine provides the same functionality.For further information on tracing behavior, see the LINKEND="X41578"Tailoring Your Open Server
 topics page.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID ex_srv_traceon PROTOTYPE((void));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_TRACEONREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to turn on tracing for some trace flags.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    None.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Nothing.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID     ex_srv_traceon()REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Turn on tracing of message queues and TDS data.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      SRV_TRACEON(SRV_TR_MSGQ | SRV_TR_TDSDATA);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"A non-zero integer. See AlsoREMAP="BO--Body"LINKEND="X84669"srv_props
ID="IN10911-290458601"SRV_TRACEONREMAP="BO--Body"ID="X59966"srv_ucwakeup
Unconditionally wake up a sleeping thread. FORMAT="LINESPECIFIC"CS_RETCODE srv_ucwakeup(spp, wakeflags)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_INT           wakeflags;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.wakeflags - A bit mask that modifies the way MOREINFO="NONE"srv_ucwakeup behaves. Just one flag is defined; set wakeflags to 0 if it is not used.REMAP="UN--Under"SRV_M_WAKE_INTR - This flag indicates that the call to MOREINFO="NONE"srv_ucwakeup is from interrupt level code. Failure to set this flag when calling MOREINFO="NONE"srv_ucwakeup from interrupt level code can cause the Open Server application to behave erratically. CommentsMARK="BULL" REMAP="BU--Bullet"Waking a thread with MOREINFO="NONE"srv_ucwakeup causes MOREINFO="NONE"srv_sleep to return SRV_I_INTERRUPTED.Use MOREINFO="NONE"srv_ucwakeup to wake a thread unconditionally. This may be necessary to break a deadlock
 condition or for cleanup. MOREINFO="NONE"srv_ucwakeup cannot be used in a SRV_START handler. If MOREINFO="NONE"srv_ucwakeup is called from interrupt level code, wakeflags must be set to SRV_M_WAKE_INTR.   wakeflags must never be set to SRV_M_WAKE_INTR outside of an interrupt level routine. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Protoype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_ucwakeup PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *sprocREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_PROCREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    An example routine to wake up a sleeping thread from a **    non-interrupt level by using srv_ucwakeup.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    sproc   A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    The specified thread was woken up.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_ucwakeup(sproc)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *sproc;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Wake up the specified thread. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return( srv_ucwakeup(sproc, 0));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"MOREINFO="NONE"srv_ucwakeup returns CS_FAIL if the indicated thread does not exist or was not sleeping. Otherwise, it returns CS_SUCCEED. See AlsoREMAP="BO--Body"LINKEND="X32792"srv_sleep
MOREINFO="NONE", LINKEND="X24476"srv_wakeup
MOREINFO="NONE", LINKEND="X18584"srv_yield
ID="IN43129489"srv_ucwakeupID="X37215"ID="IN4415911210"srv_unlockmutex
srv_unlockmutex
Unlock a mutex. FORMAT="LINESPECIFIC"CS_RETCODE srv_unlockmutex(mutexid)FORMAT="LINESPECIFIC"SRV_OBJID              mutexid;ParametersREMAP="RI--RefIndent"mutexid - The unique mutex identifier that was returned by MOREINFO="NONE"srv_createmutex. mutexid can be obtained from the mutex name with MOREINFO="NONE"srv_getobjid.   CommentsMARK="BULL" REMAP="BU--Bullet"Unlocking a mutex (mutual exclusion semaphore) releases the lock held on the semaphore, allowing other threads to access the mutex. MOREINFO="NONE"srv_unlockmutex cannot be used in a SRV_START handler. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_unlockmutex PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR         *mutex_nameREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_UNLOCKMUTEXREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to illustrate the use of srv_unlockmutex.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**  mutex_name   The name of the mutex to be unlocked.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED Mutex successfully unlocked.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL      An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE     ex_srv_unlockmutex(mutex_name)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_CHAR        *mutex_name;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      SRV_OBJID     id;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_INT        info;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Get the object id for the mutex. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_getobjid(SRV_C_MUTEX, mutex_name, CS_NULLTERM,            &id,  &info) == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /* Call srv_unlockmutex to unlock it. */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_unlockmutex(id) == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return (CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return (CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED or CS_FAIL. See AlsoREMAP="BO--Body"LINKEND="X69149"srv_createmutex
MOREINFO="NONE", LINKEND="X30072"srv_deletemutex
MOREINFO="NONE", LINKEND="X37417"srv_getobjid
ID="IN4415881518"srv_unlockmutexID="X94448"ID="INA4511851919"srv_version
srv_version
Define the version of Open Server an application is using. FORMAT="LINESPECIFIC"CS_RETCODE srv_version(contextp, version)FORMAT="LINESPECIFIC"CS_CONTEXT       *contextp;FORMAT="LINESPECIFIC"CS_INT            version;ParametersREMAP="RI--RefIndent"contextp - A pointer to a CS_CONTEXT structure, which the application has obtained via a call to MOREINFO="NONE"cs_ctx_alloc. The CS_CONTEXT structure serves as a server-wide configuration structure shared with client libraries. For more information on the CS_CONTEXT structure, see  the LINKEND="X61449"CS-Library
 topics page.version -  The version of Open Server the application assumes is in effect. Currently, the only legal value for this parameter is CS_VERSION_100.CommentsMARK="BULL" REMAP="BU--Bullet"An Open Server application must call MOREINFO="NONE"srv_version prior to calling any other Server-Library routines. It must be preceded by a call to the CS-Library routine MOREINFO="NONE"cs_ctx_alloc.Applications can first set localization configuration parameters in the CS_CONTEXT structure, using MOREINFO="NONE"cs_ctx_props.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <stdio.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID    ex_srv_version    PROTOTYPE((void));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#define    VERS_FMT         "Open Server Version = (%s)\n"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_VERSIONREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Retrieve and print out the version string from Open Server.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    None.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    None.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID    ex_srv_version()REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      CS_CHAR    *versionp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      versionp = SRV_GETVERSION();REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      fprintf(stderr,VERS_FMT,versionp);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      return;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if the version and CS_CONTEXT were defined. REMAP="BO--Body"CS_FAIL if an error was detected.See AlsoREMAP="BO--Body"ID="IN4511822227"srv_version
MOREINFO="NONE"cs_ctx_alloc, cs_ctx_props ID="X24476"ID="IN4610792628"srv_wakeup
srv_wakeup
Enable sleeping threads to run. FORMAT="LINESPECIFIC"CS_RETCODE srv_wakeup(sleepeventp, wakeflags,FORMAT="LINESPECIFIC"                   reserved1, reserved2)FORMAT="LINESPECIFIC"CS_VOID          *sleepeventp;FORMAT="LINESPECIFIC"CS_INT           wakeflags;FORMAT="LINESPECIFIC"CS_VOID          *reserved1;FORMAT="LINESPECIFIC"CS_VOID          *reserved2;ParametersREMAP="RI--RefIndent"sleepeventp - A generic void pointer to the operating system event on which the threads are sleeping. wakeflags - A bit mask that modifies the way that MOREINFO="NONE"srv_wakeup behaves. If no bits are set, the default action is to wake up all threads sleeping on the event.The bits can be OR'd together. The following table describes the legal values for wakeflags: TOCENTRY="1"LBL="Table 3-72: "Values for wakeflags (srv_wakeup)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="126*"COLNAME="C2" COLWIDTH="234*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_M_WAKE_INTRCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The call to MOREINFO="NONE"srv_wakeup is from interrupt level code. 
Failure to use this flag when calling MOREINFO="NONE"srv_wakeup 
from interrupt level code can cause the Open 
Server application to behave erratically. Using this flag at non-interrupt level will cause 
the Open Server application to behave erratically.This flag must be used when MOREINFO="NONE"srv_wakeup is used in 
VMS AST routines. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_M_WAKE_FIRSTCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Only the first thread sleeping on the event is made 
runnable. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_M_WAKE_ALLCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Wake up all threads sleeping on the event. reserved1 - This parameter is not used. It must be set to (CS_VOID*)0. reserved2 - This parameter is not used. It must be set to (CS_VOID*)0. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_wakeup wakes threads that are sleeping on sleepevent. When MOREINFO="NONE"srv_wakeup is called from interrupt level code, the actual wakeup is deferred until the scheduler next executes. MOREINFO="NONE"srv_wakeup cannot be used in a SRV_START handler. When writing preemptive mode programs with Open Server, MOREINFO="NONE"srv_wakeup and MOREINFO="NONE"srv_sleep must use platform-dependent mutexes. See the Open Client/Server Supplement for your platform for an example of preemptive scheduling.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE ex_srv_wakeup PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID    *sepREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_WAKEUPREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine using srv_wakeup to make all Open Server**    threads, which were previously sleeping on the specified**    sleep event, runnable again.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    sep    A generic void pointer, which was used previously in**           calls to srv_sleep to suspend threads.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEED    Threads sleeping on the specified sleep event**                  are runnable again.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAIL       An error was detected.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_wakeup(sep)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_VOID         *sep;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      /*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      ** Wake up threads for the specified sleep event, passing      ** zero for reserved fields.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"      if (srv_wakeup(sep, (CS_INT)SRV_M_WAKE_ALL,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           (CS_VOID*)0, (CS_VOID*)0) != CS_SUCCEED)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"           return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"     return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"MOREINFO="NONE"srv_wakeup returns CS_FAIL if no sleeping threads were found for the event or if any parameters were in error. If one or more sleeping threads were found, MOREINFO="NONE"srv_wakeup returns CS_SUCCEED. See AlsoREMAP="BO--Body"LINKEND="X32792"srv_sleep
ID="IN4610762936"srv_wakeup
ID="IN4615733237"srv_willconvertID="X84513"srv_willconvert
Determine whether a specific datatype conversion is available within Open Server. FORMAT="LINESPECIFIC"CS_BOOL srv_willconvert(srctype, desttype)FORMAT="LINESPECIFIC"CS_INT           srctype;FORMAT="LINESPECIFIC"CS_INT           desttype;ParametersREMAP="RI--RefIndent"srctype - The datatype of the data that is to be converted. This parameter can be any of the Open Server datatypes listed in the first table below. desttype - The datatype that the source data is to be converted into. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_willconvert allows you to determine whether MOREINFO="NONE"srv_willconvert is capable of performing a specific datatype conversion. When MOREINFO="NONE"srv_willconvert is asked to perform a conversion that it doesn't support, it calls the programmer-supplied error handler, if any, and returns CS_FAIL. MOREINFO="NONE"srv_willconvert can convert data stored in any of the following Open Server datatypes:REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"SRVCHAR SRVVARCHAR SRVBINARY SRVVARBINARY SRVINT1 SRVINT2 SRVINT4 SRVREAL SRVFLT8 SRVBIT SRVDATETIME SRVDATETIME4 SRVMONEY SRVMONEY4 The table below summarizes the datatype conversions that MOREINFO="NONE"srv_willconvert supports. The source datatypes are listed down the leftmost column and the destination datatypes are listed along the top row of the table. For brevity, the prefix "SRV" has been eliminated from each datatype. If MOREINFO="NONE"srv_willconvert returns T (CS_TRUE), the conversion is supported; if it returns F (CS_FALSE), the conversion is not supported. TOCENTRY="1"LBL="Table 3-73: "Datatype Conversions Supported (srv_willconvert)COLS="7" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="57*"COLNAME="C2" COLWIDTH="34*"COLNAME="C3" COLWIDTH="46*"COLNAME="C4" COLWIDTH="36*"COLNAME="C5" COLWIDTH="55*"COLNAME="C6" COLWIDTH="51*"COLNAME="C7" COLWIDTH="77*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0" From:COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"To:COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C7" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"charCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"binaryCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"bitCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"int1, int2, int4real, flt8COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"moneymoney4COLNAME="C7" ALIGN="LEFT" ROTATE="0" MOREROWS="0"datetimedatetime4 VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"charCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C7" ALIGN="LEFT" ROTATE="0" MOREROWS="0"T COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"binaryCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C7" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"bitCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FCOLNAME="C7" ALIGN="LEFT" ROTATE="0" MOREROWS="0"T COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"int1 int2, 
int4, real, 
flt8COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C7" ALIGN="LEFT" ROTATE="0" MOREROWS="0"F COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"money 
money4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"T COLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"T COLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"T COLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"T COLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"T COLNAME="C7" ALIGN="LEFT" ROTATE="0" MOREROWS="0"F  COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"datetime 
datetime4COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TCOLNAME="C4" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FCOLNAME="C5" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FCOLNAME="C6" ALIGN="LEFT" ROTATE="0" MOREROWS="0"FCOLNAME="C7" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TA conversion to or from the SRVBINARY datatype is a straight bit-copy, except when the conversion involves SRVCHAR. When converting SRVCHAR data to SRVBINARY, MOREINFO="NONE"srv_willconvert interprets the SRVCHAR string as hexadecimal, whether or not the string contains a leading "0x". When converting SRVBINARY data to SRVCHAR, MOREINFO="NONE"srv_willconvert creates a hexadecimal string without a leading "0x". Converting a SRVMONEY or SRVCHAR value to SRVFLT8 can result in some loss of precision. Converting a SRVFLT8 value to SRVCHAR can also result in some loss of precision. Converting a SRVFLT8 value to SRVMONEY can result in overflow, because the maximum value for SRVMONEY is $922,337,203,685,477.58. If overflow occurs when converting integer or float data to SRVCHAR, the first position of the resulting character array will contain an asterisk ("*") to indicate the error. It can be useful to convert a datatype to itself. For instance, a conversion of SRVCHAR to SRVCHAR with a destlen of -1 appends a null terminator to a string. For more information on Open Server datatypes, see  the LINKEND="X87730"Types
 topics page. MOREINFO="NONE"srv_willconvert will not be supported in future Open Server releases. The new CS-Library MOREINFO="NONE"cs_willconvert routine provides the same functionality.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include    <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_BOOL    ex_srv_willconvert PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     stype,REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     dtypeREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_WILLCONVERTREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    Example routine to check if a conversion is supported, via**    srv_willconvert.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**        stype    The source data type.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** dtype   The destination data type.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**         CS_TRUE if the conversion is supported.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**         CS_FALSE if the conversion is not supported.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_BOOL    ex_srv_willconvert(stype, dtype)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     stype;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_INT     dtype;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return srv_willconvert(stype, dtype);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_TRUE if the datatype conversion is supported; CS_FALSE if the conversion is not supported. See AlsoREMAP="BO--Body"MOREINFO="NONE"cs_convert, cs_willconvert, LINKEND="X87730"Types
ID="IN4715703645"srv_willconvert
ID="IN4712673946"srv_xferdataID="X52699"srv_xferdata
Send parameters or data to a client, or receive parameters or data from a client. FORMAT="LINESPECIFIC"CS_RETCODE srv_xferdata(spp, cmd, type)FORMAT="LINESPECIFIC"SRV_PROC         *spp;FORMAT="LINESPECIFIC"CS_INT           cmd;FORMAT="LINESPECIFIC"CS_INT           type;ParametersREMAP="RI--RefIndent"spp - A pointer to an internal thread control structure.cmd - cmd indicates whether the data is going out to a client or coming in from a client. The following table describes the legal values for cmd:TOCENTRY="1"LBL="Table 3-74: "Values for cmd (srv_xferdata)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="54*"COLNAME="C2" COLWIDTH="252*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DescriptionVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The application is calling MOREINFO="NONE"srv_xferdata to send data to a 
client.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GETCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The application is calling MOREINFO="NONE"srv_xferdata to retrieve data 
from a client.type - The type of data stored into or read from the program variable. The following table describes the valid types and their appropriate context:TOCENTRY="1"LBL="Table 3-75: "Values for type (srv_xferdata)COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="117*"COLNAME="C2" COLWIDTH="135*"COLNAME="C3" COLWIDTH="108*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"TypeCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Valid cmdCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Description of DataVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_RPCDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SET or CS_GETCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"RPC parameterCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_ROWDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SET onlyCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Result row columnCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_CURDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GET onlyCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Cursor parameterCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_KEYDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_GET onlyCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Cursor key columnCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_ERRORDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SET onlyCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Error message 
parameterCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_DYNDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SET or CS_GETCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Dynamic SQL 
parameterCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_NEGDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SET or CS_GETCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Negotiated login 
parameterCOLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MSGDATACOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_SET or CS_GETCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Message parameterCommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_xferdata is used to send parameter or row data to a client (CS_SET), or retrieve parameter or key data from a client. Specifically, it moves data out of local program variables and across the network to the client (CS_SET), or across the network from a client and into local program variables (CS_GET).The data as it must appear to the client (CS_SET) or appeared to the client (CS_GET) must have previously been described using MOREINFO="NONE"srv_descfmt. The application must also have previously called MOREINFO="NONE"srv_bind to define local program variables.MOREINFO="NONE"srv_xferdata must be called once for each parameter stream (CS_GET, CS_SET) or once for each data row (CS_SET).MOREINFO="NONE"srv_xferdata and the newMOREINFO="NONE" srv_bind and MOREINFO="NONE"srv_descfmt routines replace the old MOREINFO="NONE"srv_paramdata routine.MOREINFO="NONE"srv_xferdata generalizes and replaces the functionality of MOREINFO="NONE"srv_sendrow.ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_xferdata PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC       *sppREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_XFERDATAREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    This routine will send error message parameters to the**    specified client.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    spp    A pointer to an internal thread control structure.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** ReturnsREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEEDREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAILREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE      ex_srv_xferdata(spp)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"SRV_PROC        *spp;REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    /* Check arguments.   */REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if(spp == (SRV_PROC *)NULL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    return(srv_xferdata(spp,CS_SET,SRV_ERRORDATA));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"CS_SUCCEED if transfer out of or into local program variables succeeded.REMAP="BO--Body"CS_FAIL if an error was detected.See AlsoREMAP="BO--Body"LINKEND="X30757"srv_bind
MOREINFO="NONE", LINKEND="X33058"srv_descfmt
ID="INA4812644354"srv_xferdataID="X18584"srv_yieldID="IN499614755"srv_yield
Allow another thread to run. FORMAT="LINESPECIFIC"CS_RETCODE srv_yield()CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"srv_yield suspends the current thread and allows another runnable thread of the same or higher priority to run. The thread is rescheduled at a later time. MOREINFO="NONE"srv_yield is primarily useful when using non-preemptive scheduling. The thread that calls MOREINFO="NONE"srv_yield will resume execution at the statement following MOREINFO="NONE"srv_yield. MOREINFO="NONE"srv_yield cannot be used in a SRV_START handler. Do not call MOREINFO="NONE"srv_yield from interrupt level code. ExampleREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <stdio.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"#include   <ospublic.h>REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/*REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Local Prototype.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE ex_srv_yield PROTOTYPE((REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    ));REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"/* REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** EX_SRV_YIELDREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**   Example routine to suspend the current thread.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Arguments:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    None.REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"** Returns:REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_SUCCEEDREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"**    CS_FAILREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"*/REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"CS_RETCODE    ex_srv_yield()REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"{REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    printf("I'll wait this one out...\n");REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    if (srv_yield() == CS_FAIL)REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        printf("srv_yield() failed.\n");REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_FAIL);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    elseREMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    {REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        printf("I'm back!\n");REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"        return(CS_SUCCEED);REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"    }REMAP="COW--CompOutWide" FORMAT="LINESPECIFIC"}ReturnsREMAP="BO--Body"None. See AlsoREMAP="BO--Body"LINKEND="X32792"srv_sleep
MOREINFO="NONE", LINKEND="X59966"srv_ucwakeup
MOREINFO="NONE", LINKEND="X24476"srv_wakeup
ID="IN499585062"srv_yieldREMAP="BO--Body"NUMBER="4" ID="X44444"System Registered ProceduresREMAP="BO--Body"This section contains a reference page for each Server-Library system registered procedure. System registered procedures are the registered procedures built into Open Server. When the server initializes, it registers these procedures so that they are available in every Open Server run-time system. The reference pages for the procedures describe their parameters and the results and messages they return.REMAP="BO--Body"For additional information on system registered procedures, see the LINKEND="X80111"Registered Procedures
 topics page, in Chapter 2.ID="X23967"sp_psID="IN4359751"sp_ps
Return detailed status information on specified Open Server threads. FORMAT="LINESPECIFIC"sp_ps [loginame | 'spid']ParametersREMAP="RI--RefIndent"loginame - The user's login name. spid - The internal identification number of the thread to report on. You can obtain the spid from the output of a previous MOREINFO="NONE"sp_who or MOREINFO="NONE"sp_ps call. By default, all threads are listed. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"sp_ps reports the detailed status of a specified server thread or all current Open Server threads. The information is useful for debugging during application development. loginame and spid are character string parameters. When using isql to execute MOREINFO="NONE"sp_ps as a remote procedure call from a SQL Server, surround the spid in quotes to avoid a syntax error. If you do not specify loginame or spid, MOREINFO="NONE"sp_ps lists all current threads. The following table summarizes the information MOREINFO="NONE"sp_ps returns: TOCENTRY="1"LBL="Table 4-1: "Information Returned (sp_ps)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="99*"COLNAME="C2" COLWIDTH="261*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Type of InformationCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"spidCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The internal thread number of the thread. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Login NameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The name of the logged in user. Applies only to client 
threads. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Host NameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"For a client task, this is the name of the client's machine. 
For site handlers and server-to-server RPC connections, 
this is the name of the remote SQL Server. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Program NameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The name of the client application program. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Task TypeCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The type of thread. The legal values are NETWORK, 
CLIENT, SERVER, SITE HANDLER, CHILD, SERVICE, 
and UNKNOWN. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"StatusCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The current status of the thread. The legal values for this 
column are running, runnable, sleeping, sick, free, 
stopped, spawned, terminal, and unknown. The one 
"running" task is the thread that is executing MOREINFO="NONE"sp_ps. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Sleep EventCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The event that will cause a sleeping thread to become 
runnable. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Sleep LabelCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A character string label that describes the sleep event. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Current CommandCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A character string that describes the state of the thread. 
The contents of this column are set by the 
MOREINFO="NONE"srv_thread_props routine. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Blocked ByCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(Not currently used.) COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Run TicksCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"(Not currently used.) COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Current PriorityCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The priority at which the thread is running. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Stack OriginCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The address in memory where the thread's stack begins. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Net WritesCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of network writes since the thread started. 
This number applies only to site handler and client 
threads. COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Net ReadsCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The number of network reads since the thread started. 
This number applies only to site handler and client 
threads. ExamplesNUMERATION="ARABIC" REMAP="E1--ExampleOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"1>execute utility...sp_ps 2>go REMAP="COW10--CompOutWide10pt" FORMAT="LINESPECIFIC"                                                                                                                           spid  Login Name Host Name     Program Name  Task Type         ... ----  ---------- ---------     ------------  --------------    ...    1                                         SERVER TASK       ...    2                                         SERVER TASK       ...    3                                         SERVER TASK       ...    4                                         SERVICE TASK      ...   11             hiram                       SITE HANDLER TASK ...   14  bud        sonoma        isql          CHILD TASK        ...  REMAP="COW10--CompOutWide10pt" FORMAT="LINESPECIFIC"...   Status     Sleep Event   Sleep Label       Current Command    ......   -------    -----------   -----------       ---------------    ......   runnable   369448                          NETWORK HANDLER    ......   sleeping   369544        MSG AVAILABLE     CONNECT HANDLER    ......   sleeping   369640        MSG AVAILABLE     DEFERRED HANDLER   ......   runnable        0                          SCHEDULER          ......   sleeping   369736        MSG AVAILABLE                        ......   running    416480                                             ...REMAP="COW10--CompOutWide10pt" FORMAT="LINESPECIFIC"REMAP="COW10--CompOutWide10pt" FORMAT="LINESPECIFIC" ...  Blocked    Run     Current     Stack      Net       Net  ...       By  Ticks    Priority    Origin    Writes    Reads  ...  -------  ------   --------   --------   ------   -----  ...        0       0         8     2794336        0       0  ...        0       0         8     2810792        0       0  ...        0       0         8     2827184        0       0  ...        0       0        15     2843576        0       0  ...        0       0         8     2859968        2       7  ...        0       0         8     2909208        3       0 REMAP="BO--Body"This example shows isql output from the MOREINFO="NONE"sp_ps procedure. For printing purposes, the report was split where indicated by ellipses. ReturnsREMAP="BO--Body"The following table summarizes the results returned as rows with these columns: TOCENTRY="1"LBL="Table 4-2: "Format of Information Returned (sp_ps) COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="117*"COLNAME="C2" COLWIDTH="99*"COLNAME="C3" COLWIDTH="130*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Column NameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Length VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"spidCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_INT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4 COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Login NameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CHAR_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAXNAME COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Host NameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CHAR_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAXNAME COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Program NameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CHAR_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAXNAME COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Task TypeCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CHAR_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAXNAME COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"StatusCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CHAR_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAXNAME COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Sleep EventCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_INT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4 COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Sleep LabelCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CHAR_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAXNAME COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Current CommandCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CHAR_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"SRV_MAXNAME COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Blocked ByCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_INT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4 COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Run TicksCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_INT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4 COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Current PriorityCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_INT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4 COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Stack OriginCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_INT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4 COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Net WritesCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_INT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4 COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Net ReadsCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_INT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4 See AlsoREMAP="BO--Body"LINKEND="X93206"sp_terminate
MOREINFO="NONE", LINKEND="X31322"sp_who
ID="IN4359489"sp_ps
 ID="X83559"sp_regcreateID="IN4412911210"sp_regcreate
Create a registered procedure in Open Server. FORMAT="LINESPECIFIC"sp_regcreate proc_nameParametersREMAP="RI--RefIndent"proc_name - The name of the procedure to be registered. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"sp_regcreate creates registered procedures without parameters. To create registered procedures with parameters, use MOREINFO="NONE"srv_regdefine, MOREINFO="NONE"srv_regparam, and MOREINFO="NONE"srv_regcreate in Server-Library programs, or use MOREINFO="NONE"dbnpdefine, MOREINFO="NONE"dbregparam, and MOREINFO="NONE"dbnpcreate in DB-Library programs. The Open Server run-time system executes MOREINFO="NONE"sp_regcreate internally when a client creates a registered procedure using MOREINFO="NONE"dbnpcreate. ExamplesNUMERATION="ARABIC" REMAP="E1--ExampleOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"dbnpdefine(dbproc, "pricechange", DBNULLTERM); dbregparam(dbproc, "@current_price", DBNULLTERM,           SYBMONEY, DBNODEFAULT, NULL); dbregparam(dbproc, "@sequence_num", DBNULLTERM,           SYBINT4, DBNODEFAULT, NULL); status = dbnpcreate(dbproc);  if (status == FAIL) { fprintf(stderr,      "Could not create pricechange procedure.\n"); } REMAP="UN--Under"This example creates a registered procedure named pricechange with two parameters. The first parameter is @current_price and is represented using the SYBMONEY datatype. The second parameter is @sequence_num and is a SYBINT4 datatype. Neither parameter has a default value. REMAP="UN--Under"The following table summarizes the calls a SRV_C_PROCEXEC callback handler would use to find that the pricechange procedure is being registered:TOCENTRY="1"LBL="Table 4-3: "Returns (sp_who)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="189*"COLNAME="C2" COLWIDTH="171*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Function CallCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0" VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_procname(srvproc, (int *) NULL)COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE""sp_regcreate" COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_rpcparamsCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE"3 COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_paramdataCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE""pricechange" COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_paramdata)COLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE""@current_price"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"srv_paramdataCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MOREINFO="NONE""@sequence_num" MessagesREMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"proc_name was registered successfully.REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"proc_name is already registered.REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"Unable to register proc_name.See AlsoREMAP="BO--Body"LINKEND="X75317"sp_regdrop
, LINKEND="X99023"sp_regnowatch
, LINKEND="X23303"sp_regwatch
, LINKEND="X64731"srv_regdefine
, LINKEND="X27023"srv_regexec
, LINKEND="X59376"srv_reginit
, LINKEND="X60481"srv_regparamID="X75317"sp_regdropID="IN4510881618"sp_regdrop
Remove a procedure from the list of registered procedures. FORMAT="LINESPECIFIC"sp_regdrop proc_nameParametersREMAP="RI--RefIndent"proc_name - The name of the registered procedure to remove. CommentsMARK="BULL" REMAP="BU--Bullet"When a procedure is unregistered, clients that have pending notification requests receive a message to indicate that the procedure is no longer registered. MOREINFO="NONE"sp_regdrop executes when a client executes dbnpdrop
. The SRV_C_PROCEXEC callback handler can use MOREINFO="NONE"srv_rpcname to find that MOREINFO="NONE"sp_regdrop is executing. Then it can obtain a pointer to parameter number 1, proc_name, using MOREINFO="NONE"srv_bind and MOREINFO="NONE"srv_xferdata. ExamplesNUMERATION="ARABIC" REMAP="E1--ExampleOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"1>execute stock...sp_regdrop pricechange 2>go REMAP="UN--Under"In this example, a client logged into SQL Server with isql uses a server-to-server remote procedure call to execute MOREINFO="NONE"sp_regdrop on the stock Open Server application. The procedure deletes the pricechange registered procedure from stock. dbrpcinit(dbproc, "sp_regdrop", NULL); dbrpcparam(dbproc, "proc_name", NULL, SYBCHAR, -1, 11, "pricechange"); dbrpcsend(dbproc); REMAP="UN--Under"This example uses the DB-Library RPC routines to execute MOREINFO="NONE"sp_regdrop with a single parameter "pricechange". This causes the MOREINFO="NONE"sp_regdrop system procedure to delete the pricechange registered procedure from Open Server. MessagesREMAP="BO--Body"proc_name has been unregistered.REMAP="UN--Under"The procedure specified with the proc_name parameter was successfully unregistered. REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"proc_name is not a registered procedure.REMAP="UN--Under"The procedure specified with the proc_name parameter was not registered with Open Server. REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC"Unable to unregister proc_name.REMAP="UN--Under"Open Server was unable to unregister the procedure for some other reason. See AlsoREMAP="BO--Body"LINKEND="X75317"sp_regdrop
MOREINFO="NONE", LINKEND="X27023"srv_regexec
MOREINFO="NONE", LINKEND="X59376"srv_reginit
MOREINFO="NONE", LINKEND="X60481"srv_regparamID="X91389"ID="IN4610852026"sp_reglist
sp_reglist
List all registered procedures in Open Server. FORMAT="LINESPECIFIC"sp_reglist CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"sp_reglist returns, as row data, the names of all of the procedures currently registered in Open Server. In a C program, you can also use MOREINFO="NONE"sp_reglist to list the registered procedures. ExamplesNUMERATION="ARABIC" REMAP="E1--ExampleOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"1>execute utility...sp_reglist 2>go REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC" Procedure Name                   ------------------------------   sp_who                           sp_terminate                     sp_regwatch                      sp_ps                            sp_regdrop                       sp_reglist                       sp_regwatchlist                  sp_regcreate                     sp_regnowatch                    (0 rows affected) REMAP="UN--Under"This isql example lists all of the currently registered procedures. ReturnsREMAP="BO--Body"Results are returned in rows containing a single char column with a data length of SRV_MAXNAME characters. See AlsoREMAP="BO--Body"LINKEND="X83559"sp_regcreate
MOREINFO="NONE", LINKEND="X75317"sp_regdrop
MOREINFO="NONE", LINKEND="X23303"sp_regwatch
MOREINFO="NONE", LINKEND="X76178"sp_regwatchlist
ID="IN4610822333"sp_reglist
 ID="X99023"ID="IN4713792734"sp_regnowatch
sp_regnowatch
Remove a client from the notification list for a procedure. FORMAT="LINESPECIFIC"sp_regnowatch proc_nameParametersREMAP="RI--RefIndent"proc_name - The name of the registered procedure. CommentsMARK="BULL" REMAP="BU--Bullet"This registered procedure executes when a client calls MOREINFO="NONE"dbregnowatch. A SRV_C_PROCEXEC callback handler can use MOREINFO="NONE"srv_rpcname to determine that MOREINFO="NONE"sp_regnowatch is executing and MOREINFO="NONE"sp_paramdata to obtain the name of the procedure for which the notification request is to be removed. ExamplesNUMERATION="ARABIC" REMAP="E1--ExampleOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"dbrpcinit(dbproc, "sp_regnowatch", (DBUSMALLINT)           0); dbrpcparam(dbproc, "@proc_name", 0, SYBCHAR, 15,           15, "pricechange"); dbrpcsend(dbproc); REMAP="UN--Under"This example removes the client from the notification list for the pricechange registered procedure. MessagesREMAP="BO--Body"MOREINFO="NONE"Notification request removed.REMAP="BO--Body"The notification request was removed successfully. REMAP="BO--Body"proc_nameMOREINFO="NONE" is not a registered procedure.REMAP="BO--Body"The procedure specified by proc_name is not registered in Open Server. REMAP="BO--Body"MOREINFO="NONE"No requests pending.REMAP="BO--Body"The client had no notification requests pending for the procedure. REMAP="BO--Body"MOREINFO="NONE"Unable to remove notification request.REMAP="BO--Body"Open Server failed to remove the notification request. See AlsoREMAP="BO--Body"LINKEND="X83559"sp_regcreate
MOREINFO="NONE", LINKEND="X75317"sp_regdrop
MOREINFO="NONE", LINKEND="X23303"sp_regwatch
MOREINFO="NONE", LINKEND="X99023"sp_regnowatch
MOREINFO="NONE", LINKEND="X23303"sp_regwatch
ID="IN4713763042"sp_regnowatch
 ID="X23303"ID="IN4811733443"sp_regwatch
sp_regwatch
Add the client to the notification list for a registered procedure. FORMAT="LINESPECIFIC"sp_regwatch proc_name [options]ParametersREMAP="RI--RefIndent"proc_name - The name of the registered procedure the client wishes notification for. options - An integer that specifies whether to notify the client just once or every time the procedure executes. If options is SRV_NOTIFY_ONCE, Open Server removes the client from the notification list after it delivers a notification. If options is SRV_NOTIFY_ALWAYS, Open Server will notify the client every time the procedure executes until the client disconnects or calls MOREINFO="NONE"srv_regnowatch or MOREINFO="NONE"dbregnowatch. The default is SRV_NOTIFY_ALWAYS. CommentsMARK="BULL" REMAP="BU--Bullet"Open Server executes MOREINFO="NONE"sp_regwatch internally when a client calls MOREINFO="NONE"dbnpwatch. If the procedure is dropped while a client is waiting for a notification, the client receives an error message indicating that the procedure is no longer registered. ExamplesNUMERATION="ARABIC" REMAP="E1--ExampleOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"dbrpcinit(dbproc, "sp_regwatch", (DBUSMALLINT) 0); dbrpcparam(dbproc, "@proc_name", 0, SYBCHAR,               15, 15, "pricechange"); dbrpcsend(dbproc); REMAP="UN--Under"This example adds the client to the notification list for a procedure called pricechange. Whenever the procedure executes, this client receives a notification. optionval = SRV_NOTIFY_ONCE; dbrpcinit(dbproc, sp_regwatch, (DBUSMALLINT)          DBWAIT); dbrpcparam(dbproc, "@proc_name", 0, SYBCHAR,            15, 15, pricechange"); dbrpcparam(dbproc, "@options", 0, SYBINT4, -1,            -1, &optionval); dbrpcsend(dbproc); REMAP="UN--Under"This example adds the client to the notification list for a procedure called pricechange. It receives notification that the procedure executed just once. MessagesREMAP="BO--Body"MOREINFO="NONE"Notification request added.REMAP="BO--Body"The notification request was added successfully. REMAP="BO--Body"proc_nameMOREINFO="NONE" is not a registered procedure.REMAP="BO--Body"The procedure specified with the proc_name parameter is not registered with Open Server. REMAP="BO--Body"MOREINFO="NONE"Unable to add notification request.REMAP="BO--Body"Open Server was unable to add the request for some other reason. See AlsoREMAP="BO--Body"LINKEND="X83559"sp_regcreate
MOREINFO="NONE", LINKEND="X99023"sp_regnowatch
MOREINFO="NONE", LINKEND="X75317"sp_regdrop
ID="IN4811703751"sp_regwatch
 ID="X76178"ID="IN4915674152"sp_regwatchlist
sp_regwatchlist
List the registered procedures for which the client has requested notifications. FORMAT="LINESPECIFIC"sp_regwatchlist CommentsMARK="BULL" REMAP="BU--Bullet"Open Server executes MOREINFO="NONE"sp_regwatchlist internally when a client calls MOREINFO="NONE"dbregwatchlist. A SRV_C_PROCEXEC callback handler can call MOREINFO="NONE"srv_rpcname to establish that MOREINFO="NONE"sp_regwatchlist is executing. ExamplesNUMERATION="ARABIC" REMAP="E1--ExampleOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"1>execute utility...sp_regwatchlist 2>go REMAP="CO--ComputerOutput" FORMAT="LINESPECIFIC" Procedure Name                   ------------------------------   pricechange REMAP="UN--Under"This isql example of a server-to-server RPC indicates that the client has requested notification for the pricechange registered procedure. ReturnsREMAP="BO--Body"Results are returned in rows containing a single char column of SRV_MAXNAME characters. See AlsoREMAP="BO--Body"LINKEND="X91389"sp_reglist
MOREINFO="NONE", LINKEND="X76178"sp_regwatchlist
ID="IN4915644459"sp_regwatchlist
 ID="IN5013614860"sp_serverinfo
sp_serverinfo
Send information about a character set or sort order to a client.FORMAT="LINESPECIFIC"sp_serverinfo    function [name]ParametersREMAP="RI--RefIndent"function - The following table summarizes the legal values for function:TOCENTRY="1"LBL="Table 4-4: "Values for function (sp_serverinfo)COLS="2" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="90*"COLNAME="C2" COLWIDTH="351*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"ValueCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"MeaningVALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"server_csnameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The name of the character set for the Open Server application will be sent as 
a one, single column, character row to the client.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"server_sonameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"The name of the Open Server application sort order will be sent as one, single 
column, character row to the client.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"csdefinitionCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A row containing the character set definition will be sent to the client. The 
row consists of three columns: type as a CS_SMALLINT_TYPE, ID as a 
CS_TINYINT_TYPE, and the character set definition as a CS_IMAGE_TYPE.COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"sodefinitionCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"A row containing the sort order definition will be sent to the client. The row 
consists of three columns: type as a CS_SMALLINT_TYPE, ID as a 
CS_TINYINT_TYPE, and the sort order definition as a CS_IMAGE_TYPE.name - The character set or sort order name. name need only be provided if function is set to csdefinition or sodefinition.CommentsMARK="BULL" REMAP="BU--Bullet"The remote procedure sp_serverinfo is automatically registered and handled as a standard system procedure, e.g., sp_who. When sp_serverinfo is received as an RPC Open Server handles it automatically. The application code need not be involved.If a client sends an sp_serverinfo request via a language request, this stored procedure must be executed using the registered procedure routines to send the correct response.The information is sent to a client as a row.ID="X93206"sp_terminateID="IN5112585265"sp_terminate
Terminate an Open Server thread. FORMAT="LINESPECIFIC"sp_terminate spid [, options]ParametersREMAP="RI--RefIndent"spid - The thread ID. This can be obtained with the MOREINFO="NONE"sp_who procedure or by calling MOREINFO="NONE"srv_thread_props. options - Determines whether the thread is terminated immediately or by a queued disconnect event. Specify "deferred" to queue a disconnect event that occurs after previous events are handled. This is the default action. Specify "immediate" to terminate the thread immediately, ignoring current or queued events for the thread. CommentsMARK="BULL" REMAP="BU--Bullet"Use MOREINFO="NONE"sp_who or MOREINFO="NONE"sp_ps to find the spid for the thread to be terminated. In a Server-Library program, use MOREINFO="NONE"srv_termproc to terminate a thread. ExamplesNUMERATION="ARABIC" REMAP="E1--ExampleOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"1> execute utility...sp_who 2> go REMAP="COW10--CompOutWide10pt" FORMAT="LINESPECIFIC" spid  status     loginame      hostname   blk    cmd               ----- ---------- ------------ ---------- ----  ----------------1     runnable                              0    NETWORK HANDLER2     sleeping                              0    CONNECT HANDLER3     sleeping                              0    DEFERRED HANDLER4     runnable                              0    SCHEDULER12    runnable    ned           sonoma      0    PRINT TASK24    running     bud           sonoma      0 (0 rows affected) REMAP="UN--Under"This example shows how to use isql to locate and terminate an errant server thread.   The thread terminates immediately.NUMERATION="ARABIC" REMAP="E1--ExampleOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"1> execute utility...sp_terminate 12, "immediate" 2> go spid = 12; dbrpcinit(dbproc, "sp_terminate", (DBUSMALLINT) 0); dbrpcparam(dbproc, "@spid", 0, SYBINT4, -1,            -1, &spid); dbrpcparam(dbproc, "@options", 0, SYBCHAR, 9,            9, "deferred"); dbrpcsend(dbproc); REMAP="UN--Under"This DB-Library example queues a SRV_DISCONNECT event for the thread with the thread. The next time the thread becomes runnable, it receives the disconnect event and terminates. MessagesREMAP="BO--Body"spid terminated.REMAP="BO--Body"spid scheduled for termination.REMAP="BO--Body"spid not currently in use.See AlsoREMAP="BO--Body"LINKEND="X31322"sp_who
MOREINFO="NONE", LINKEND="X75457"srv_termproc
ID="IN5112555573"sp_terminate
 ID="X31322"ID="IN526525974"sp_who
sp_who
Return status information for specified Open Server threads. FORMAT="LINESPECIFIC"sp_who [loginame | 'spid']ParametersREMAP="RI--RefIndent"loginame - The user's login name. spid - The internal identification number of the thread to report on. The spid can be obtained from the output of a previous MOREINFO="NONE"sp_ps or MOREINFO="NONE"sp_who call. If no spid is specified, all threads are listed. CommentsMARK="BULL" REMAP="BU--Bullet"MOREINFO="NONE"sp_who reports status information about a specified server thread or all current Open Server threads. The output from the MOREINFO="NONE"sp_who system registered procedure matches the output from the SQL Server MOREINFO="NONE"sp_who system procedure. MOREINFO="NONE"sp_who returns a subset of the information that MOREINFO="NONE"sp_ps returns. loginame and spid are character string parameters. When using isql to execute MOREINFO="NONE"sp_who as a remote procedure call from a SQL Server, surround the spid in quotes to avoid a syntax error. If you do not specify loginame or spid, MOREINFO="NONE"sp_who lists all current threads. MOREINFO="NONE"sp_who returns the following information: REMAP="UN--Under"spid - The internal thread number of the thread. REMAP="UN--Under"status - The current status of the thread. The values for this column are: REMAP="UN--Under"running REMAP="UN--Under"runnable REMAP="UN--Under"sleeping REMAP="UN--Under"sick REMAP="UN--Under"free REMAP="UN--Under"stopped REMAP="UN--Under"spawned REMAP="UN--Under"terminal REMAP="UN--Under"unknown REMAP="UN--Under"The one "running" task is the thread that is executing MOREINFO="NONE"sp_who. REMAP="UN--Under"loginame - The name of the logged in user. Applies only to client threads. REMAP="UN--Under"hostname - For a client task, this is the name of the client's machine. For a site handler thread, it is the name of the remote SQL Server. REMAP="UN--Under"blk - This field is unused and is always set to 0. REMAP="UN--Under"cmd - A character string that describes the state of the thread. The contents of this column are set by the MOREINFO="NONE"srv_thead_props routine. ExamplesNUMERATION="ARABIC" REMAP="E1--ExampleOne" CONTINUATION="RESTARTS" INHERITNUM="IGNORE"1>execute utility...sp_who 2>goREMAP="COW10--CompOutWide10pt" FORMAT="LINESPECIFIC"  spid    status     loginame     hostname   blk cmd               -------- ---------- ------------ ---------- --- ----------------       1 runnable                           0   NETWORK HANDLER       2 sleeping                           0   CONNECT HANDLER       3 sleeping                           0   DEFERRED HANDLER       4 runnable                           0   SCHEDULER      11 sleeping                hiram      0      14 running    bud          sonoma     0REMAP="UN--Under"This example shows output from the MOREINFO="NONE"sp_who procedure. ReturnsREMAP="BO--Body"The following table summarizes the results returned as rows with these columns: TOCENTRY="1"LBL="Table 4-5: "Format of Information Returned (sp_who)COLS="3" CHAROFF="50" CHAR="" ALIGN="LEFT"COLNAME="C1" COLWIDTH="114*"COLNAME="C2" COLWIDTH="105*"COLNAME="C3" COLWIDTH="104*"VALIGN="BOTTOM"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Column NameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"DatatypeCOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"Length VALIGN="TOP"COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"spidCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_INT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"4 COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"statusCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CHAR_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"10 COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"loginameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CHAR_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"12 COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"hostnameCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CHAR_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"10 COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"blkCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_INT_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"3COLNAME="C1" ALIGN="LEFT" ROTATE="0" MOREROWS="0"cmdCOLNAME="C2" ALIGN="LEFT" ROTATE="0" MOREROWS="0"CS_CHAR_TYPECOLNAME="C3" ALIGN="LEFT" ROTATE="0" MOREROWS="0"16 See AlsoREMAP="BO--Body"LINKEND="X23967"sp_ps
, LINKEND="X93206"sp_terminate
ID="IN526496282"sp_who
 GlossaryarrayA structure composed of multiple identical variables that can be individually addressed.array bindingThe process of binding a result column to an array variable. At fetch time, multiple rows of the column are copied into the variable.batchA group of commands or statements.A Client-Library command batch is one or more Client-Library commands terminated by an application's call to MOREINFO="NONE"ct_send. For example, an application can batch together commands to declare, set rows for, and open a cursor.A Transact-SQL statement batch is one or more Transact-SQL statements submitted to SQL Server by means of a single Client-Library command or Embedded SQL statement.browse modeBrowse mode is a method that DB-Library and Client-Library applications can use to browse through database rows, updating their values one row at a time. Cursors provide similar functionality and are generally more portable and flexible.bulk copyA utility for copying data in and out of databases. Also called MOREINFO="NONE"bcp.callback eventIn Open Client and Open Server, a callback event is an occurrence that triggers a callback routine.callback routineA routine that Open Client or Open Server calls in response to a triggering event, known as a callback event.capabilitiesA client/server connection's capabilities determine the types of client requests and server responses permitted for that connection.character setA set of specific (usually standardized) characters with an encoding scheme that uniquely defines each character. ASCII and ISO 8859-1 (Latin 1) are two common character sets.character set conversionChanging the encoding scheme of a set of characters on the way into or out of a server. Conversion is used when a server and a client communicating with it use different character sets. For example, if SQL Server uses ISO 8859-1 and a client uses Code Page 850, character set conversion must be turned on so that both server and client interpret the data passing back and forth in the same way.clientIn client/server systems, the client is the part of the system that sends requests to servers and processes the results of those requests.Client-LibraryPart of Open Client, Client-Library is a collection of routines for use in writing client applications. Client-Library is a new library, designed to accommodate cursors and other advanced features in the SYBASE 10.0 product line.code setSee character set.collating sequenceSee sort order.commandIn Client-Library, a command is a server request initiated by an application's call to MOREINFO="NONE"ct_command, MOREINFO="NONE"ct_dynamic, or MOREINFO="NONE"ct_cursor and terminated by the application's call to MOREINFO="NONE"ct_send. command structureA command structure (CS_COMMAND) is a hidden Client-Library structure that Client-Library applications use to send commands and process results. connection structureA connection structure (CS_CONNECTION) is a hidden Client-Library structure that defines a client/server connection within a context.context structureA context structure (CS_CONTEXT) is a CS-Library hidden structure that defines an application "context," or operating environment, within a Client-Library or Open Server application. The CS-Library routines MOREINFO="NONE"cs_ctx_alloc and MOREINFO="NONE"cs_ctx_drop allocate and drop a context structure.conversionSee character set conversion.CS-LibraryIncluded with both the Open Client and Open Server products, CS-Library is a collection of utility routines that are useful to both Client-Library and Server-Library applications.current rowWith respect to cursors, the current row is the row to which a cursor points. A fetch against a cursor retrieves the current row.cursorA cursor is a symbolic name that is associated with a SQL statement. In Embedded SQL, a cursor is a data selector that passes multiple rows of data to the host program, one row at a time.databaseA set of related data tables and other database objects that are organized to serve a specific purpose. datatypeA defining attribute that describes the values and operations that are legal for a variable.DB-LibraryPart of Open Client, DB-Library is a collection of routines for use in writing client applications.deadlockA situation that arises when two users, each having a lock on one piece of data, attempt to acquire a lock on the other's piece of data. SQL Server detects deadlocks and resolves them by killing one user's process. defaultDescribes the value, option, or behavior that Open Client/Server products use when none is explicitly specified.default databaseThe database that a user gets by default when he or she logs in to a database server.default language1. The language that Open Client/Server products use when an application does no explicit localization. The default language is determined by the "default" entry in the locales file. 2. The language that SQL Server uses for messages and prompts when a user has not explicitly chosen a language.Dynamic SQLDynamic SQL allows an Embedded SQL or Client-Library application to execute SQL statements containing variables whose values are determined at run-time.error messageA message that an Open Client/Server product issues when it detects an error condition.eventAn occurrence that prompts an Open Server application to take certain actions. Client commands and certain commands within Open Server application code can trigger events. When an event occurs, Open Server calls either the appropriate event-handling routine in the application code or the appropriate default event handler.event handlerIn Open Server, a routine that processes an event. An Open Server application can use the default handlers Open Server provides or can install custom event handlers. exposed structureAn exposed structure is a structure whose internals are exposed to Open Client/Server programmers. Open Client/Server programmers can declare, manipulate, and de-allocate exposed structures directly. The CS_DATAFMT structure is an example of an exposed structure.extended transactionIn Embedded SQL, an extended transaction is a transaction composed of multiple Embedded SQL statements.FIPSFIPS is an acronym for Federal Information Processing Standards. If FIPS flagging is enabled, SQL Server or the Embedded SQL precompiler issue warnings when a non-standard extension to a SQL statement is encountered.gatewayA gateway is an application that acts as an intermediary for clients and servers that cannot communicate directly. Acting as both client and server, a gateway application passes requests from a client to a server and returns results from the server to the client.hidden structureA hidden structure is a structure whose internals are hidden from Open Client/Server programmers. Open Client/Server programmers must use Open Client/Server routines to allocate, manipulate, and de-allocate hidden structures. The CS_CONTEXT structure is an example of a hidden structure.host languageThe programming language in which an application is written.host programIn Embedded SQL, the host program is the application program that contains the Embedded SQL code.host variableIn Embedded SQL, a variable which enables data transfer between SQL Server and the application program. See also indicator variable, input variable, output variable, result variable, and status variable.indicator variableA variable whose value indicates special conditions about another variable's value or about fetched data.When used with an Embedded SQL host variable, an indicator variable indicates when a database value is null.input variableA variable that is used to pass information to a routine, a stored procedure, or SQL Server.interfaces fileA file that maps server names to transport addresses. When a client application calls MOREINFO="NONE"ct_connect or MOREINFO="NONE"dbopen to connect to a server, Client-Library or DB-Library searches the interfaces file for the server's address. Note that not all platforms use the interfaces file. On these platforms, an alternate mechanism directs clients to server addresses.isql script fileIn Embedded SQL, an MOREINFO="NONE"isql script file is one of the three files the precompiler can generate. An MOREINFO="NONE"isql script file contains precompiler-generated stored procedures, which are written in Transact-SQL.keyA subset of row data that uniquely identifies a row. Key data uniquely describes the current row in an open cursor.keywordA word or phrase that is reserved for exclusive use in Transact-SQL or Embedded SQL. Also called a reserved word. listing fileIn Embedded SQL, a listing file is one of the three files the precompiler can generate. A listing file contains the input file's source statements and informational, warning, and error messages.locales fileA file that maps locale names to language/character set pairs. Open Client/Server products search the locales file when loading localization information.locale nameA character string that represents a language/character set pair. Locale names are listed in the locales file. SYBASE predefines some locale names, but a system administrator can define additional locale names and add them to the locales file.locale structureA locale structure (CS_LOCALE) is a CS-Library hidden structure that defines custom localization values for a Client-Library or Open Server application. An application can use a CS_LOCALE to define the language, character set, datepart ordering, and sort order it will use. The CS-Library routines MOREINFO="NONE"cs_loc_alloc and MOREINFO="NONE"cs_loc_drop allocate and drop a locale structure.localizationLocalization is the process of setting up an application to run in a particular national language environment. An application that is localized typically generates messages in a local language and character set and uses local datetime formats.login nameThe name a user uses to log in to a server. A SQL Server login name is valid if SQL Server has an entry for that user in the system table syslogins. message numberA number that uniquely identifies an error message. message queueIn Open Server, a linked list of message pointers through which threads communicate. Threads can write messages into and read messages from the queue.multi-byte character setA character set that includes characters encoded using more than one byte. EUC JIS and Shift-JIS are examples of multi-byte character sets.mutexA mutual exclusion semaphore. This is a logical object that an Open Server application uses to ensure exclusive access to a shared object.nullHaving no explicitly assigned value. NULL is not equivalent to zero, or to blank. A value of NULL is not considered to be greater than, less than, or equivalent to any other value, including another value of NULL. Open ServerA SYBASE product than provides tools and interfaces for creating custom servers.Open Server applicationA custom server constructed with Open Server.output variableIn Embedded SQL, a variable which passes data from a stored procedure to an application program.parameter1. A variable that is used to pass data to and retrieve data from a routine. 2. An argument to a stored procedure.pass-through modeA state of being pertaining to gateway applications. When in pass-through mode, a gateway relays Tabular Data Stream (TDS) packets between a client and a remote data source without unpacking the packets' contents.propertyA property is a named value stored in a structure. Context, connection, thread, and command structures have properties. A structure's properties determine how it behaves.query1. A data retrieval request; usually a MOREINFO="NONE"select statement. 2. Any SQL statement that manipulates data. registered procedureIn Open Server, a collection of C statements stored under a name. Open Server-supplied registered procedures are called system registered procedures. remote procedure call1. One of two ways in which a client application can execute a SQL Server stored procedure. (The other is with a Transact-SQL MOREINFO="NONE"execute statement.) A Client-Library application initiates a remote procedure call command by calling MOREINFO="NONE"ct_command. A DB-Library application initiates a remote procedure call command by calling MOREINFO="NONE"dbrpcinit.2. A type of request a client can make of an Open Server application. In response, Open Server either executes the corresponding registered procedure or calls the Open Server application's RPC event handler. 3. A stored procedure executed on a different server from the server to which the user is connected.result variableIn Embedded SQL, a variable that receives the results of a MOREINFO="NONE"select or MOREINFO="NONE"fetch statement.serverIn client/server systems, the server is the part of the system that processes client requests and returns results to clients.Server-LibraryA collection of routines for use in writing Open Server applications.sort orderUsed to determine the order in which character data is sorted. Also called collating sequence.sqlca1. In an Embedded SQL application, a SQLCA is a structure that provides a communication path between SQL Server and the application program. After executing each SQL statement, SQL Server stores return codes in the SQLCA.2. In a Client-Library application, a SQLCA is a structure that the application can use to retrieve Client-Library and server error and informational messages.sqlcode1. In an Embedded SQL application, a SQLCODE is a structure that provides a communication path between SQL Server and the application program. After executing each SQL statement, SQL Server stores return codes in the SQLCODE. A SQLCODE can exist independently or as a variable within a SQLCA structure.2. In a Client-Library application, a SQLCODE is a structure that the application can use to retrieve Client-Library and server error and informational message codes.SQL ServerA server in Sybase's client/server architecture. SQL Server manages multiple databases and multiple users, keeps track of the actual location of data on disks, maintains mapping of logical data description to physical data storage, and maintains data and procedure caches in memory.statementIn Transact-SQL or Embedded SQL, an instruction that begins with a keyword. The keyword names the basic operation or command to be performed. status variableIn Embedded SQL, a variable which receives the return status value of a stored procedure, thereby indicating the procedure's success of failure.stored procedureIn SQL Server, a collection of SQL statements and optional control-of-flow statements stored under a name. SQL Server-supplied stored procedures are called system procedures. System AdministratorThe user in charge of server system administration, including creating user accounts, assigning permissions, and creating new databases. On SQL Server, the System Administrator's login name is sa. system descriptorIn Embedded SQL, a system descriptor is an area of memory that holds a description of variables used in Dynamic SQL statements. system proceduresStored procedures that SQL Server supplies for use in system administration. These procedures are provided as shortcuts for retrieving information from system tables, or as mechanisms for accomplishing database administration and other tasks that involve updating system tables. system registered proceduresInternal registered procedures that Open Server supplies for registered procedure notification and status monitoring. target fileIn Embedded SQL, a target file is of the three files the precompiler can generate. A target file is similar to the original input file, except that all SQL statements are converted to Client-Library function calls.TDS(Tabular Data Stream) An application-level protocol that SYBASE clients and servers use to communicate. It describes commands and results.threadA path of execution through Open Server application and library code and the path's associated stack space, state information, and event handlers.Transact-SQLTransact-SQL is an enhanced version of the database language SQL. Applications can use Transact-SQL to communicate with SYBASE SQL Server.transactionOne or more server commands that are treated as a single unit for the purposes of backup and recovery. Commands within a transaction are committed as a group; that is, either all of them are committed or all of them are rolled back.transaction modeTransaction mode refers to the manner in which SQL Server manages transactions. SQL Server supports two transaction modes: Transact-SQL mode (also called "unchained transactions") and ANSI mode (also called "chained transactions").user nameSee login name.