UCM Unitec Home Page
      

Initialize UCM Communication

 UcmInit(F)

Synopsis   Environment   Description   Diagnostics   Globals   Notes   See also   Examples

Synopsis

#include "ucm.h"

int UcmInit(void);

Environment

Unix, Win32

Description

UcmInit registers the calling process to the license manager ULM and initializes UCM message processing. In order to properly release all resources used by UCM, UcmTerm should be called upon program exit.

Diagnostics

UcmInit always returns UCM_SUCCESS.

Globals

char *ucmProgName;    /* reference */

Notes

The global pointer char *ucmProgName, which is defined in ucm.h and allocated in libucm.a, may optionally be set to the program name of the calling task. This string will be used to identify possible messages on stderr. If ucmProgName is not set, the default string ‘UCM Library’ will be used.

See also

UcmTerm

Examples

 
#include "ucm.h"

main(argc, argv)

int argc;
char *argv[];
{
    T_SOCKET sock;          /* socket from argv[1] */

    ucmProgName = argv[0];  /* for UCM error msgs */
    sock = atoi(argv[1]);
    UcmInit();
    if (UcmOpen(sock))
        Error("UcmOpen failed, error=%d", ucmErrno);
    UcmSendf(sock, "MsgId", "Hello world");
    UcmClose(sock);
    UcmTerm();
    return 0;               /* terminate program */
}

 

Back to top