Esempio n. 1
0
HANDEL_EXPORT int HANDEL_API xiaInit(char *iniFile)
{
    int status;
    int nFilesOpen;

    /* We need to clear and re-initialize Handel */
    status = xiaInitHandel();

    if (status != XIA_SUCCESS) {
        xiaLogError("xiaInit", "Error reinitializing Handel", status);
        return status;
    }

    if (iniFile == NULL) {
        xiaLogError("xiaInit", ".INI file name must be non-NULL", XIA_BAD_NAME);
        return XIA_BAD_NAME;
    }

    /* Verify that we currently don't have any file handles open. This is
     * not a legitimate error condition and indicates that we are not cleaning
     * up all of our handles somewhere else in the library.
     */
    nFilesOpen = xia_num_open_handles();

    if (nFilesOpen > 0) {
        xia_print_open_handles(stdout);
        FAIL();
    }

    status = xiaReadIniFile(iniFile);

    if (status != XIA_SUCCESS) {
        sprintf(info_string, "Error reading in .INI file '%s'", iniFile);
        xiaLogError("xiaInit", info_string, status);
        return status;
    }

    return XIA_SUCCESS;
}
Esempio n. 2
0
/** @brief Prints a list of the open file handles to stdout
 *
 */
XIA_EXPORT void xia_print_open_handles_stdout(void)
{
    xia_print_open_handles(stdout);
}