3#if !defined(ORG_FOSSIL_SCM_FSL_INTERNAL_H_INCLUDED)
4#define ORG_FOSSIL_SCM_FSL_INTERNAL_H_INCLUDED
27#if !defined(FSL_ENABLE_MUTEX)
28# if defined(SQLITE_THREADSAFE) && SQLITE_THREADSAFE>0
29# define FSL_ENABLE_MUTEX 1
31# define FSL_ENABLE_MUTEX 0
35#if defined(__cplusplus)
62#define fsl__pq_entry_empty_m {0,NULL,0.0}
82#define fsl__pq_empty_m {0,0,NULL}
102 double v,
void *pData);
135#define fsl__bccache_line_empty_m { 0,0,fsl_buffer_empty_m }
220#define fsl__bccache_empty_m { \
222 .szLimit = 20000000U, \
223 .used = 0U, .usedLimit = 400U,\
228 .inCache = fsl_id_bag_empty_m, \
229 .metrics = {.hits = 0U, .misses = 0U} \
277#define fsl__mcache_empty_m { \
278 .nextAge=0, .hits=0, .misses=0, \
280 .decks = {fsl_deck_empty_m,fsl_deck_empty_m, \
281 fsl_deck_empty_m, fsl_deck_empty_m}\
306#define fsl__ptl_line_map(E) \
319#define E(X) fsl_id_bag X;
337 unsigned changeMarker;
348#define E(X) fsl__ptl_e_ ## X,
383#define fsl__ptl_empty_m { \
384 .rc = 0, .allocated = 0, .level = 0, \
385 .validateRidLevel = -1, \
386 .stack = NULL, .line = NULL, \
387 .mem = fsl_buffer_empty_m \
895#define fsl__cx_cache_stmt_map(E) \
896 E(deltaR2S,"SELECT srcid FROM delta WHERE rid=?1") \
897 E(deltaS2R,"SELECT rid FROM delta WHERE srcid=?1") \
899 "SELECT rid FROM blob WHERE uuid=?1") \
901 "SELECT uuid FROM blob WHERE rid=?1") \
903 "SELECT 1 FROM plink " \
906 "(SELECT value FROM tagxref " \
907 "WHERE tagid=8/*FSL_TAGID_BRANCH*/ AND rid=?1), " \
908 "?2 /*main branch name*/)" \
909 "=coalesce((SELECT value FROM tagxref " \
910 "WHERE tagid=8/*FSL_TAGID_BRANCH*/ " \
911 "AND rid=plink.cid), " \
912 "?2 /*main branch name*/)") \
913 E(ridIsPrivate,"SELECT 1 FROM private WHERE rid=?1") \
914 E(contentSize,"SELECT size FROM blob WHERE rid=?1") \
915 E(contentBlob,"SELECT content, size FROM blob WHERE rid=?1") \
916 E(uuidIsShunned,"SELECT 1 FROM shun WHERE uuid=?1") \
918 "INSERT INTO blob(rcvid,size,uuid,content) " \
919 "VALUES(0,-1,?1,NULL) " \
921 E(insertPhantomRid,"INSERT OR IGNORE INTO unclustered VALUES(?1)") \
922 E(insertPrivateRid,"INSERT OR IGNORE INTO private VALUES(?1)") \
923 E(insertUnclusteredRid,"INSERT OR IGNORE INTO unclustered VALUES(?1)") \
924 E(insertUnsentRid,"INSERT OR IGNORE INTO unsent VALUES(?1)") \
926 "REPLACE INTO delta(rid,srcid) VALUES(?1,?2)") \
928 "UPDATE blob SET content=?1, size=?2 WHERE rid=?3") \
929 E(blobRidSize,"SELECT rid, size FROM blob WHERE uuid=?1") \
930 E(blobUpdateContent,\
931 "UPDATE blob SET content=?1 WHERE rid=?2") \
933 "UPDATE blob SET rcvid=?1, size=?2, " \
934 "content=?3 WHERE rid=?4") \
936 "INSERT INTO blob (rcvid,size,uuid,content) " \
937 "VALUES(?1,?2,?3,?4) RETURNING rid") \
939 "INSERT OR IGNORE INTO leaf VALUES (?1)") \
941 "DELETE FROM leaf WHERE rid=?1") \
943 "SELECT pid FROM plink WHERE cid=?1 AND pid>0") \
979 E(deltaChainForRid,"")
981#define STMT(MEMBER,IGNORED) fsl_stmt MEMBER;
1330 bool isPrivate,
fsl_id_t * newId );
1375 char const * zValue,
1437void fsl__fatal(
int code,
char const * fmt, ... )
1439 __attribute__ ((noreturn))
1910 fsl_id_t rid,
const char * docName);
2128 char const * zLinkFile);
2261 const char * zFilename,
2263 const char * zOrigHash,
2403#define fsl__diff_cx_empty_m {\
2404 NULL,0,0,NULL,0,NULL,0,fsl_dline_cmp \
2442 char const * zFile,
int ln );
2643#define FSL__LINE_LENGTH_MASK_SZ 15
2650#define FSL__LINE_LENGTH_MASK ((1<<FSL__LINE_LENGTH_MASK_SZ)-1)
2657#define fsl__buffer_err(B) (B)->errCode
2707 unsigned char *
zEnd;
2714#define fsl__tokenizer_empty_m {NULL,NULL,false}
2925 uint32_t remoteVersion;
2926 uint32_t remoteDate;
2927 uint32_t remoteTime;
2988#define fsl_xfcard_LowestIdChar '$'
2989#define fsl_xfcard_MaxCardNameLen 11
3006#define fsl_xfcard_hash_step_ch(H,I,CHAR) \
3007 (((((fsl_xfcard_hash_t)H << 1) + (I+1)) * (CHAR - fsl_xfcard_LowestIdChar-1)) ^ CHAR)
3009#define fsl_xfcard_hash_step_ch(H,I,CHAR) \
3010 ((((H << 1) + (45*I) + CHAR - fsl_xfcard_LowestIdChar-1)) ^ CHAR)
3012#define fsl_xfcard_hash_step_ch(H,I,CHAR) \
3013 ((H << 1) + 113*I + (CHAR - fsl_xfcard_LowestIdChar-1))
3025#define fsl_xfcard_hash_step(H,I,WORD) \
3026 fsl_xfcard_hash_step_ch(H,I,(#WORD[I]))
3049#define fsl_xfcard_hashS(WORD) fsl_xfcard_hash((unsigned const char *)WORD)
3055#define fsl_xfcard_hash_1(W) fsl_xfcard_hash_step(0,0,W)
3056#define fsl_xfcard_hash_2(W) fsl_xfcard_hash_step(fsl_xfcard_hash_1(W),1,W)
3057#define fsl_xfcard_hash_3(W) fsl_xfcard_hash_step(fsl_xfcard_hash_2(W),2,W)
3058#define fsl_xfcard_hash_4(W) fsl_xfcard_hash_step(fsl_xfcard_hash_3(W),3,W)
3059#define fsl_xfcard_hash_5(W) fsl_xfcard_hash_step(fsl_xfcard_hash_4(W),4,W)
3060#define fsl_xfcard_hash_6(W) fsl_xfcard_hash_step(fsl_xfcard_hash_5(W),5,W)
3061#define fsl_xfcard_hash_7(W) fsl_xfcard_hash_step(fsl_xfcard_hash_6(W),6,W)
3062#define fsl_xfcard_hash_8(W) fsl_xfcard_hash_step(fsl_xfcard_hash_7(W),7,W)
3063#define fsl_xfcard_hash_9(W) fsl_xfcard_hash_step(fsl_xfcard_hash_8(W),8,W)
3064#define fsl_xfcard_hash_10(W) fsl_xfcard_hash_step(fsl_xfcard_hash_9(W),9,W)
3065#define fsl_xfcard_hash_11(W) fsl_xfcard_hash_step(fsl_xfcard_hash_10(W),10,W)
3066#define fsl_xfcard_hash_N(N,W) fsl_xfcard_hash_ ## N(W)
3077 char const *
const name;
3097#define fsl__xfcard_searchNU(WORD) fsl__xfcard_search((unsigned const char *)(WORD))
3165int fsl__find_bin(
char const *zPath,
char const *zBinName,
char **zOut );
3253#define E(NAME,IGNORED) fsl__cx_stmt_e_ ## NAME,
3318#define fsl__cx_txn(FslCx, RcVar, RollbackTopOnError, KeepSPOnSuccess, BODY) { \
3319 RcVar = fsl_cx_txn_begin(FslCx); \
3323 int const RcVar ## __ = \
3324 fsl_cx_txn_end_v2((FslCx), (0==RcVar) && (KeepSPOnSuccess), \
3325 ((RollbackTopOnError) && (0!=RcVar))); \
3326 if( !RcVar ) RcVar = RcVar ## __; \
3333#define fsl__cx_txn_local(FslCx, RcVar, KeepSPOnSuccess, BODY) \
3334 fsl__cx_txn(FslCx, RcVar, 0, KeepSPOnSuccess, BODY)
3340#define fsl__cx_txn_global(FslCx, RcVar, KeepSPOnSuccess, BODY) \
3341 fsl__cx_txn(FslCx, RcVar, 1, KeepSPOnSuccess, BODY)
3344 char const *zHeader);
3368#define fsl__cx_ptl_has(F,W,R) fsl__ptl_has(&(F)->cache.ptl, W, R)
3369#define fsl__cx_ptl_insert(F,W,R) fsl__ptl_insert(&(F)->cache.ptl, W, R)
3385#define fsl__bprc(X) (void)0
3388#if defined(__cplusplus)
int32_t fsl_id_t
fsl_id_t is a signed integer type used to store database record IDs.
uint64_t fsl_size_t
fsl_size_t is an unsigned integer type used to denote absolute ranges and lengths.
int64_t fsl_time_t
The type used to represent type values.
uint32_t fsl_flag32_t
A 32-bit unsigned int type.
int64_t fsl_int_t
fsl_int_t is a signed integer type used to denote "relative" ranges and lengths, or to tell a routine...
uint64_t fsl_uint_t
The unsigned counterpart of fsl_int_t.
fsl_dbrole_e
This enum defines type ID tags with which the API tags fsl_db instances so that the library can figur...
fsl_fileperm_e
File permissions flags supported by fossil manifests.
fsl_satype_e
An enumeration of the types of structural artifacts used by Fossil.
fsl_buffer * fsl__cx_content_buffer(fsl_cx *f)
int fsl__repo_fingerprint_search(fsl_cx *f, fsl_id_t rcvid, char **zOut)
int fsl__ckout_rm_empty_dirs_for_file(fsl_cx *f, char const *zAbsPath)
const fsl__mcache fsl__mcache_empty
int fsl__vfile_to_ckout(fsl_cx *f, fsl_id_t vfileId, int *wasWritten)
int fsl__ckout_clear_merge_state(fsl_cx *f, bool fullWipe)
int fsl__rid_delete(fsl_cx *f, fsl_dbrole_e dbRole, char const *zTable, fsl_id_t rid)
Expects zTable to name a table with an rid field.
fsl_db * fsl__cx_db_for_role(fsl_cx *f, fsl_dbrole_e r)
void fsl__cx_reset_for_txn(fsl_cx *f, bool isCommit)
May clear or reset cached data.
int fsl__cx_ptl_push(fsl_cx *f)
void fsl__bprc(int rc)
A place to put a breakpoint to help trace down errors.
int fsl__pq_insert(fsl__pq *p, fsl_id_t e, double v, void *pData)
int fsl__leaf_do_pending_checks(fsl_cx *f)
int fsl__cx_StaticAssertScratchpadSizes[((sizeof(fsl__cx_empty.scratchpads.buf)/sizeof(fsl__cx_empty.scratchpads.buf[0]))==(sizeof(fsl__cx_empty.scratchpads.used)/sizeof(fsl__cx_empty.scratchpads.used[0]))) ? 1 :-1]
Ensure that fsl_cx::scratchpads::buf/used have the same array size.
int fsl__popen2(const char *zCmd, int *pfdIn, FILE **ppOut, int *pChildPid)
void fsl__bccache_clear(fsl__bccache *c)
int fsl__unsent_rid_add(fsl_cx *f, fsl_id_t rid)
Inserts the given rid into the repo.unsent table.
int fsl__bccache_check_available(fsl_cx *f, fsl_id_t rid)
bool fsl__ptl_has(fsl__ptl const *c, fsl__ptl_e where, fsl_id_t rid)
void fsl__bccache_reuse(fsl__bccache *c)
int fsl__tag_propagate(fsl_cx *f, fsl_tagtype_e tagType, fsl_id_t pid, fsl_id_t tagid, fsl_id_t origId, const char *zValue, double mtime)
int fsl__fdgets(int fdIn, unsigned char *pOut, fsl_size_t nOut, char **ppOut, fsl_size_t *pnOut)
int fsl__ckout_version_write(fsl_cx *f, fsl_id_t vid, fsl_uuid_cstr uuid)
int fsl__crosslink_begin(fsl_cx *f)
int fsl__repo_import_buffer(fsl_cx *f, fsl_buffer const *bIn, fsl_id_t *rid, fsl_uuid_str *uuid)
A convenience form of fsl__repo_import_blob(), equivalent to:
int fsl__ckout_symlink_create(fsl_cx *f, char const *zTgtFile, char const *zLinkFile)
int fsl__is_locally_modified(fsl_cx *f, const char *zFilename, fsl_size_t fileSize, const char *zOrigHash, fsl_int_t zOrigHashLen, fsl_fileperm_e origPerm, int *isModified)
void fsl__ptl_clear(fsl__ptl *c)
int fsl__call_xlink_listeners(fsl_deck *d)
void fsl__cx_stmt_yield(fsl_cx *f, fsl_stmt *q)
Must be passed all statement pointers obtained via fsl__cx_stmt().
void fsl__cx_content_buffer_yield(fsl_cx *f)
unsigned char * fsl__tokenizer_next(fsl__tokenizer *pIn, fsl_size_t *pLen)
int fsl__deck_crosslink_one(fsl_deck *d)
int fsl__repo_filename_fnid2(fsl_cx *f, char const *filename, fsl_id_t *rv, bool createNew)
int fsl__search_doc_touch(fsl_cx *f, fsl_satype_e saType, fsl_id_t rid, const char *docName)
int fsl__tag_propagate_all(fsl_cx *f, fsl_id_t pid)
int fsl__diff_all(fsl__diff_cx *p)
void fsl__mutex_leave(void)
void fsl__cx_scratchpad_yield(fsl_cx *f, fsl_buffer *b)
int fsl__cx_see_key(fsl_cx *f, const char *zDbFile, fsl_buffer *pOut, int *keyType)
int fsl__tmpfile(fsl_buffer *tgt, char const *zBaseName)
int fsl__phantom_rid_add(fsl_cx *f, fsl_id_t rid)
Inserts the given rid into the repo.phantom table.
const fsl_cx fsl__cx_empty
void fsl__dump_triples(fsl__diff_cx const *p, char const *zFile, int ln)
void fsl__pq_clear(fsl__pq *p)
void fsl__card_J_list_free(fsl_list *li, bool alsoListMem)
unsigned int fsl__ckout_rm_empty_dirs(fsl_cx *f, fsl_buffer const *tgtDir)
#define fsl__ptl_line_map(E)
Expands to a list of the names of all fsl_id_bag members of the fsl__ptl_line struct by invoking macr...
int fsl__tag_insert(fsl_cx *f, fsl_tagtype_e tagtype, char const *zTag, char const *zValue, fsl_id_t srcId, double mtime, fsl_id_t rid, fsl_id_t *outRid)
int fsl__ckout_rid(fsl_cx *f, fsl_id_t *rid)
Sets *rid to f->db.ckout.rid, fetching the latter if needed.
char * fsl__config_inop_rhs(int iMask)
int fsl__leaf_eventually_check(fsl_cx *f, fsl_id_t rid)
int fsl__repo_verify_before_commit(fsl_cx *f, fsl_id_t rid)
int fsl__symlink_copy(char const *zFrom, char const *zTo, bool realLink)
int fsl__cx_ticket_create_table(fsl_cx *f)
bool fsl__mutex_held(void)
bool fsl__cx_ptl_remove(fsl_cx *f, fsl__ptl_e where, fsl_id_t rid)
Removes rid from the given PTL list.
int fsl__shunned_remove(fsl_cx *f)
@ fsl__xfer_max_tokens
Max number of expected tokens in fsl__xfer::line.
int fsl__content_put_ex(fsl_cx *f, fsl_buffer const *pBlob, fsl_uuid_cstr zUuid, fsl_id_t srcId, fsl_size_t uncompSize, bool isPrivate, fsl_id_t *outRid)
int fsl__foci_register(fsl_cx *f, fsl_db *db)
fsl_xfcard_hash_t fsl_xfcard_hash(unsigned const char *word)
const fsl__tokenizer fsl__tokenizer_empty
fsl_xfcard const * fsl__xfcard_search(unsigned char const *z)
int fsl__private_rid_add(fsl_cx *f, fsl_id_t rid)
Inserts the given rid into the repo.private table.
void fsl__cx_mcache_clear(fsl_cx *f)
Clears the contents of f->cache.mcache.
int fsl__db_repo_verify_schema(fsl_db *db)
char * fsl__file_without_drive_letter(char *zFile)
int fsl__db_errcode(fsl_db *db, int sqliteCode)
const fsl__diff_cx fsl__diff_cx_empty
int fsl__ticket_rebuild(fsl_cx *f, char const *zTktId)
int fsl__repo_shun_artifacts(fsl_cx *f)
int fsl__ptl_insert(fsl__ptl *c, fsl__ptl_e where, fsl_id_t rid)
int fsl__delta_replace(fsl_cx *f, fsl_id_t rid, fsl_id_t srcid)
Replaces the repo.delta entry with the given rid.
bool fsl__ptl_remove(fsl__ptl const *c, fsl__ptl_e where, fsl_id_t rid)
void fsl__repo_verify_cancel(fsl_cx *f)
@ FSL__LOCALMOD_CONTENT
File size or hash (i.e.
@ FSL__LOCALMOD_LINK
The file type was switched between symlink and normal file.
@ FSL__LOCALMOD_NOTFOUND
File was not found in the local checkout.
@ FSL__LOCALMOD_PERM
Permissions changed.
@ FSL__LOCALMOD_NONE
Sentinel value.
bool fsl__is_reserved_fn_windows(const char *zPath, fsl_int_t nameLen)
int fsl__content_deltify(fsl_cx *f, fsl_id_t rid, fsl_id_t srcid, bool force)
int fsl__cx_attach_role(fsl_cx *f, const char *zDbName, fsl_dbrole_e r, bool createIfNotExists)
fsl_id_t fsl__uuid_to_rid2(fsl_cx *f, fsl_uuid_cstr uuid, fsl__phantom_e mode)
fsl_stmt * fsl__cx_stmt(fsl_cx *f, enum fsl__cx_stmt_e which)
Returns the given cached statement object, preparing it if needed.
void fsl__db_clear_strings(fsl_db *db, bool alsoBuffers)
int fsl__repo_import_blob(fsl_cx *f, fsl_input_f inFunc, void *inState, fsl_id_t *rid, fsl_uuid_str *uuid)
Imports content to f's opened repository's BLOB table using a client-provided input source.
int fsl__pclose2(int fdIn, FILE *pOut, int childPid)
void fsl__cx_content_caches_clear(fsl_cx *f)
Clears only caches which are relevant to content lookup.
int fsl__phantom_new(fsl_cx *f, fsl_uuid_cstr uuid, bool isPrivate, fsl_id_t *newId)
void fsl__cx_caches_reset(fsl_cx *f, bool isTxnCommit)
Clears various internal caches and resets various internally-cached values related to repository and ...
int fsl__repo_record_filename(fsl_cx *f)
int fsl__crosslink_end(fsl_cx *f, int resultCode)
int fsl__delta_delete(fsl_cx *f, fsl_id_t rid)
Replaces the repo.delta entry with the given rid.
void fsl__deck_clean_cards(fsl_deck *d, char const *letters)
fsl_id_t fsl__pq_extract(fsl__pq *p, void **pp)
int fsl__ckout_version_fetch(fsl_cx *f)
#define fsl__cx_cache_stmt_map(E)
int fsl__deck_crosslink(fsl_deck *d)
bool fsl__bccache_expire_oldest(fsl__bccache *c)
int fsl__ckout_safe_file_check(fsl_cx *f, char const *zFilename)
int fsl__cx_ticket_load_fields(fsl_cx *f, bool forceReload)
int fsl__find_filename_changes(fsl_cx *f, fsl_id_t iFrom, fsl_id_t iTo, bool revOK, uint32_t *pnChng, fsl_id_t **aiChng)
int fsl__tmpchmod(char const *z)
If FSL_PLATFORM_IS_UNIX then this returns the result of chmod(2) for the given file name,...
@ FSL_CARD_J_TICKET
Indicates that the field is used by the ticket table.
@ FSL_CARD_J_BOTH
Indicates that the field is used by both the ticket and ticketchng tables.
@ FSL_CARD_J_CHNG
Indicates that the field is used by the ticketchng table.
@ FSL_CARD_J_INVALID
Sentinel value.
int fsl__cx_init_db(fsl_cx *f, fsl_db *db)
#define STMT(MEMBER, IGNORED)
int fsl__bccache_insert(fsl__bccache *c, fsl_id_t rid, fsl_buffer *pBlob)
const fsl__xfer fsl__xfer_empty
Empty-initialized fsl__xfer instance, intended for copy initialization.
int fsl__repo_verify_at_commit(fsl_cx *f)
fsl__ptl_e
Enum entries corresponding to fsl__ptl_line members.
@ fsl__ptl_e_dummy
Sentinel value needed in slot 0.
int fsl__cx_ptl_pop(fsl_cx *f, bool isCommit)
Can fail with OOM if isCommit and f->cache.ptl.level>0.
fsl_buffer * fsl__cx_scratchpad(fsl_cx *f)
fsl_id_bag * fsl__cx_ptl_bag(fsl_cx *f, fsl__ptl_e which)
Returns the given bag for the current transaction level.
int fsl__unclustered_rid_add(fsl_cx *f, fsl_id_t rid)
Inserts the given rid into the repo.unclustered table.
int fsl__ptl_init(fsl__ptl *c, uint16_t prealloc)
const fsl__pq fsl__pq_empty
fsl_card_F * fsl__deck_F_seek(fsl_deck *d, const char *zName)
@ FSL_PHANTOM_PRIVATE
Indicates to fsl__uuid_to_rid2() that a private phantom artifact should be created if no artifact is ...
@ FSL_PHANTOM_PUBLIC
Indicates to fsl__uuid_to_rid2() that a public phantom artifact should be created if no artifact is f...
@ FSL_PHANTOM_NONE
Indicates to fsl__uuid_to_rid2() that no phantom artifact should be created.
void fsl__mutex_enter(void)
void fsl__diff_optimize(fsl__diff_cx *p)
int fsl__mcache_StaticAssertArraySizes[((sizeof(fsl__mcache_empty.aAge)/sizeof(fsl__mcache_empty.aAge[0]))==(sizeof(fsl__mcache_empty.decks)/sizeof(fsl__mcache_empty.decks[0]))) ? 1 :-1]
This will fail to compile if the arrays fsl__mcache::aAge and fsl__mcache::decks have different sizes...
int fsl__db_cached_clear_role(fsl_db *db, fsl_flag32_t role)
int fsl__ckout_install_schema(fsl_cx *f, bool dropIfExists)
void fsl__cx_ckout_clear(fsl_cx *f)
void fsl__id_bag_dump(fsl_id_bag const *src, FILE *to, char const *zHeader)
void fsl__fatal(int code, char const *fmt,...)
int fsl__deck_deltify_parent(fsl_deck *d)
If d->P.used then this makes d->P.list[0] a delta from d->rid, else this is a no-op.
int fsl__content_put(fsl_cx *f, fsl_buffer const *pBlob, fsl_id_t *newRid)
int fsl__qsort_cmp_J_cards(void const *lhs, void const *rhs)
int fsl__content_undeltify(fsl_cx *f, fsl_id_t rid)
int fsl__find_bin(char const *zPath, char const *zBinName, char **zOut)
int fsl__private_rid_delete(fsl_cx *f, fsl_id_t rid)
Deletes the given rid from the repo.private table.
void fsl__diff_cx_clean(fsl__diff_cx *cx)
char * fsl__db_setting_inop_rhs(void)
int fsl__cx_update_seen_delta_deck(fsl_cx *f)
uint32_t fsl_xfcard_hash_t
repo.h declares APIs specifically dealing with repository-db-side state, as opposed to specifically c...
fsl_tagtype_e
Artifact tag types used by the Fossil framework.
fsl_buffer content
Content of the artifact.
fsl_id_t rid
RID of the cached record.
fsl_uint_t nextAge
Next cache counter age.
struct fsl__bccache::@135011273363202315345003011053312261121034167134 metrics
Metrics solely for internal use in looking for optimizations.
fsl__bccache_line * list
List of cached content, ordered by age.
unsigned szLimit
Limit on the (approx.) amount of memory (in bytes) which can be taken up by the cached buffers at one...
unsigned changeMarker
Gets incremented on each insert for purposes of invalidating this cache.
unsigned szTotal
Total amount of buffer memory (in bytes) used by cached content.
uint16_t used
Number of entries "used" in this->list.
uint16_t capacity
Number of allocated slots in this->list.
fsl_id_bag inCache
RIDs of all artifacts currently in the this->list cache.
uint16_t usedLimit
Approximate upper limit on the number of entries in this->list.
int(* cmpLine)(const fsl_dline *const, const fsl_dline *const)
Predicate for comparing LHS/RHS lines for equivalence.
int nEdit
Number of integers (3x num of triples) in aEdit[].
int nTo
Number of lines in aTo[].
fsl_dline * aFrom
File content for the left side of the diff.
int nFrom
Number of lines in aFrom[].
fsl_dline * aTo
File content for the right side of the diff.
int * aEdit
aEdit describes the raw diff.
int nEditAlloc
Number of elements allocated for aEdit[].
fsl_deck decks[4]
Stores bitwise copies of decks.
unsigned hits
Counts the number of cache hits.
unsigned misses
Counts the number of cache misses.
fsl_uint_t aAge[4]
The virtual age of each deck in the cache.
fsl_uint_t nextAge
Next age value.
double priority
Priority of this element.
void * data
Raw data associated with this entry.
fsl_id_t id
RID of the entry.
fsl__pq_entry * list
The queue.
uint16_t capacity
Number of items allocated in this->list.
uint16_t used
Number of items used in this->list.
A cache of fsl_cx state which applies per transaction level.
This object manages a stack of fsl__ptl_line objects for a fsl_cx.
uint16_t level
0-based level.
int validateRidLevel
The transaction level in which the first RIDs (in this transaction stack) were added.
int rc
Persistent error code.
fsl__ptl_line * line
Current line in this->stack.
fsl_buffer mem
Memory for this->stack.
fsl__ptl_line * stack
Memory living in this->mem.
uint16_t allocated
Number of levels currently allocated.
unsigned char * z
First char of the next token.
unsigned char * zEnd
One-past-the-end of the input.
bool atEol
True if z points to the start of a new line.
bool syncPrivate
True to enable syncing private content.
fsl_sc chz
When using compressed responses, we need a layer of buffer to do the decompression.
int rc
Almost all APIs which deal with this class (A) become no-ops if this is non-0, returning this value i...
fsl_buffer cardPayload
Card payloads.
struct fsl__xfer::@106013134107234007264164355323121067061170035070 buf
Memory buffers.
bool nextIsPrivate
If true, next "file" received is a private artifact.
int clockSkewSeen
Seconds of offset from localhost.
char const * name
User name memory owned by fsl__xfer::url.
fsl_size_t nBytes
Number of bytes submitted for the request body.
fsl_sha1_cx sha1
Hash of all request payload content, for generating the sync login card.
fsl_buffer bRaw
A raw, untokenized copy of b.
fsl_cx * f
This object's fossil context.
struct fsl__xfer::@213277222214172032306271371067326072022273034014 remote
Info about the remote.
short projCodeMatch
Tells us whether the remote project-code matches this one.
char const * password
Password memory owned by fsl__xfer::url.
unsigned char * aToken[fsl__xfer_max_tokens]
Holds pointers to the individual tokens of b.
struct fsl__xfer::@254005110157216005234214245024012031337222344012 request
fsl_buffer uresp
When using compressed responses, this is where it will store the uncompressed response.
struct fsl__xfer::@052356161311116115313350223176365365100245236047 line
One line of sync protocol input, which we tokenize via fsl__xfer_readln() for ease of processing.
fsl_sc * ch
The underlying communication channel.
char * passwordToFree
Password memory owned by this object.
struct fsl__xfer::@335205311072101202001330246203343006010326070331 q
Prepared statements.
fsl_buffer scratch
Generic scratchpad buffer.
struct fsl__xfer::@123014107133202344251234372016036320270302156002 user
Info about the user which is relevant for sync.
fsl_uperm perm
Permissions calculated for the current user from sync login info.
struct fsl__xfer::@331035010067370376046064066104352104050150153142 clone
struct fsl__xfer::@061243306230124057304262021256341342124057174064 response
struct fsl__xfer::@100355014156122125342103015172167034116165030312 flag
Various flags.
fsl_buffer b
Holds the current input line.
uint8_t nToken
The number of tokens in use in aToken.
fsl_xfer_metrics n
Various counters.
fsl_buffer hash
Hashing and UUID-fetching buffer.
struct fsl__xfer::@155057320143012371237373355124062315143161126301 clientVersion
fsl_buffer emit
fsl_xfer_emit() and friends
fsl_xfer_config * config
The configuration object for a given xfer trip.
fsl_size_t aTokLen[fsl__xfer_max_tokens]
Holds the strlen() of each token in aTokens.
A general-purpose buffer class, analog to Fossil's Blob class, but it is not called fsl_blob to avoid...
F-cards each represent one file entry in a Manifest Artifact (i.e., a checkin version).
A fsl_confirm_callback_f and its callback state, packaged into a neat little struct for easy copy/rep...
A part of the configuration used by fsl_cx_init() and friends.
The main Fossil "context" type.
fsl_uuid_str uuid
The UUID of the current checkout.
fsl_buffer fileContent
A place for temporarily holding file content.
bool hasChngRid
Gets set to true (at some point) if the client has the ticketchng.rid db field.
volatile int interrupted
Error flag which is intended to be set via signal handlers or a UI thread to tell this context to can...
fsl_deck mf
The deck used for incrementally building certain parts of a checkin.
struct fsl_cx::@020007115146216147330072070376055307053057350026::@005264160241016147273066030235165362255023103043 gconfig
Holds info directly related to a global config database.
fsl_id_t mtimeManifest
Infrastructure for fsl_mtime_of_manifest_file().
char * titleColumn
The name of the ticket-table field which refers to a ticket's title.
fsl_id_bag selectedIds
Holds a list of "selected files" in the form of vfile.id values.
fsl_size_t nPeakBufSize
The maximum buffer capacity the content buffer had at relenquish-time.
fsl_list ignore
Holds the "ignore-glob" globs.
fsl_buffer emit
A scratchpad specific to fsl__cx_emit() and friends.
char * dir
The directory part of an opened checkout db.
bool hasCTime
Gets set to true (at some point) if the client has the ticket.tkt_ctime db field.
char * mainBranch
The 'main-branch' repo config setting, defaulting to trunk.
short next
A cursor hint to try to speed up fsl__cx_scratchpad() by about half a nanosecond, making it O(1) inst...
fsl_size_t nCached
Number of times the internal content cache was used.
short manifestSetting
Cache for the manifest config setting, as used by fsl_ckout_manifest_setting(), with the caveat that ...
struct fsl_cx::@020007115146216147330072070376055307053057350026::@163032253113021157001163004114365127333115365334 repo
Holds info directly related to a repo database.
bool isCrosslinking
True if fsl__crosslink_begin() has been called but fsl__crosslink_end() is still pending.
char * user
The default user name, for operations which need one.
fsl_buffer buf[8]
Strictly-internal temporary buffers we intend to reuse many times, mostly for filename canonicalizati...
fsl_flag32_t flags
Flags, some (or one) of which is runtime-configurable by the client (see fsl_cx_flags_e).
double mtime
Julian mtime of the checkout version, as reported by the [event] table.
fsl_db * dbMain
A pointer to the "main" db handle.
bool hasChng
Gets set to true (at some point) if the client has the ticketchng db table.
struct fsl_cx::@340103301036114033226306247146313264106064016232::@332143205074315256147100340201300235145204062251 stmt
Very-frequently-used SQL statements.
short caseInsensitive
Specifies whether SOME repository-level file-name comparisons/searches will work case-insensitively.
fsl_outputer output
Output channel used by fsl_output() and friends.
fsl__bccache blobContent
fsl_content_get() cache.
fsl_error error
Holds error state.
bool hasTicket
Gets set to true (at some point) if the client has the ticket db table.
fsl__ptl ptl
Per-transaction-level cache.
bool markPrivate
Whether or not a running commit process should be marked as private.
bool used[8]
Flags telling us which of this->buf is currenly in use.
struct fsl_cx::@060164061232151122333265333312342343114057105074 metrics
struct fsl_cx::@000334361201274132133024055052300077015112305352 scratchpads
Reuseable scratchpads for low-level file canonicalization buffering and whatnot.
fsl_size_t nTotalUsed
Total of the number of "used" bytes of the content cache each time it was relinquished.
fsl_buffer format
A scratchpad specific to fsl_cx_format() and friends.
short searchIndexExists
Records whether this repository has an FTS search index.
bool ignoreDephantomizations
If true, skip "dephantomization" of phantom blobs.
struct fsl_cx::@323334113275166327162035266202157107324004347306 ckin
State for incrementally preparing a checkin operation.
fsl_id_t rid
The rid of the current checkout.
char * projectCode
The "project-code" config option.
fsl_id_bag markAvailableCache
An internal cache for fsl__content_mark_availble().
fsl_db db
Holds the filename of the current checkout db and possibly related state.
fsl_state clientState
Can be used to tie client-specific data to the context.
bool xlinkClustersOnly
Flag indicating that only cluster control artifacts should be processed by manifest crosslinking.
fsl_confirmer confirmer
Confirmation callback.
void const * allocStamp
Marker which tells us whether fsl_cx_finalize() needs to fsl_free() this instance or not.
fsl_size_t dirLen
Optimization: fsl_strlen() of dir.
struct fsl_cx::@060164061232151122333265333312342343114057105074::@061005011364057346137312302005301211130061344163 content
fsl_cx_config cxConfig
A bitwise copy of the config object passed to fsl_cx_init() (or some default).
fsl_fstat fstat
Internal optimization to avoid duplicate fsl_stat() calls across two functions in some cases.
char ** tempDirs
Holds a list of temp-dir names.
char * statusColumn
The name of the ticket-table field which refers to a ticket's status.
fsl_xlinker_list xlinkers
List of callbacks for deck crosslinking purposes.
bool isSyncing
True when a sync is active, to prevent recursive attempts to sync.
fsl_list crnl
Holds the "crnl-glob" globs.
short allowSymlinks
Cached copy of the allow-symlinks config option, because it is (hypothetically) needed on many stat()...
short seenDeltaManifest
Indicates whether or not this repo has ever seen a delta manifest.
struct fsl_cx::@340103301036114033226306247146313264106064016232 cache
A place for caching generic things.
fsl_id_t rcvId
Record ID of rcvfrom entry during commits.
fsl__mcache mcache
Parsed-deck cache.
struct fsl_cx::@372345303007371026067315155322300072123137201133 ticket
Ticket-related information.
struct fsl_cx::@340103301036114033226306247146313264106064016232::@215000367172005003015217375313213241010174201332 globs
Holds various glob lists.
bool inFinalVerify
Is used to tell the content-save internals that a "finalverification" (a.k.a.
fsl_list customFields
Holds a list of (fsl_card_J*) records representing custom ticket table fields available in the db.
struct fsl_cx::@020007115146216147330072070376055307053057350026::@050063315273370257341365117161360367105046341152 ckout
Holds info directly related to a checkout database.
fsl_list binary
Holds the "binary-glob" globs.
fsl_size_t nCappedMaxSize
The number of times the content cache buffer was trimmed below the built-in maximum size.
fsl_buffer deltaContent
Reusable buffer for creating and fetching deltas via fsl_content_get() and fsl__content_deltify().
A "deck" stores (predictably enough) a collection of "cards." Cards are constructs embedded within Fo...
Information about each line of a file being diffed.
A container for storing generic error state.
A simple wrapper around the stat(2) structure resp.
A container type for lists of db record IDs.
Generic list container type.
An interface which encapsulates data for managing an output destination, primarily intended for use w...
The fsl_sc class encapsulates a streamable (as opposed to random-access) I/O channel intended solely ...
Holds state for SHA1 calculations.
Generic state-with-finalizer holder.
Represents a prepared statement handle.
Models user permissions precisely as fossil(1) does.
const fsl_xfcard_hash_t hash
A hash unique (in the context of fsl_xfcard) to this->name.
char const *const name
The protocol-level name of this card, e.g.
const fsl_xfcard_e type
Card type ID.
Various configuration pieces for libfossil sync transfer subsystem.
Metrics for use with the library's "xfer" (sync) subsystem.
A list of fsl_xlinker instances.
sync.h declares APIs dealing with fossil repository synchronization.
char * fsl_uuid_str
fsl_uuid_str and fsl_uuid_cstr are "for documentation andreadability purposes" typedefs used to denot...
int(* fsl_input_f)(void *state, void *dest, fsl_size_t *n)
Generic interface for streaming in data.
char const * fsl_uuid_cstr
The const counterpart of fsl_uuid_str.