zpmod  b19981f
High-performance Zsh module for script optimization and filesystem helpers
bundle_build.c File Reference

Startup bundle builder (initial functional implementation). More...

#include "zpmod.mdh"
#include "zpmod.pro"
#include "zpmod_bundle.h"
#include <dirent.h>
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h>
Include dependency graph for bundle_build.c:

Go to the source code of this file.

Data Structures

struct  bb_entry
 
struct  bb_vec
 

Macros

#define PATH_MAX   4096
 

Functions

static int has_ext (const char *name)
 
static void bb_vec_init (struct bb_vec *v)
 
static int bb_vec_push (struct bb_vec *v, struct bb_entry *e)
 
static void bb_vec_free (struct bb_vec *v)
 
static int bb_collect (char *nam, const char *root, const char *sub, struct bb_vec *out)
 
static int bb_cmp (const void *a, const void *b)
 

Detailed Description

Startup bundle builder (initial functional implementation).

Definition in file bundle_build.c.

Macro Definition Documentation

◆ PATH_MAX

#define PATH_MAX   4096

Definition at line 26 of file bundle_build.c.

Function Documentation

◆ bb_cmp()

static int bb_cmp ( const void *  a,
const void *  b 
)
static

Definition at line 165 of file bundle_build.c.

References bb_entry::rel.

◆ bb_collect()

static int bb_collect ( char *  nam,
const char *  root,
const char *  sub,
struct bb_vec out 
)
static

Definition at line 91 of file bundle_build.c.

References bb_entry::abs, bb_vec_push(), has_ext(), bb_entry::mtime, path, PATH_MAX, bb_entry::rel, bb_entry::size, zalloc(), and zsfree().

Here is the call graph for this function:

◆ bb_vec_free()

static void bb_vec_free ( struct bb_vec v)
static

Definition at line 70 of file bundle_build.c.

References bb_entry::abs, bb_vec::cap, bb_vec::items, bb_entry::rel, bb_vec::size, zfree(), and zsfree().

Here is the call graph for this function:

◆ bb_vec_init()

static void bb_vec_init ( struct bb_vec v)
static

Definition at line 52 of file bundle_build.c.

References bb_vec::cap, bb_vec::items, and bb_vec::size.

◆ bb_vec_push()

static int bb_vec_push ( struct bb_vec v,
struct bb_entry e 
)
static

Definition at line 57 of file bundle_build.c.

References bb_vec::cap, bb_vec::items, bb_vec::size, and zrealloc().

Referenced by bb_collect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ has_ext()

static int has_ext ( const char *  name)
static

Definition at line 30 of file bundle_build.c.

Referenced by bb_collect().

Here is the caller graph for this function: