Intersystems Cache - Get started with Callin API

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);
        atexit(mstop);
    }
    return (void *)1; /* Success */
}

Answers


You need to set the Cache Directory before starting... CacheSetDir("/opt/cache/mgr");


Need Your Help

Does ActiveRecord wrap manual queries into a transaction already?

ruby-on-rails ruby activerecord

I have a query that begins and ends a transaction like this:

Implementing SoundCloud OAuth Login using C#

c# windows-phone-8 oauth-2.0

I need to implement authentication with SoundCloud in my Windows Phone app using C#

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.