• [^] # Re: Petit joueur....

    Posté par . En réponse au journal ha le php et ses élites. Évalué à 3.

    Tu ferais comment pour libetc ? (http://ordiluc.net/fs/libetc/)

    Petit extrait :


    #define REWRITE_FUNCTION_SIMPLE(return_type, function_name, signature, orig_call) \
    return_type function_name signature { \
    return_type return_value; \
    char *new_path; \
    \
    PRINT_DEBUG(#function_name ": %s\n", path); \
    \
    new_path = translate (path); \
    return_value = orig_##function_name orig_call; \
    free (new_path); \
    return return_value; \
    }

    REWRITE_FUNCTION_SIMPLE(FILE*, fopen, (const char *path, const char *mode), (new_path, mode))
    REWRITE_FUNCTION_SIMPLE(FILE*, fopen64, (const char *path, const char *mode), (new_path, mode))
    REWRITE_FUNCTION_SIMPLE(FILE*, freopen, (const char *path, const char *mode, FILE *stream), (new_path, mode, stream))
    // ... et plein d’autres fonctions comme ça