Beispiel #1
0
// Parse the client_state.xml file
//
int CLIENT_STATE::parse_state_file() {
    const char *fname;

    // Look for a valid state file:
    // First "next", then regular, then "prev"
    //
    if (valid_state_file(STATE_FILE_NEXT)) {
        fname = STATE_FILE_NEXT;
        msg_printf(0, MSG_INFO, "Using state file %s", STATE_FILE_NEXT);
    } else if (valid_state_file(STATE_FILE_NAME)) {
        fname = STATE_FILE_NAME;
    } else if (valid_state_file(STATE_FILE_PREV)) {
        msg_printf(0, MSG_INFO, "Using state file %s", STATE_FILE_PREV);
        fname = STATE_FILE_PREV;
    } else {
        msg_printf(0, MSG_INFO, "Creating new client state file");

        // avoid warning messages about version
        //
        old_major_version = BOINC_MAJOR_VERSION;
        old_minor_version = BOINC_MINOR_VERSION;
        old_release = BOINC_RELEASE;
        return ERR_FOPEN;
    }
    return parse_state_file_aux(fname);
}
Beispiel #2
0
// Parse the client_state.xml file
//
int CLIENT_STATE::parse_state_file() {
    const char *fname;

    // Look for a valid state file:
    // First the regular one, then the "next" one.
    //
    if (valid_state_file(STATE_FILE_NEXT)) {
        fname = STATE_FILE_NEXT;
    } else if (valid_state_file(STATE_FILE_NAME)) {
        fname = STATE_FILE_NAME;
    } else if (valid_state_file(STATE_FILE_PREV)) {
        fname = STATE_FILE_PREV;
    } else {
        if (log_flags.statefile_debug) {
            msg_printf(0, MSG_INFO,
                "[statefile] CLIENT_STATE::parse_state_file(): No state file; will create one"
            );
        }

        // avoid warning messages about version
        //
        old_major_version = BOINC_MAJOR_VERSION;
        old_minor_version = BOINC_MINOR_VERSION;
        old_release = BOINC_RELEASE;
        return ERR_FOPEN;
    }
    return parse_state_file_aux(fname);
}