zpmod
b19981f
High-performance Zsh module for script optimization and filesystem helpers
|
Incremental PATH diff snapshot (initial slice). More...
#include "zpmod.mdh"
#include "zpmod.pro"
#include "zpmod_emoji.h"
#include "zpmod_rehash.h"
#include "zpmod_vendor_shims.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
Go to the source code of this file.
Data Structures | |
struct | rh_entry |
struct | rh_vec |
Macros | |
#define | ZP_RH_SUBDIR "zpmod" |
#define | ZP_RH_FILE "rehash_path_v1.snapshot" |
Functions | |
static char * | zp_rh_base_cache_dir (void) |
static char * | zp_rh_dir (char *nam) |
static char * | zp_rh_file (char *nam) |
static void | rh_vec_init (struct rh_vec *v) |
static int | rh_vec_push (struct rh_vec *v, struct rh_entry *e) |
static void | rh_vec_free (struct rh_vec *v) |
static int | rh_load (const char *nam, const char *file, struct rh_vec *out) |
static int | rh_write (char *nam, const char *file, struct rh_vec *paths) |
static void | rh_collect_current (struct rh_vec *out) |
int | zp_rehash_diff_core (char *nam) |
Incremental PATH diff snapshot (initial slice).
Goal: avoid full command rehash when PATH unchanged. This slice:
Definition in file rehash_diff.c.
#define ZP_RH_FILE "rehash_path_v1.snapshot" |
Definition at line 26 of file rehash_diff.c.
#define ZP_RH_SUBDIR "zpmod" |
Definition at line 25 of file rehash_diff.c.
|
static |
Definition at line 214 of file rehash_diff.c.
References getaparam(), rh_entry::ino, rh_entry::mtime, rh_entry::path, rh_entry::present_now, rh_vec_push(), zalloc(), and zsfree().
Referenced by zp_rehash_diff_core().
|
static |
Definition at line 138 of file rehash_diff.c.
References rh_entry::ino, rh_entry::mtime, rh_entry::path, rh_entry::present_now, rh_vec_push(), zalloc(), and zsfree().
Referenced by zp_rehash_diff_core().
|
static |
Definition at line 120 of file rehash_diff.c.
References rh_vec::cap, rh_vec::items, rh_entry::path, rh_vec::size, zfree(), and zsfree().
Referenced by zp_rehash_diff_core().
|
static |
Definition at line 102 of file rehash_diff.c.
References rh_vec::cap, rh_vec::items, and rh_vec::size.
Referenced by zp_rehash_diff_core().
Definition at line 107 of file rehash_diff.c.
References rh_vec::cap, rh_vec::items, rh_vec::size, and zrealloc().
Referenced by rh_collect_current(), and rh_load().
|
static |
Definition at line 194 of file rehash_diff.c.
References rh_vec::items, rh_entry::path, rh_vec::size, zp_icon(), and zwarnnam().
Referenced by zp_rehash_diff_core().
int zp_rehash_diff_core | ( | char * | nam | ) |
Definition at line 241 of file rehash_diff.c.
References rh_entry::ino, rh_vec::items, rh_entry::mtime, rh_entry::path, rh_entry::present_now, rh_collect_current(), rh_load(), rh_vec_free(), rh_vec_init(), rh_write(), rh_vec::size, zp_icon(), zp_rh_file(), and zsfree().
Referenced by bin_zpmod().
|
static |
Definition at line 28 of file rehash_diff.c.
References getsparam(), zalloc(), and ztrdup().
Referenced by zp_rh_dir().
|
static |
Definition at line 48 of file rehash_diff.c.
References zalloc(), zp_icon(), zp_rh_base_cache_dir(), ZP_RH_SUBDIR, zsfree(), and zwarnnam().
Referenced by zp_rh_file().
|
static |
Definition at line 75 of file rehash_diff.c.
References zalloc(), zp_rh_dir(), ZP_RH_FILE, and zsfree().
Referenced by zp_rehash_diff_core().