3#if !defined(ORG_FOSSIL_SCM_FSL_REPO_H_INCLUDED)
4#define ORG_FOSSIL_SCM_FSL_REPO_H_INCLUDED
25#if defined(__cplusplus)
239#define fsl_card_F_list_empty_m {NULL, 0, 0, 0, 0}
536#define fsl_deck_empty_m { \
549 fsl_card_F_list_empty_m, \
561 fsl_buffer_empty_m , \
562 fsl_buffer_empty_m, \
722 char const * priorName);
770 char const * priorName);
816 char const * priorName);
895 void * visitorState );
1047 char const * key,
char const * value );
1158 char const * value);
1390 void * outputState);
1643 char const * symbolicName,
1747#define fsl_xlinker_empty_m {NULL,NULL,NULL}
1767#define fsl_xlinker_list_empty_m {0,0,NULL}
1957#define fsl_content_blob fsl_content_raw
2239#define fsl_card_F_empty_m { \
2271#define fsl_card_J_empty_m {false,0,NULL, NULL}
2300#define fsl_card_T_empty_m {FSL_TAGTYPE_INVALID, NULL, NULL,NULL}
2335#define fsl_card_Q_empty_m {FSL_CHERRYPICK_INVALID, NULL, NULL}
2352 char const * value);
2378 char const * value);
2496 char const * vRootDir,
2497 char const * fileName,
2499 void * progressState);
2581#define fsl_repo_extract_state_empty_m {\
2649#define fsl_repo_extract_opt_empty_m \
2707 char const * symToTag,
char const * tagName,
2708 char const * tagValue,
char const * userName,
2745 fsl_id_t artifactRidToTag,
char const * tagName,
2746 char const * tagValue,
char const * userName,
2807#define fsl_delta_src_id fsl_delta_r2s
2833#define fsl_uuid_is_shunned fsl_is_shunned_uuid
2930 void * visitorState);
2972#define fsl_branch_opt_empty_m { \
3662#define fsl_annotate_opt_empty_m {\
3727#define fsl_rebuild_metrics_empty_m { \
3728 .phantomCount = 0, \
3729 .counts = {0,0,0,0,0,0,0,0,0}, \
3730 .sizes = {0,0,0,0,0,0,0,0,0} \
3799#define fsl_rebuild_step_empty_m { \
3800 .f = NULL, .opt = NULL, .artifactCount = 0, \
3801 .stepNumber = 0, .rid = 0, .blobSize = -1, \
3802 .artifactType = FSL_SATYPE_INVALID, \
3804 .metrics = fsl_rebuild_metrics_empty_m \
3853#define fsl_rebuild_opt_empty_m {\
3854 .randomize=false, .createClusters=false, .dryRun=false \
3926 bool doFallback,
char ** zOut );
3968#define fsl_cidiff_opt_empty_m {0,0,0,0}
4102#define fsl_cidiff_state_empty_m {\
4104 0,FSL_CIDIFF_NONE, \
4237#define fsl_repo_create_opt_empty_m { \
4240 .commitMessage="egg", \
4241 .commitMessageMimetype=NULL, \
4243 .allowOverwrite=false, \
4244 .elideProjectCode=false \
4425#define fsl_uperm_map_base(M) \
4426 M(setup,'s') M(admin,'a') M(password,'p') \
4427 M(write,'i') M(read,'o') M(hyperlink,'h') M(clone,'g') \
4428 M(readWiki,'j') M(newWiki,'f') M(appendWiki,'m') M(writeWiki,'k') \
4429 M(moderateWiki,'l') M(readTicket,'r') M(newTicket,'n') M(appendTicket,'c') \
4430 M(writeTicket,'w') M(moderateTicket,'q') M(attach,'b') M(ticketReport,'t') \
4431 M(readAddr,'e') M(zip,'z') M(privateContent,'x') M(writeUnversioned,'y') \
4432 M(readForum,'2') M(writeForum,'3') M(trustedForum,'4') M(moderateForum,'5') \
4433 M(adminForum,'6') M(emailAlert,'7') M(announce,'A') M(chat,'C') \
4440#define fsl_uperm_map_inherited(M) \
4441 M(xReader,'u') M(xDeveloper,'v')
4443#define fsl_uperm_map_all(M) \
4444 fsl_uperm_map_base(M) fsl_uperm_map_inherited(M)
4447#define fsl__uperm_map_init(M,CH) .M=false,
4452#define fsl_uperm_empty_m { fsl_uperm_map_all(fsl__uperm_map_init) }
4497#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.
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...
fsl_fileperm_e
File permissions flags supported by fossil manifests.
fsl_satype_e
An enumeration of the types of structural artifacts used by Fossil.
int(* fsl_deck_xlink_f)(fsl_deck *d, void *state)
A callback interface for manifest crosslinking, so that we can farm out the updating of the event tab...
FSL_EXPORT const fsl_repo_create_opt fsl_repo_create_opt_empty
Initialized-with-defaults fsl_repo_create_opt struct, intended for copy-initialization.
FSL_EXPORT int fsl_deck_R_set(fsl_deck *mf, char const *md5)
Functionally identical to fsl_deck_B_set() except that it sets the R-card.
FSL_EXPORT int fsl_branch_create(fsl_cx *f, fsl_branch_opt const *opt, fsl_id_t *newRid)
Creates a new branch in f's repository.
FSL_EXPORT int fsl_deck_R_calc2(fsl_deck *d, char **tgt)
A variant of fsl_deck_R_calc() which calculates the given deck's R-card but does not assign it to the...
FSL_EXPORT int fsl_deck_F_set(fsl_deck *d, char const *name, fsl_uuid_cstr uuid, fsl_fileperm_e perm, char const *priorName)
Works mostly like fsl_deck_F_add() except that:
int fsl_annotate_step_f_fossilesque(void *state, fsl_annotate_opt const *opt, fsl_annotate_step const *step)
A fsl_annotate_step_f() impl.
fsl_tagtype_e
Artifact tag types used by the Fossil framework.
@ FSL_TAGTYPE_ADD
The "add tag" indicator, a.k.a.
@ FSL_TAGTYPE_PROPAGATING
The "propagating tag" indicator.
@ FSL_TAGTYPE_INVALID
Sentinel value for use with constructors/initializers.
@ FSL_TAGTYPE_CANCEL
The "cancel tag" indicator, a.k.a.
FSL_EXPORT int fsl_deck_to_json(fsl_deck const *d, fsl_output_f fn, void *fState)
Emits a JSON representation of the given deck to the given output routine.
FSL_EXPORT int fsl_mtime_of_manifest_file(fsl_cx *f, fsl_id_t vid, fsl_id_t fid, fsl_time_t *pMTime)
Compute the "mtime" of the file given whose blob.rid is "fid" that is part of check-in "vid".
FSL_EXPORT fsl_card_J * fsl_card_J_malloc(bool isAppend, char const *field, char const *value)
Allocates a new J-card record instance.
FSL_EXPORT fsl_card_T * fsl_card_T_malloc(fsl_tagtype_e tagType, fsl_uuid_cstr uuid, char const *name, char const *value)
Allocates a new fsl_card_T instance.
FSL_EXPORT fsl_id_t fsl_tag_id(fsl_cx *f, char const *tag, bool create)
Searches for a repo.tag entry given name in the given context's repository db.
const fsl_annotate_opt fsl_annotate_opt_empty
Initialized-with-defaults fsl_annotate_opt structure, intended for non-const copy initialization.
FSL_EXPORT int fsl_deck_A_set(fsl_deck *mf, char const *filename, char const *target, fsl_uuid_cstr uuidSrc)
Sets the A-card for an Attachment (FSL_SATYPE_ATTACHMENT) deck.
FSL_EXPORT int fsl_deck_W_set(fsl_deck *mf, char const *content, fsl_int_t len)
Semantically identical fsl_deck_B_set() but sets the W-card.
FSL_EXPORT int fsl_annotate(fsl_cx *f, fsl_annotate_opt const *opt)
UNDER CONSTRUCTION.
FSL_EXPORT int fsl_deck_F_next(fsl_deck *d, fsl_card_F const **f)
Fetches the next F-card entry from d.
FSL_EXPORT void fsl_deck_clean2(fsl_deck *deck, fsl_buffer *tgt)
A variant of fsl_deck_clean() which "returns" its content buffer for re-use by transferring,...
FSL_EXPORT char const * fsl_schema_repo2(void)
Returns the raw SQL code for the "transient" parts of a Fossil repository database - any parts which ...
const fsl_uperm fsl_uperm_empty
A fsl_uperm instance with all members set to false.
FSL_EXPORT int fsl_leaves_compute(fsl_cx *f, fsl_id_t vid, fsl_leaves_compute_e leafMode)
Creates a temporary table named "leaves" if it does not already exist, else empties it.
FSL_EXPORT const fsl_card_T fsl_card_T_empty
Defaults-initialized fsl_card_T instance.
FSL_EXPORT bool fsl_content_is_private(fsl_cx *f, fsl_id_t rid)
Returns true if the given rid is marked as PRIVATE in f's current repository.
FSL_EXPORT bool fsl_is_shunned_uuid(fsl_cx *f, fsl_uuid_cstr zUuid)
Return true if the given artifact ID should is listed in f's shun table or if zUuid is an SHA1 has an...
FSL_EXPORT int fsl_deck_M_add(fsl_deck *mf, fsl_uuid_cstr uuid)
Adds the given UUID as an M-card entry.
FSL_EXPORT int fsl_repo_blob_lookup(fsl_cx *f, fsl_buffer const *src, fsl_id_t *ridOut, fsl_uuid_str *hashOut)
This is a wrapper around fsl_cx_hash_buffer() which looks for a matching artifact for the given input...
FSL_EXPORT int fsl_deck_F_add(fsl_deck *d, char const *name, fsl_uuid_cstr uuid, fsl_fileperm_e perm, char const *priorName)
Adds a new F-card to the given deck.
FSL_EXPORT int fsl_deck_P_add(fsl_deck *mf, fsl_uuid_cstr parentUuid)
Adds the given UUID as a parent of the given change record.
FSL_EXPORT int fsl_deck_load_rid(fsl_cx *f, fsl_deck *d, fsl_id_t rid, fsl_satype_e type)
Loads the content from given rid and tries to parse it as a Fossil artifact.
FSL_EXPORT char const * fsl_schema_ticket_reports(void)
Returns the raw SQL code for Fossil ticket reports schemas.
FSL_EXPORT int fsl_deck_derive(fsl_deck *d)
UNDER CONSTRUCTION!
int(* fsl_rebuild_f)(fsl_rebuild_step const *state)
Callback for use with fsl_repo_rebuild() in order to report progress.
FSL_EXPORT char const * fsl_schema_config(void)
Returns the raw SQL code for a Fossil global config database.
FSL_EXPORT int fsl_card_F_content(fsl_cx *f, fsl_card_F const *fc, fsl_buffer *dest)
If fc->uuid refers to a blob in f's repository database then that content is placed into dest (as per...
FSL_EXPORT void fsl_card_F_list_finalize(fsl_card_F_list *li)
Frees all memory owned by li and the F-cards it contains.
fsl_cidiff_e
Descriptors for the type of information being reported for each step of fsl_cidiff() iteration,...
@ FSL_CIDIFF_FILE_ADDED
Indicates that the file is in v2 but not v1.
@ FSL_CIDIFF_NONE
Indicates that the v1 and v2 files are the same.
@ FSL_CIDIFF_FILE_MODIFIED
Indicates that the hashes of the v1 and v2 files differ.
@ FSL_CIDIFF_FILE_PERMS
Indicates that the permissions of the current file differ between v1 and v2.
@ FSL_CIDIFF_FILE_REMOVED
Indicates that the file is in v1 but not v2.
@ FSL_CIDIFF_FILE_RENAMED
Indicates that the v2 file was renamed.
fsl_cherrypick_type_e
Types of cherrypick merges.
@ FSL_CHERRYPICK_INVALID
Sentinel value.
@ FSL_CHERRYPICK_ADD
Indicates a cherrypick merge.
@ FSL_CHERRYPICK_BACKOUT
Indicates a cherrypick backout.
FSL_EXPORT char const * fsl_schema_ticket(void)
Returns the raw SQL code for a Fossil checkout db's default core ticket-related tables.
FSL_EXPORT bool fsl_rid_is_leaf(fsl_cx *f, fsl_id_t rid)
Returns true if the checkin with the given rid is a leaf, false if not.
FSL_EXPORT int fsl_repo_open(fsl_cx *f, char const *repoDbFile)
Opens the given db file name as f's repository.
FSL_EXPORT fsl_id_t fsl_uuid_to_rid(fsl_cx *f, char const *uuid)
Searches f's repo database for the a blob with the given uuid (any unique UUID prefix).
FSL_EXPORT int fsl_uperm_add(fsl_cx *f, fsl_uperm *pTgt, char const *zCap)
Adds any permissions specified in zCap to pTgt.
FSL_EXPORT char const * fsl_schema_forum(void)
Returns the raw SQL code for the "forum" parts of a Fossil repository database.
FSL_EXPORT int fsl_deck_J_add(fsl_deck *mf, bool isAppend, char const *key, char const *value)
Adds a J-card to the given deck, setting/updating the given ticket property key to the given value.
FSL_EXPORT int fsl_deck_C_set(fsl_deck *mf, char const *comment, fsl_int_t cardLen)
Semantically identical to fsl_deck_B_set() but sets the C-card and does not place a practical limit o...
FSL_EXPORT fsl_int_t fsl_leaves_computed_count(fsl_cx *f)
Requires that a prior call to fsl_leaves_compute() has succeeded, else results are undefined.
FSL_EXPORT int fsl_repo_leaves_rebuild(fsl_cx *f)
Recompute/rebuild the entire repo.leaf table.
FSL_EXPORT int fsl_content_make_public(fsl_cx *f, fsl_id_t rid)
Marks the given rid public, if it was previously marked as private.
FSL_EXPORT int fsl_deck_L_set(fsl_deck *mf, char const *title, fsl_int_t len)
Semantically identical fsl_deck_B_set() but sets the L-card.
FSL_EXPORT char fsl_tag_prefix_char(fsl_tagtype_e t)
Returns one of '-', '+', or '*' for a valid input parameter, 0 for any other value.
FSL_EXPORT bool fsl_might_be_artifact(fsl_buffer const *src)
Quickly determines whether the content held by the given buffer "might" be a structural artifact.
FSL_EXPORT const fsl_cidiff_opt fsl_cidiff_opt_empty
Initialized-with-defaults fsl_cidiff_opt structure, intended for non-const copy initialization.
FSL_EXPORT bool fsl_repo_is_readonly(fsl_cx const *f)
UNTESTED.
FSL_EXPORT bool fsl_rid_is_version(fsl_cx *f, fsl_id_t rid)
Returns true if, according to f's current repo's [event] table, rid refers to a checkin,...
FSL_EXPORT int fsl_deck_parse(fsl_deck *d, fsl_buffer *src)
Parses src as Control Artifact content and populates d with it.
FSL_EXPORT int fsl_branch_of_rid(fsl_cx *f, fsl_id_t rid, bool doFallback, char **zOut)
Tries to determine the branch name of the given rid, which is assumed to refer to a checkin artifact.
FSL_EXPORT int fsl_delta_s2r(fsl_cx *f, fsl_id_t deltaRid, fsl_id_t *rv)
The counterpart of fsl_delta_r2s(): for a given delta.srcid, return the associated delta....
FSL_EXPORT int fsl_delta_r2s(fsl_cx *f, fsl_id_t deltaRid, fsl_id_t *rv)
Looks for the delta table record where rid==deltaRid, and returns that record's srcid via *rv.
int(* fsl_card_F_visitor_f)(fsl_card_F const *fc, void *state)
Callback type for use with fsl_deck_F_foreach() and friends.
FSL_EXPORT char const * fsl_schema_repo1(void)
Returns the raw SQL code for the "static" parts of a Fossil repository database.
FSL_EXPORT int fsl_repo_project_code(fsl_cx *f, char const **pOut)
Fetches f's current project code.
FSL_EXPORT int fsl_deck_D_set(fsl_deck *mf, double date)
Sets mf's D-card as a Julian Date value.
int(* fsl_cidiff_f)(fsl_cidiff_state const *state)
Callback type for use with fsl_cidiff().
FSL_EXPORT int fsl_deck_F_rewind(fsl_deck *d)
Rewinds d's F-card traversal iterator and loads d's baseline manifest, if it has one (i....
FSL_EXPORT int fsl_branch_main(fsl_cx *f, char const **zOut, bool forceReload)
Checks f's repo db for a setting named 'main-branch'.
FSL_EXPORT int fsl_deck_T_add2(fsl_deck *mf, fsl_card_T *t)
Adds the given tag instance to the given manifest.
FSL_EXPORT fsl_uuid_str fsl_rid_to_uuid(fsl_cx *f, fsl_id_t rid)
The opposite of fsl_uuid_to_rid(), this returns the UUID string of the given blob record ID.
FSL_EXPORT int fsl_deck_T_add(fsl_deck *d, fsl_tagtype_e tagType, fsl_uuid_cstr uuid, char const *name, char const *value)
Adds a new T-card (tag) entry to the given deck.
FSL_EXPORT fsl_uuid_str fsl_rid_to_artifact_uuid(fsl_cx *f, fsl_id_t rid, fsl_satype_e type)
This works identically to fsl_rid_to_uuid() except that it will only resolve to a UUID if an artifact...
FSL_EXPORT bool fsl_repo_forbids_delta_manifests(fsl_cx *f)
Returns true if f's current repository has the forbid-delta-manifests setting set to a truthy value.
FSL_EXPORT int fsl_deck_F_foreach(fsl_deck *d, fsl_card_F_visitor_f cb, void *visitorState)
For each F-card in d, cb(card,visitorState) is called.
FSL_EXPORT bool fsl_wiki_page_exists(fsl_cx *f, char const *pageName)
Returns true (non-0) if f's repo database contains a page with the given name, else false.
FSL_EXPORT bool fsl_deck_has_required_cards(fsl_deck const *d)
Returns true if d contains data for all required cards, as determined by the value of d->type,...
FSL_EXPORT int fsl_deck_K_set(fsl_deck *mf, fsl_uuid_cstr uuid)
Sets the K-card (ticket ID) on the given deck.
FSL_EXPORT int fsl_cidiff(fsl_cx *f, fsl_cidiff_opt const *opt)
A utility for reporting the differences between the manifests of two checkins.
FSL_EXPORT int fsl_repo_dir_names(fsl_cx *f, fsl_id_t rid, fsl_list *tgt, bool addSlash)
Fetches the list of all directory names for a given checkin record id or (if rid is negative) the who...
FSL_EXPORT int fsl_deck_branch_set(fsl_deck *d, char const *branchName)
A convenience form of fsl_deck_T_add() which adds two propagating tags to the given deck: "branch" wi...
FSL_EXPORT int fsl_wiki_latest_rid(fsl_cx *f, char const *pageName, fsl_id_t *newRid)
Fetches the most recent RID for the given wiki page name and assigns *newId (if it is not NULL) to th...
FSL_EXPORT bool fsl_leaves_computed_has(fsl_cx *f)
Requires that a prior call to fsl_leaves_compute() has succeeded, else results are undefined.
FSL_EXPORT int fsl_sym_to_uuid(fsl_cx *f, char const *sym, fsl_satype_e type, fsl_uuid_str *rv, fsl_id_t *rid)
Similar to fsl_sym_to_rid() but on success it returns a UUID string by assigning it to *rv (if rv is ...
FSL_EXPORT const fsl_cidiff_state fsl_cidiff_state_empty
Initialized-with-defaults fsl_cidiff_state structure, intended for non-const copy initialization.
FSL_EXPORT fsl_card_F const * fsl_deck_F_search(fsl_deck *d, const char *zName)
Looks for a file in a manifest or (for a delta manifest) its baseline.
FSL_EXPORT int fsl_card_is_legal(fsl_satype_e t, char card)
This function is a programmatic interpretation of this table:
FSL_EXPORT int fsl_wiki_foreach_page(fsl_cx *f, fsl_deck_visitor_f cb, void *state)
For each unique wiki page name in f's repostory, this calls cb(), passing it the manifest of the most...
FSL_EXPORT void fsl_card_T_free(fsl_card_T *t)
If t is not NULL, calls fsl_card_T_clean(t) and then passes t to fsl_free().
FSL_EXPORT const fsl_repo_extract_opt fsl_repo_extract_opt_empty
Initialized-with-defaults fsl_repo_extract_opt instance, intended for intializing new non-const insta...
FSL_EXPORT int fsl_card_F_list_reserve(fsl_card_F_list *li, uint32_t n)
Ensures that the given list has capacity for at least n entries.
FSL_EXPORT fsl_card_Q * fsl_card_Q_malloc(fsl_cherrypick_type_e type, fsl_uuid_cstr target, fsl_uuid_cstr baseline)
Allocates a new cherrypick record instance.
FSL_EXPORT int fsl_content_size_v2(fsl_cx *f, fsl_id_t rid, fsl_int_t *pOut)
Given a blob RID, this function extracts its size from the blob.rid db field.
FSL_EXPORT int fsl_deck_I_set(fsl_deck *mf, fsl_uuid_cstr uuid)
Sets the 'I' card on a forum-post deck to a copy of the given UUID.
FSL_EXPORT int fsl_deck_P_add_rid(fsl_deck *mf, fsl_id_t parentRid)
A convenience wrapper around fsl_deck_P_add() which resolves the given RID to its UUID and passes it ...
FSL_EXPORT int fsl_repo_extract(fsl_cx *f, fsl_repo_extract_opt const *opt)
Iterates over the file content of a single checkin in a repository, sending the appropriate version o...
FSL_EXPORT fsl_id_t fsl_deck_P_get_id(fsl_deck *d, int index)
If d contains a P card with the given index, this returns the RID corresponding to the UUID at that i...
FSL_EXPORT int fsl_cx_schema_ticket(fsl_cx *f, fsl_buffer *pOut)
If f's opened repository has a non-empty config entry named 'ticket-table', this returns its text via...
FSL_EXPORT void fsl_deck_finalize(fsl_deck *deck)
Frees all memory owned by deck (see fsl_deck_clean()).
FSL_EXPORT int fsl_tag_an_rid(fsl_cx *f, fsl_tagtype_e tagType, fsl_id_t artifactRidToTag, char const *tagName, char const *tagValue, char const *userName, double mtime, fsl_id_t *newId)
Adds a control record to f's repositoriy that either creates or cancels a tag.
FSL_EXPORT int fsl_sym_to_rid(fsl_cx *f, char const *sym, fsl_satype_e type, fsl_id_t *rv)
Resolves client-provided symbol as an artifact's db record ID.
FSL_EXPORT int fsl_deck_unshuffle(fsl_deck *d, bool calculateRCard)
Prepares the given deck for output by ensuring that cards which need to be sorted are sorted,...
FSL_EXPORT int fsl_content_get(fsl_cx *f, fsl_id_t blobRid, fsl_buffer *tgt)
Functionally similar to fsl_content_raw() but does a lot of work to ensure that the returned blob is ...
FSL_EXPORT void fsl_card_J_free(fsl_card_J *cp)
Frees a J-card record created by fsl_card_J_malloc().
FSL_EXPORT int fsl_deck_foreach(fsl_cx *f, fsl_satype_e type, fsl_deck_visitor_f visitor, void *visitorState)
Iterates over all artifacts in f's current repository of the given type, passing each one to the give...
FSL_EXPORT int fsl_tkt_id_to_rids(fsl_cx *f, char const *tktId, fsl_id_t **ridList)
Searches for matching blob records for a fossil ticket ID.
FSL_EXPORT const fsl_card_Q fsl_card_Q_empty
Empty-initialized fsl_card_Q struct.
FSL_EXPORT int fsl_rid_to_uuid2(fsl_cx *f, fsl_id_t rid, fsl_buffer *uuid)
Works like fsl_rid_to_uuid() but assigns the UUID to the given buffer, re-using its memory,...
FSL_EXPORT const fsl_deck fsl_deck_empty
Initialized-with-defaults fsl_deck structure, intended for copy initialization.
fsl_xlinker * fsl_xlinker_by_name(fsl_cx *f, char const *name)
Searches f's crosslink callbacks for an entry with the given name and returns that entry,...
fsl_leaves_compute_e
Flags for use with fsl_leaves_compute().
@ FSL_LEAVES_COMPUTE_OPEN
Compute only leaves without the "closed" tag.
@ FSL_LEAVES_COMPUTE_CLOSED
Compute only leaves with the "closed" tag.
@ FSL_LEAVES_COMPUTE_ALL
Compute all leaves regardless of the "closed" tag.
FSL_EXPORT const fsl_rebuild_opt fsl_rebuild_opt_empty
Initialized-with-defaults fsl_rebuild_opt structure, intended for non-const copy initialization.
FSL_EXPORT fsl_deck * fsl_deck_malloc(void)
Allocates a new fsl_deck instance.
FSL_EXPORT fsl_int_t fsl_content_size(fsl_cx *f, fsl_id_t blobRid)
For the given blob.rid value, returns the blob.size value of that record via *rv.
int(* fsl_annotate_step_f)(void *state, fsl_annotate_opt const *opt, fsl_annotate_step const *step)
Callback for use with fsl_annotate().
FSL_EXPORT int fsl_repo_manifest_write(fsl_cx *f, fsl_id_t manifestRid, fsl_buffer *manifest, fsl_buffer *manifestUuid, fsl_buffer *manifestTags)
This is a variant of fsl_ckout_manifest_write() which writes data regarding the given manifest RID to...
FSL_EXPORT void fsl_card_T_clean(fsl_card_T *t)
Frees up any memory owned by t and clears out t's state, but does not free t.
FSL_EXPORT bool fsl_is_reserved_fn(const char *zFilename, fsl_int_t nameLen)
Returns true if the specified file name ends with any reserved name, e.g.: FOSSIL or ....
FSL_EXPORT fsl_int_t fsl_count_nonbranch_children(fsl_cx *f, fsl_id_t rid)
Counts the number of primary non-branch children for the given check-in.
FSL_EXPORT int fsl_xlink_listener(fsl_cx *f, char const *name, fsl_deck_xlink_f cb, void *cbState)
Adds the given function as a "crosslink callback" for the given Fossil context.
FSL_EXPORT int fsl_deck_E_set(fsl_deck *mf, double date, fsl_uuid_cstr uuid)
Sets the E-card in the given deck.
const fsl_xlinker fsl_xlinker_empty
Empty-initialized fsl_xlinker struct, intended for copy intialization.
fsl_wiki_save_mode_t
A helper type for use with fsl_wiki_save(), intended primarily to help client-side code readability s...
@ FSL_WIKI_SAVE_MODE_CREATE
Indicates that fsl_wiki_save() must only allow the creation of a new page, and must fail if such an e...
@ FSL_WIKI_SAVE_MODE_UPDATE
Indicates that fsl_wiki_save() must only allow the update of an existing page, and will not create a ...
@ FSL_WIKI_SAVE_MODE_UPSERT
Indicates that fsl_wiki_save() must allow both the update and creation of pages.
FSL_EXPORT const fsl_card_F_list fsl_card_F_list_empty
Empty-initialized fsl_card_F instance for non-const copy initialization.
FSL_EXPORT char fsl_rid_is_a_checkin(fsl_cx *f, fsl_id_t rid)
Returns true (non-0) if f is not NULL and f has an opened repo which contains a checkin with the give...
FSL_EXPORT int fsl_deck_H_set(fsl_deck *mf, char const *comment, fsl_int_t cardLen)
Sets the 'H' card on a forum-post deck to a copy of the given comment.
FSL_EXPORT int fsl_deck_output(fsl_deck *d, fsl_output_f out, void *outputState)
Renders the given control artifact's contents to the given output function and calculates any cards w...
FSL_EXPORT void fsl_card_Q_free(fsl_card_Q *cp)
Frees a cherrypick record created by fsl_card_Q_malloc().
FSL_EXPORT int fsl_deck_N_set(fsl_deck *mf, char const *mimeType, fsl_int_t len)
Semantically identical to fsl_deck_B_set() but sets the N card.
FSL_EXPORT int fsl_content_get_sym(fsl_cx *f, char const *sym, fsl_buffer *tgt)
Uses fsl_sym_to_rid() to convert sym to a record ID, then passes that to fsl_content_get().
const fsl_xlinker_list fsl_xlinker_list_empty
Empty-initializes fsl_xlinker_list struct, intended for copy intialization.
FSL_EXPORT void fsl_deck_init(fsl_cx *cx, fsl_deck *d, fsl_satype_e type)
Must be called to initialize a newly-created/allocated deck instance.
FSL_EXPORT int fsl_deck_parse2(fsl_deck *d, fsl_buffer *src, fsl_id_t rid)
This variant of fsl_deck_parse() works identically to that function except for the 3rd argument.
FSL_EXPORT int fsl_deck_Q_add(fsl_deck *mf, int type, fsl_uuid_cstr target, fsl_uuid_cstr baseline)
Adds a Q-card record to the given deck.
FSL_EXPORT int fsl_deck_baseline_fetch(fsl_deck *d)
Loads the baseline manifest specified in d->B.uuid, if any and if necessary.
FSL_EXPORT const fsl_repo_extract_state fsl_repo_extract_state_empty
Initialized-with-defaults fsl_repo_extract_state instance, intended for non-const copy initialization...
FSL_EXPORT const fsl_card_J fsl_card_J_empty
Empty-initialized fsl_card_J struct.
FSL_EXPORT void fsl_deck_clean(fsl_deck *deck)
Frees all resources belonging to the given deck's members (including its parents, recursively),...
FSL_EXPORT int fsl_wiki_save(fsl_cx *f, char const *pageName, fsl_buffer const *b, char const *userName, char const *mimeType, fsl_wiki_save_mode_t creationPolicy)
Saves wiki content to f's repository db.
FSL_EXPORT const fsl_rebuild_step fsl_rebuild_step_empty
Initialized-with-defaults fsl_rebuild_step structure, intended for non-const copy initialization.
FSL_EXPORT int fsl_repo_create(fsl_cx *f, fsl_repo_create_opt const *opt)
Creates a new repository database using the options provided in the second argument.
FSL_EXPORT int fsl_repo_rebuild(fsl_cx *f, fsl_rebuild_opt const *opt)
"Rebuilds" the current repository database.
FSL_EXPORT int fsl_reserved_fn_check(fsl_cx *f, const char *zPath, fsl_int_t nFile, bool relativeToCwd)
Uses fsl_is_reserved_fn() to determine whether the filename part of zPath is legal for use as an in-r...
FSL_EXPORT fsl_id_t fsl_repo_filename_fnid(fsl_cx *f, char const *filename)
Tries to determine the [filename.fnid] value for the given filename.
FSL_EXPORT char const * fsl_schema_ckout(void)
Returns the raw SQL code for a Fossil checkout database.
fsl_annotate_step_e
"Stage" flag for use with fsl_annotate_step and fsl_annotate_step_f().
@ FSL_ANNOTATE_STEP_LIMITED
Indicates that the current fsl_annotate_step_f() call has only partial version information for the li...
@ FSL_ANNOTATE_STEP_VERSION
Indicates that the current fsl_annotate_step_f() call is part of the "version dump" stage of the anno...
@ FSL_ANNOTATE_STEP_FULL
Indicates that the current fsl_annotate_step_f() call has complete version information for the line i...
FSL_EXPORT const fsl_card_F fsl_card_F_empty
FSL_EXPORT int fsl_wiki_load_latest(fsl_cx *f, char const *pageName, fsl_deck *d)
Loads the artifact for the most recent version of the given wiki page, populating d with its contents...
FSL_EXPORT int fsl_deck_B_set(fsl_deck *mf, fsl_uuid_cstr uuidBaseline)
Sets or unsets (if uuidBaseline is NULL or empty) the B-card for the given manifest to a copy of the ...
FSL_EXPORT int fsl_mtime_of_F_card(fsl_cx *f, fsl_id_t vid, fsl_card_F const *fc, fsl_time_t *pMTime)
A convenience form of fsl_mtime_of_manifest_file() which looks up fc's RID based on its UUID.
FSL_EXPORT int fsl_deck_F_set_content(fsl_deck *d, char const *name, fsl_buffer const *src, fsl_fileperm_e perm, char const *priorName)
UNDER CONSTRUCTION!
fsl_tagid_e
Hard-coded IDs used by the 'tag' table of repository DBs.
@ FSL_TAGID_USER
DB: tag.tagname='user'.
@ FSL_TAGID_PRIVATE
DB: tag.tagname='private'.
@ FSL_TAGID_BGCOLOR
DB string tagname='bgcolor'.
@ FSL_TAGID_COMMENT
DB: tag.tagname='comment'.
@ FSL_TAGID_BRANCH
DB: tag.tagname='branch'.
@ FSL_TAGID_CLOSED
DB: tag.tagname='closed'.
@ FSL_TAGID_NOTE
DB: tag.tagname='note'.
@ FSL_TAGID_CLUSTER
DB: tag.tagname='cluster'.
@ FSL_TAGID_MAX_INTERNAL
Largest tag ID reserved for internal use.
@ FSL_TAGID_PARENT
DB: tag.tagname='parent'.
@ FSL_TAGID_DATE
DB: tag.tagname='date'.
@ FSL_TAGID_HIDDEN
DB: tag.tagname='hidden'.
FSL_EXPORT int fsl_content_raw(fsl_cx *f, fsl_id_t blobRid, fsl_buffer *tgt)
For the given blob.rid value, fetches the content field of that record and overwrites tgt's contents ...
FSL_EXPORT int fsl_deck_G_set(fsl_deck *mf, fsl_uuid_cstr uuid)
Sets the 'G' card on a forum-post deck to a copy of the given UUID.
FSL_EXPORT int fsl_tag_sym(fsl_cx *f, fsl_tagtype_e tagType, char const *symToTag, char const *tagName, char const *tagValue, char const *userName, double mtime, fsl_id_t *newId)
Equivalent to fsl_tag_an_rid() except that it takes a symbolic artifact name in place of an artifact ...
FSL_EXPORT int fsl_wiki_names_get(fsl_cx *f, fsl_list *tgt)
Fetches the list of all wiki page names in f's current repo db and appends them as new (char *) strin...
FSL_EXPORT int fsl_deck_load_sym(fsl_cx *f, fsl_deck *d, char const *symbolicName, fsl_satype_e type)
A convenience form of fsl_deck_load_rid() which uses fsl_sym_to_rid() to convert symbolicName into an...
int(* fsl_repo_extract_f)(fsl_repo_extract_state const *xstate)
A callback type for use with fsl_repo_extract().
FSL_EXPORT int fsl_card_F_compare_name(fsl_card_F const *lhs, fsl_card_F const *rhs)
Given two F-card instances, this function compares their names (case-sensitively).
FSL_EXPORT fsl_id_t fsl_leaves_computed_latest(fsl_cx *f)
Requires that a prior call to fsl_leaves_compute() has succeeded, else results are undefined.
FSL_EXPORT const fsl_branch_opt fsl_branch_opt_empty
FSL_EXPORT int fsl_deck_U_set(fsl_deck *mf, char const *userName)
Semantically identical fsl_deck_B_set() but sets the U-card.
FSL_EXPORT int fsl_repo_zip_sym_to_filename(fsl_cx *f, char const *sym, char const *vRootDir, char const *fileName, fsl_card_F_visitor_f progressVisitor, void *progressState)
ZIPs up a copy of the contents of a specific version from f's opened repository db.
const fsl_uperm fsl_uperm_all
A fsl_uperm instance with all members set to true except for the "inherits from" properties (xReader ...
int(* fsl_deck_visitor_f)(fsl_cx *f, fsl_deck *d, void *state)
Generic callback interface for visiting decks.
FSL_EXPORT int fsl_deck_save(fsl_deck *d, bool isPrivate)
Saves the given deck into f's repository database as new control artifact content.
FSL_EXPORT int fsl_deck_R_calc(fsl_deck *d)
Calculates the value of d's R-card based on its F-cards and updates d->R.
FSL_EXPORT void fsl_leaves_computed_cleanup(fsl_cx *f)
Cleans up any db-side resources created by fsl_leaves_compute().
Configuration for use with fsl_annotate().
uint32_t limitMs
An approximate number of milliseconds of processing time to limit the annotation to.
fsl_annotate_step_f out
The output channel for the resulting annotation.
uint32_t limitVersions
The maximum number of versions to search through.
char const * filename
The repository-root-relative NUL-terminated filename to annotate.
bool fileVersions
Output file blob versions, instead of checkin versions.
bool praise
If true, include the name of the user for which each change is attributed (noting that merges show wh...
fsl_id_t versionRid
The checkin from which the file's version should be selected.
fsl_id_t originRid
The origin checkin version.
bool dumpVersions
If true, annotation output will start with a list of all versions analyzed by the annotation process.
void * outState
State for passing as the first argument to this->out().
Callback state for use by fsl_annotate_step_f().
uint32_t lineLength
The number of bytes in this->line.
fsl_uuid_cstr versionHash
The hash of the checkin version from which this->line was pulled.
int stepNumber
Step number in this annotation run.
char const * username
The user name this change was attributed to, noting that merges are attributed to the one who did the...
fsl_uuid_cstr fileHash
The hash of the file version from which this->line was pulled.
double mtime
The mtime field from the [event] table (timeline) entry associated with this version.
uint32_t lineNumber
Line number for the current file.
fsl_annotate_step_e stepType
Tells the caller the "type" of annotation step this call represents.
char const * line
NUL-terminated current line of the input file, minus any newline and/or carriage return.
Holds options for use with fsl_branch_create().
double mtime
The julian time of the branch.
bool isPrivate
If true, the branch will be marked as private.
char const * user
User name for the branch.
char const * name
The name of the branch.
char const * comment
Optional comment (may be NULL).
fsl_id_t basisRid
The checkin RID from which the branch should originate.
char const * bgColor
Optional background color for the fossil(1) HTML timeline view.
A general-purpose buffer class, analog to Fossil's Blob class, but it is not called fsl_blob to avoid...
A list of fsl_card_F objects.
fsl_card_F * list
The list of F-cards.
uint32_t used
The number of entries in this->list which are in use.
uint32_t capacity
The number of entries currently allocated in this->list.
int32_t cursor
An internal cursor into this->list, used primarily for properly traversing the file list in delta man...
uint32_t flags
Internal flags.
F-cards each represent one file entry in a Manifest Artifact (i.e., a checkin version).
char * priorName
Previous name if the file was renamed, else NULL.
fsl_uuid_str uuid
UUID of the underlying blob record for the file.
char * name
Name of the file.
fsl_fileperm_e perm
File permissions.
bool deckOwnsStrings
An internal optimization.
Represents a J card in a Ticket Control Artifact.
unsigned char flags
For internal use only.
char * field
The ticket field to update.
char * value
The value for the field.
bool append
If true, the new value should be appended to any existing one with the same key, else it will replace...
Represents a Q card in a Manifest or Control Artifact.
fsl_cherrypick_type_e type
0==invalid, negative==backed out, positive=cherrypicked.
fsl_uuid_str baseline
UUID of the baseline for the cherrypick.
fsl_uuid_str target
UUID of the target of the cherrypick.
Represents a tag in a Manifest or Control Artifact.
fsl_uuid_str uuid
UUID of the artifact this tag is tagging.
fsl_tagtype_e type
The type of tag.
char * value
The tag's value.
char * name
The tag's name.
Parameters for fsl_checkin_commit().
Options for use with fsl_cidiff().
fsl_cidiff_f callback
Callback to call on each iteration step.
fsl_id_t v2
Checkin version (RID) for "version 2".
fsl_id_t v1
Checkin version (RID) for "version 1".
void * callbackState
Opaque state for the callback.
Holds the state for a single iteration step of fsl_cidiff.
fsl_cx * f
The associated fsl_cx instance.
fsl_card_F const * fc2
The file, if any, corresponding to this->v2.
fsl_deck const * d2
The deck corresponding to this->opt->v2.
fsl_deck const * d1
The deck corresponding to this->opt->v1.
int changes
Describes the change(s) being reported by the current iteration step, as a bitmask of fsl_cidiff_e va...
int stepType
Denotes the type of this step in the iteration.
fsl_cidiff_opt const * opt
The options object passed to fsl_cidiff().
fsl_card_F const * fc1
The file, if any, corresponding to this->v1.
The main Fossil "context" type.
A "deck" stores (predictably enough) a collection of "cards." Cards are constructs embedded within Fo...
struct fsl_deck::@350042316264271363175306321043117241313047322251 A
The 'A' (attachment) card.
fsl_uuid_str G
UUID for the 'G' (forum thread-root) card.
fsl_card_F_list F
The 'F' (file) card container.
char * U
The U (user) card.
char * tgt
Name of wiki page, or UUID of ticket or event (technote), to which the attachment applies.
void const * allocStamp
A marker which tells fsl_deck_finalize() whether or not fsl_deck_malloc() allocated this instance (in...
fsl_uuid_str src
UUID of the file being attached via the A-card.
char * name
Filename of the A-card.
char * H
The H (forum title) card.
char * L
The 'L' (wiki name/title) card.
fsl_id_t rid
DB repo.blob.rid value.
fsl_uuid_str uuid
The 'B' (baseline) card holds the UUID of baseline manifest.
fsl_buffer W
The W (wiki content) card.
fsl_uuid_str K
UUID for the 'K' (ticket) card.
fsl_list Q
'Q' (cherry pick) cards.
fsl_list M
List of UUIDs (fsl_uuid_str) in a cluster ('M' cards).
char * N
The 'N' (comment mime type) card.
fsl_list J
The 'J' card specifies changes to "value" of "fields" in tickets (FSL_SATYPE_TICKET).
fsl_satype_e type
Specifies the the type (or eventual type) of this artifact.
fsl_list T
List of 'T' (tag) cards.
struct fsl_deck::@135213207116306320240312043263123243330063044176 B
fsl_list P
List of UUIDs of parents ('P' cards).
double D
The 'D' (date) card, in Julian format.
char * C
The 'C' (comment) card.
fsl_cx * f
The Fossil context responsible for this deck.
fsl_deck * baseline
Baseline manifest corresponding to this->B.
fsl_deck * next
To potentially be used for a manifest cache.
char * R
The R-card holds an MD5 hash which is calculated based on the names, sizes, and contents of the files...
double julian
The 'E' card's date in Julian Day format.
fsl_uuid_str I
UUID for the 'I' (forum in-response-to) card.
fsl_buffer content
This is part of an optimization used when parsing fsl_deck instances from source text.
Generic list container type.
fsl_size_t sizes[FSL_SATYPE_count]
The accumulated sizes of each blob type seen during rebuild.
fsl_size_t phantomCount
The number of phantom artifacts seen during rebuild.
fsl_size_t counts[FSL_SATYPE_count]
Counts of each blob type seen during rebuild.
Options for the rebuild process.
bool createClusters
True if clusters should be created.
bool dryRun
If true, the transaction started by the rebuild process will end in a rollback even on success.
bool randomize
Scan artifacts in a random order (generally only of use in testing the library's code).
State for use with the fsl_rebuild_f() callback type.
fsl_satype_e artifactType
Set to FSL_SATYPE_INVALID if the just-processed blob is not a fossil artifact, else false.
fsl_rebuild_metrics metrics
Metrics from the rebuild.
int errCode
This is only non-0 for FSL_MSG_REBUILD_DONE messages, in which case it holds the result code of the o...
fsl_rebuild_opt const * opt
The options object used for this invocation of fsl_repo_rebuild().
fsl_cx * f
Fossil context for which this rebuild is being performed.
fsl_int_t blobSize
The size of the just-processed blob, -1 if it is a phantom blob, or 0 when this object is part of a F...
fsl_size_t artifactCount
An approximate upper bound on the number of files fsl_repo_rebuild() will process.
fsl_id_t rid
The blob.rid value of the just-processed blob.
fsl_size_t stepNumber
One-based counter of total artifacts processed so far.
Configuration parameters for fsl_repo_create().
bool elideProjectCode
If true, the new repo will not have a "project-code" config entry.
char const * commitMessage
The comment text used for the initial commit.
bool allowOverwrite
If false, fsl_repo_create() will fail if this->filename already exists.
char const * commitMessageMimetype
Mime type for the commit message (manifest N-card).
char const * configRepo
If not NULL and not empty, fsl_repo_create() will use this repository database to copy the configurat...
char const * username
Fossil user name for the admin user in the new repo.
char const * filename
The file name for the new repository.
Models user permissions precisely as fossil(1) does.
A list of fsl_xlinker instances.
fsl_xlinker * list
Array of this->used elements.
fsl_size_t capacity
Number of slots allocated in this->list.
fsl_size_t used
Number of used items in this->list.
A type for holding state for artifact crosslinking callbacks.
fsl_deck_xlink_f f
Callback function.
void * state
State for this->f's last argument.
char const * name
Human-readable name of the crosslinker, noting that each registered crosslinker must have a unique na...
char * fsl_uuid_str
fsl_uuid_str and fsl_uuid_cstr are "for documentation andreadability purposes" typedefs used to denot...
char const * fsl_uuid_cstr
The const counterpart of fsl_uuid_str.
int(* fsl_output_f)(void *state, void const *src, fsl_size_t n)
Generic interface for streaming out data.