| bkisofs Usage and Reference Manual | ||
|---|---|---|
| <<< Previous | bkisofs Overview | Next >>> | 
Every bk function that can fail returns an int. If the function is successful in doing what it was supposed to do it returns a number greater than 0. If it fails it returns a number less than or equal to 0.
You should check each function for failure and deal with it accordngly, there is a return code for a reason!
In one case (rc == BKWARNING_OPER_PARTLY_FAILED) a negative return code is not an error but a warning, in which case it is safe to continue to do whatever you would if the function succeeded. If the return code is BKWARNING_OPER_PARTLY_FAILED, the warning callback would have been called during the operation so you should have let the user know then that something didn't work.
A simple example:
| void add(char* fullItemName)
{
    int rc;
    
    rc = bk_add(&GBLvolInfo, fullItemName, GBLisoCurrentDir, activityProgressUpdaterCbk);
    if(rc <= 0 && rc != BKWARNING_OPER_PARTLY_FAILED)
    {
        printf("Adding failed!\n");
    }
} | 
| <<< Previous | Home | Next >>> | 
| bkisofs Overview | Up | Constants |