<< lxaLoadLicense | Back to Salience 6 C API Index | lxaCloseSalienceSession >>


Opens the session. You MUST call this function before you call any others as you have to pass the SalienceSession structure into any of the other functions.


int lxaOpenSalienceSession(LexalyticsLicense pLicense, 
                           SalienceSessionStartup* pOptions, 
                           SalienceSession **ppSession);


pLicense Pointer to a LexalyticsLicense structure
pOptions Pointer to a SalienceSessionStartup structure
ppSession Pointer to a pointer to a SalienceSession structure


If a session is not created (i.e. the return value is not LXA_OK) then the acError member of the SalienceSessionStartup structure will be filled with a descriptive error message. This is a fixed length character buffer, and does not need to be freed via lxaFreeString.


     char* acPath = "/path/to/content";
     char* acLicensePath = "/path/to/license/file";
     char* acDataDirectory = "/path/to/data/directory";
     char* acError;

     LexalyticsLicense oLicense;
     if(lxaLoadLicense(acLicensePath, &oLicense, &acError) != LXA_OK)
          std::cout << acError << std::endl;
          return 1;

     SalienceSessionStartup oStartup;
     strcpy(oStartup.acDataDirectory, acDataDirectory);
     oStartup.nStartupLog = 1;

     SalienceSession* pSession; 
     if(lxaOpenSalienceSession(oLicense, &oStartup, &pSession) != LXA_OK)
          return 1;

<< lxaLoadLicense | Back to Salience 6 C API Index | lxaCloseSalienceSession >>