Home:ALL Converter>Intersystems Cache - Get started with Callin API

Intersystems Cache - Get started with Callin API

Ask Time:2012-09-21T22:38:11         Author:Kevin Gill

Json Formatter

I want to develop C client code using the callin API.

I wrote code to connect to Cache. However, when I invoke it, I get ...

Instance is not running
Start status = -1

I am guessing that I am missing an environment variable to identify my default Cache instance, but I cannot find a reference to that in the Cache documentation.

I have a Suse based installation. I can start csession using "csession CACHE" in the same shell.

Any help?

Code is below....

static void *
mstart(void) {
    int status = 0;
    if (! gInitialised) {
        CACHE_ASTR prinp, prout, exename;

        prinp.len = prout.len = 0;
        prinp.str[0] = prout.str[0] = '\0';
        strcpy((char *)exename.str, "vavista.cache");
        exename.len = strlen((const char *)exename.str);

        status = CacheSecureStartA(
            NULL,                             /* User */
            NULL,                             /* Password */
            &exename,                          /* Application Id */
            CACHE_PROGMODE | CACHE_TTNEVER,   /* Flags */
            0,                                /* timeout */
            &prinp,                        /* Principal input device */
            &prout);                       /* Principal output device */
        printf("Start status = %d\n", status);
    return (void *)1; /* Success */

Author:Kevin Gill,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/12532696/intersystems-cache-get-started-with-callin-api