kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

archive_engine.c (784B)


      1 #include "archive_engine.h"
      2 
      3 #include <kit/archive.h>
      4 
      5 #include "inputs.h"
      6 
      7 /* Thin wrapper over kit_ar_write_objs (libkit owns the serialize-each-builder,
      8  * compute-the-symbol-index, write-the-archive pipeline). The driver layer adds
      9  * the no-objects guard and the driver_errf diagnostics callers expect. */
     10 int driver_archive_emit(DriverEnv* env, const KitContext* ctx, const char* tool,
     11                         KitObjBuilder* const* objs, const KitSlice* names,
     12                         uint32_t n, uint64_t epoch, KitWriter* out) {
     13   (void)env;
     14   if (n == 0) {
     15     driver_errf(tool, "no objects to archive");
     16     return 1;
     17   }
     18   if (kit_ar_write_objs(ctx, objs, names, n, epoch, out) != KIT_OK) {
     19     driver_errf(tool, "failed to write archive");
     20     return 1;
     21   }
     22   return 0;
     23 }