FreeCalypso > hg > tcs211-patches
view tool/patchhook.c @ 7:5a6f608173c4
first patch implemented: tpudrv-quadband
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Sat, 06 Jun 2015 05:16:19 +0000 |
parents | 87e9f30f5f86 |
children | 04fd47d382c7 |
line wrap: on
line source
/* * This module implements the "patch hook" that checks if an archive member * needs to be patched and invokes all necessary patch processing. */ #include <sys/types.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <strings.h> #include <time.h> #include "ar.h" #include "globals.h" #include "patchinfo.h" extern struct ar_hdr ar_hdr; update_ar_timestamp() { time_t curtime; time(&curtime); sprintf(ar_hdr.ar_date, "%-12lu", (u_long) curtime); } patch_hook() { struct patch_module_desc *pmd; struct patch_desc *patch; for (pmd = patch_module_list; pmd; pmd = pmd->next) if (!strcmp(pmd->member_name, member_name)) break; if (!pmd) return(0); /* yes, we need to patch it: start digging into it */ parse_coff_hdr(); for (patch = pmd->patches; patch; patch = patch->next) apply_patch(patch); update_ar_timestamp(); return(1); }