struct helper_struct_t {
    int x1;
    int x2;
    ...
};

int my_helper_function(helper_struct_t *info) {
    if (!info) return FALSE;
    info->x1 = do_something();
    if (!info->x1) return FALSE;
    info->x2 = do_something_else(info->x1);
    if (!info->x2) return FALSE;
    if (!do_yet_another_thing()) return FALSE;
    ...
    // everything done. got a lucky ending.
    return TRUE;
}

helper_struct_t info;
info.x1 = 0;
info.x2 = 0;
...
if (my_helper_function(&info)) {
    return TRUE;
} else {
    cleanup(&info);
    return FALSE;
}
