commit - c8d1f14f1e61d39a694137303080847e4b269797
commit + dbdddfee1482b50ca8c4a0be06e4fec6a59fb9f4
blob - 3af8d5f635cb8536c5f4a4f0f2466edb846ae896
blob + dfb71f8e038399997f268b6da9d7314b9fdb0669
--- got/got.c
+++ got/got.c
struct got_tree_object *tree1 = NULL, *tree2 = NULL;
struct got_object_qid *qid;
- qid = SIMPLEQ_FIRST(got_object_commit_get_parent_ids(commit));
+ qid = STAILQ_FIRST(got_object_commit_get_parent_ids(commit));
if (qid != NULL) {
struct got_commit_object *pcommit;
err = got_object_open_as_commit(&pcommit, repo,
struct got_object_id *obj_id1 = NULL, *obj_id2 = NULL;
struct got_object_qid *qid;
- qid = SIMPLEQ_FIRST(got_object_commit_get_parent_ids(commit));
+ qid = STAILQ_FIRST(got_object_commit_get_parent_ids(commit));
if (qid != NULL) {
err = got_object_open_as_commit(&pcommit, repo,
qid->id);
struct got_object_qid *qid;
int n = 1;
parent_ids = got_object_commit_get_parent_ids(commit);
- SIMPLEQ_FOREACH(qid, parent_ids, entry) {
+ STAILQ_FOREACH(qid, parent_ids, entry) {
err = got_object_id_str(&id_str, qid->id);
if (err)
goto done;
struct got_pathlist_head changed_paths;
struct got_pathlist_entry *pe;
- SIMPLEQ_INIT(&reversed_commits);
+ STAILQ_INIT(&reversed_commits);
TAILQ_INIT(&changed_paths);
if (search_pattern && regcomp(®ex, search_pattern,
err = got_object_qid_alloc(&qid, id);
if (err)
break;
- SIMPLEQ_INSERT_HEAD(&reversed_commits, qid, entry);
+ STAILQ_INSERT_HEAD(&reversed_commits, qid, entry);
got_object_commit_close(commit);
} else {
err = print_commit(commit, id, repo, path,
got_pathlist_free(&changed_paths);
}
if (reverse_display_order) {
- SIMPLEQ_FOREACH(qid, &reversed_commits, entry) {
+ STAILQ_FOREACH(qid, &reversed_commits, entry) {
err = got_object_open_as_commit(&commit, repo, qid->id);
if (err)
break;
}
}
done:
- while (!SIMPLEQ_EMPTY(&reversed_commits)) {
- qid = SIMPLEQ_FIRST(&reversed_commits);
- SIMPLEQ_REMOVE_HEAD(&reversed_commits, entry);
+ while (!STAILQ_EMPTY(&reversed_commits)) {
+ qid = STAILQ_FIRST(&reversed_commits);
+ STAILQ_REMOVE_HEAD(&reversed_commits, entry);
got_object_qid_free(qid);
}
TAILQ_FOREACH(pe, &changed_paths, entry) {
struct got_tag_object *re_tag, *se_tag;
time_t re_time, se_time;
- SIMPLEQ_FOREACH(re, tags, entry) {
- se = SIMPLEQ_FIRST(sorted);
+ STAILQ_FOREACH(re, tags, entry) {
+ se = STAILQ_FIRST(sorted);
if (se == NULL) {
err = got_reflist_entry_dup(&new, re);
if (err)
return err;
- SIMPLEQ_INSERT_HEAD(sorted, new, entry);
+ STAILQ_INSERT_HEAD(sorted, new, entry);
continue;
} else {
err = got_ref_resolve(&re_id, repo, re->ref);
err = got_reflist_entry_dup(&new, re);
if (err)
return err;
- SIMPLEQ_INSERT_AFTER(sorted, se, new, entry);
+ STAILQ_INSERT_AFTER(sorted, se, new, entry);
break;
}
- se = SIMPLEQ_NEXT(se, entry);
+ se = STAILQ_NEXT(se, entry);
continue;
}
}
error = got_object_open_as_commit(&commit, repo, commit_id);
if (error)
goto done;
- pid = SIMPLEQ_FIRST(got_object_commit_get_parent_ids(commit));
+ pid = STAILQ_FIRST(got_object_commit_get_parent_ids(commit));
memset(&upa, 0, sizeof(upa));
error = got_worktree_merge_files(worktree, pid ? pid->id : NULL,
commit_id, repo, update_progress, &upa, check_cancelled,
error = got_object_open_as_commit(&commit, repo, commit_id);
if (error)
goto done;
- pid = SIMPLEQ_FIRST(got_object_commit_get_parent_ids(commit));
+ pid = STAILQ_FIRST(got_object_commit_get_parent_ids(commit));
if (pid == NULL) {
error = got_error(GOT_ERR_ROOT_COMMIT);
goto done;
err = got_object_qid_alloc(&qid, commit_id);
if (err)
goto done;
- SIMPLEQ_INSERT_HEAD(commits, qid, entry);
+ STAILQ_INSERT_HEAD(commits, qid, entry);
commit_id = parent_id;
}
}
const struct got_object_id_queue *parent_ids;
struct got_object_qid *qid, *pid;
- SIMPLEQ_INIT(&commits);
+ STAILQ_INIT(&commits);
TAILQ_INIT(&merged_paths);
while ((ch = getopt(argc, argv, "acl")) != -1) {
goto done;
parent_ids = got_object_commit_get_parent_ids(commit);
- pid = SIMPLEQ_FIRST(parent_ids);
+ pid = STAILQ_FIRST(parent_ids);
if (pid == NULL) {
if (!continue_rebase) {
struct got_update_progress_arg upa;
if (error)
goto done;
- if (SIMPLEQ_EMPTY(&commits)) {
+ if (STAILQ_EMPTY(&commits)) {
if (continue_rebase) {
error = rebase_complete(worktree, fileindex,
branch, new_base_branch, tmp_branch, repo,
}
pid = NULL;
- SIMPLEQ_FOREACH(qid, &commits, entry) {
+ STAILQ_FOREACH(qid, &commits, entry) {
struct got_update_progress_arg upa;
commit_id = qid->id;
struct got_object_qid *qid;
const char *histedit_cmd = NULL;
- if (SIMPLEQ_EMPTY(commits))
+ if (STAILQ_EMPTY(commits))
return got_error(GOT_ERR_EMPTY_HISTEDIT);
- SIMPLEQ_FOREACH(qid, commits, entry) {
+ STAILQ_FOREACH(qid, commits, entry) {
histedit_cmd = got_histedit_cmds[0].name;
- if (fold_only && SIMPLEQ_NEXT(qid, entry) != NULL)
+ if (fold_only && STAILQ_NEXT(qid, entry) != NULL)
histedit_cmd = "fold";
err = histedit_write_commit(qid->id, histedit_cmd, f, repo);
if (err)
char *id_str;
struct got_object_qid *qid;
- qid = SIMPLEQ_FIRST(commits);
+ qid = STAILQ_FIRST(commits);
err = got_object_id_str(&id_str, qid->id);
if (err)
return err;
if (TAILQ_EMPTY(histedit_cmds))
return got_error_msg(GOT_ERR_EMPTY_HISTEDIT,
"histedit script contains no commands");
- if (SIMPLEQ_EMPTY(commits))
+ if (STAILQ_EMPTY(commits))
return got_error(GOT_ERR_EMPTY_HISTEDIT);
TAILQ_FOREACH(hle, histedit_cmds, entry) {
}
}
- SIMPLEQ_FOREACH(qid, commits, entry) {
+ STAILQ_FOREACH(qid, commits, entry) {
TAILQ_FOREACH(hle, histedit_cmds, entry) {
if (got_object_id_cmp(qid->id, hle->commit_id) == 0)
break;
struct got_histedit_list histedit_cmds;
struct got_histedit_list_entry *hle;
- SIMPLEQ_INIT(&commits);
+ STAILQ_INIT(&commits);
TAILQ_INIT(&histedit_cmds);
TAILQ_INIT(&merged_paths);
memset(&upa, 0, sizeof(upa));
if (error)
goto done;
parent_ids = got_object_commit_get_parent_ids(commit);
- pid = SIMPLEQ_FIRST(parent_ids);
+ pid = STAILQ_FIRST(parent_ids);
if (pid == NULL) {
error = got_error(GOT_ERR_EMPTY_HISTEDIT);
goto done;
if (error)
goto done;
parent_ids = got_object_commit_get_parent_ids(commit);
- pid = SIMPLEQ_FIRST(parent_ids);
+ pid = STAILQ_FIRST(parent_ids);
if (pid == NULL) {
error = got_error(GOT_ERR_EMPTY_HISTEDIT);
goto done;
if (error)
goto done;
- if (SIMPLEQ_EMPTY(&commits)) {
+ if (STAILQ_EMPTY(&commits)) {
error = got_error(GOT_ERR_EMPTY_HISTEDIT);
goto done;
}
if (error)
goto done;
parent_ids = got_object_commit_get_parent_ids(commit);
- pid = SIMPLEQ_FIRST(parent_ids);
+ pid = STAILQ_FIRST(parent_ids);
error = got_worktree_histedit_merge_files(&merged_paths,
worktree, fileindex, pid->id, hle->commit_id, repo,
parent_ids = got_object_commit_get_parent_ids(commit);
fprintf(outfile, "numparents %d\n",
got_object_commit_get_nparents(commit));
- SIMPLEQ_FOREACH(pid, parent_ids, entry) {
+ STAILQ_FOREACH(pid, parent_ids, entry) {
char *pid_str;
err = got_object_id_str(&pid_str, pid->id);
if (err)
blob - 2244e2870234448a6294a739c5963caf99c88f80
blob + b353c9af64234baf5645bd6432ce861bc9e627e2
--- gotweb/gotweb.c
+++ gotweb/gotweb.c
return error;
if (gw_trans->action == GW_DIFF) {
- parent_id = SIMPLEQ_FIRST(
+ parent_id = STAILQ_FIRST(
got_object_commit_get_parent_ids(commit));
if (parent_id != NULL) {
id2 = got_object_id_dup(parent_id->id);
blob - 33d4fabb70af7fc3afa0db3fb351ca550a129529
blob + f0f73917f7b7ea9ee69014ce63be92ae9ad0b705
--- include/got_object.h
+++ include/got_object.h
struct got_commit_object;
struct got_object_qid {
- SIMPLEQ_ENTRY(got_object_qid) entry;
+ STAILQ_ENTRY(got_object_qid) entry;
struct got_object_id *id;
void *data; /* managed by API user */
};
-SIMPLEQ_HEAD(got_object_id_queue, got_object_qid);
+STAILQ_HEAD(got_object_id_queue, got_object_qid);
const struct got_error *got_object_qid_alloc(struct got_object_qid **,
struct got_object_id *);
blob - 8c1e08c465eace7793b3aec1bcd4841063476335
blob + 783c434b33577727fafbf7589d751e7601a9dcf7
--- lib/blame.c
+++ lib/blame.c
if (err)
return err;
- pid = SIMPLEQ_FIRST(got_object_commit_get_parent_ids(commit));
+ pid = STAILQ_FIRST(got_object_commit_get_parent_ids(commit));
if (pid == NULL) {
got_object_commit_close(commit);
return NULL;
blob - 29a4d2fb492f107dfe0f7c24c53f0e54de0dda9c
blob + 02b48fae94b68b2e73ce447027d7d94d3be3b6c5
--- lib/commit_graph.c
+++ lib/commit_graph.c
*changed = 0;
- pid = SIMPLEQ_FIRST(&commit->parent_ids);
+ pid = STAILQ_FIRST(&commit->parent_ids);
if (pid == NULL) {
struct got_object_id *obj_id;
err = got_object_id_by_path(&obj_id, repo, commit_id, path);
struct got_object_id_queue traversed_commits;
struct got_object_qid *qid;
- SIMPLEQ_INIT(&traversed_commits);
+ STAILQ_INIT(&traversed_commits);
*ncommits_traversed = 0;
err = got_traverse_packed_commits(&traversed_commits,
return err;
/* Add all traversed commits to the graph... */
- SIMPLEQ_FOREACH(qid, &traversed_commits, entry) {
+ STAILQ_FOREACH(qid, &traversed_commits, entry) {
struct got_commit_graph_node *node;
if (got_object_idset_contains(graph->open_branches, qid->id))
(*ncommits_traversed)++;
/* ... except the last commit is the new branch tip. */
- if (SIMPLEQ_NEXT(qid, entry) == NULL) {
+ if (STAILQ_NEXT(qid, entry) == NULL) {
err = got_object_idset_add(graph->open_branches,
qid->id, NULL);
break;
return err;
if (graph->flags & GOT_COMMIT_GRAPH_FIRST_PARENT_TRAVERSAL) {
- qid = SIMPLEQ_FIRST(&commit->parent_ids);
+ qid = STAILQ_FIRST(&commit->parent_ids);
if (qid == NULL ||
got_object_idset_contains(graph->open_branches, qid->id))
return NULL;
if (err)
return err;
- SIMPLEQ_FOREACH(qid, &commit->parent_ids, entry) {
+ STAILQ_FOREACH(qid, &commit->parent_ids, entry) {
struct got_object_id *id;
if (got_object_idset_contains(graph->open_branches,
* follow the first parent only.
*/
if (!branches_differ) {
- qid = SIMPLEQ_FIRST(&commit->parent_ids);
+ qid = STAILQ_FIRST(&commit->parent_ids);
if (qid == NULL)
return NULL;
if (got_object_idset_contains(graph->open_branches,
}
}
- SIMPLEQ_FOREACH(qid, &commit->parent_ids, entry) {
+ STAILQ_FOREACH(qid, &commit->parent_ids, entry) {
if (got_object_idset_contains(graph->open_branches, qid->id))
continue;
if (got_object_idset_contains(graph->node_ids, qid->id))
blob - e3ee8c6f3ea1981934a38c2f4bd9e01e43d62c15
blob + 13058972edf12022d3cb9a2b3ab0bd2c60c0ede9
--- lib/delta.c
+++ lib/delta.c
struct got_delta *delta;
/* The first delta in the chain should represent the base object. */
- delta = SIMPLEQ_FIRST(&deltas->entries);
+ delta = STAILQ_FIRST(&deltas->entries);
if (delta->type == GOT_OBJ_TYPE_COMMIT ||
delta->type == GOT_OBJ_TYPE_TREE ||
delta->type == GOT_OBJ_TYPE_BLOB ||
blob - 4a95b0e905ba9cd4de20bfb2bb5cfea429f63b7d
blob + b78f710ab010a69d3bf18af1d685ad979c6469ef
--- lib/got_lib_delta.h
+++ lib/got_lib_delta.h
*/
struct got_delta {
- SIMPLEQ_ENTRY(got_delta) entry;
+ STAILQ_ENTRY(got_delta) entry;
off_t offset;
size_t tslen;
int type;
struct got_delta_chain {
int nentries;
- SIMPLEQ_HEAD(, got_delta) entries;
+ STAILQ_HEAD(, got_delta) entries;
};
#define GOT_DELTA_CHAIN_RECURSION_MAX 500
blob - 7ebffb4ae32b0d4e6842a6fa0787caa8ad38dfcb
blob + 4dff06d265c9aca4dc4216121372ec79495fcd96
--- lib/object.c
+++ lib/object.c
const struct got_error *err;
struct got_object_qid *qid;
- SIMPLEQ_FOREACH(qid, src, entry) {
+ STAILQ_FOREACH(qid, src, entry) {
struct got_object_qid *new;
/*
* Deep-copy the object ID only. Let the caller deal
got_object_id_queue_free(dest);
return err;
}
- SIMPLEQ_INSERT_TAIL(dest, new, entry);
+ STAILQ_INSERT_TAIL(dest, new, entry);
}
return NULL;
blob - adc0e664003a4f5feb61676517c02a3063685c16
blob + 4ef1c3c68734fcfaa46bc785e8d103a58b652d01
--- lib/object_cache.c
+++ lib/object_cache.c
if ((obj->flags & GOT_OBJ_FLAG_DELTIFIED) == 0)
return size;
- SIMPLEQ_FOREACH(delta, &obj->deltas.entries, entry) {
+ STAILQ_FOREACH(delta, &obj->deltas.entries, entry) {
if (SIZE_MAX - sizeof(*delta) < size)
return SIZE_MAX;
size += sizeof(*delta);
size += strlen(commit->committer);
size += strlen(commit->logmsg);
- SIMPLEQ_FOREACH(qid, &commit->parent_ids, entry)
+ STAILQ_FOREACH(qid, &commit->parent_ids, entry)
size += sizeof(*qid) + sizeof(*qid->id);
return size;
blob - 15982183420ae0e8f9de354180b64dc52689b58b
blob + 38484be4282a8429eade676e2b71bcbb96196be8
--- lib/object_create.c
+++ lib/object_create.c
}
if (parent_ids) {
- SIMPLEQ_FOREACH(qid, parent_ids, entry) {
+ STAILQ_FOREACH(qid, parent_ids, entry) {
char *parent_str = NULL;
free(id_str);
blob - 0b0c5c0789a60b52fbd0e7f18073f05dbf59c989
blob + 011bee15a8060f553f213c02b686ba3734dcbeca
--- lib/object_parse.c
+++ lib/object_parse.c
if (obj->flags & GOT_OBJ_FLAG_DELTIFIED) {
struct got_delta *delta;
- while (!SIMPLEQ_EMPTY(&obj->deltas.entries)) {
- delta = SIMPLEQ_FIRST(&obj->deltas.entries);
- SIMPLEQ_REMOVE_HEAD(&obj->deltas.entries, entry);
+ while (!STAILQ_EMPTY(&obj->deltas.entries)) {
+ delta = STAILQ_FIRST(&obj->deltas.entries);
+ STAILQ_REMOVE_HEAD(&obj->deltas.entries, entry);
free(delta);
}
}
{
struct got_object_qid *qid;
- while (!SIMPLEQ_EMPTY(ids)) {
- qid = SIMPLEQ_FIRST(ids);
- SIMPLEQ_REMOVE_HEAD(ids, entry);
+ while (!STAILQ_EMPTY(ids)) {
+ qid = STAILQ_FIRST(ids);
+ STAILQ_REMOVE_HEAD(ids, entry);
got_object_qid_free(qid);
}
}
return NULL;
}
- SIMPLEQ_INIT(&commit->parent_ids);
+ STAILQ_INIT(&commit->parent_ids);
return commit;
}
return err;
}
- SIMPLEQ_INSERT_TAIL(&commit->parent_ids, qid, entry);
+ STAILQ_INSERT_TAIL(&commit->parent_ids, qid, entry);
commit->nparents++;
return NULL;
blob - 1b917035bd5fcddb3547066f98679b2ba7a6c567
blob + 5f8dfb856fa6b279f5a7d058b7334047642919af
--- lib/pack.c
+++ lib/pack.c
struct got_packidx_object_id *oid;
uint32_t i;
- SIMPLEQ_INIT(matched_ids);
+ STAILQ_INIT(matched_ids);
if (prefix_len < 2)
return got_error_path(id_str_prefix, GOT_ERR_BAD_OBJ_ID_STR);
if (err)
break;
memcpy(qid->id->sha1, oid->sha1, SHA1_DIGEST_LENGTH);
- SIMPLEQ_INSERT_TAIL(matched_ids, qid, entry);
+ STAILQ_INSERT_TAIL(matched_ids, qid, entry);
oid = &packidx->hdr.sorted_ids[++i];
}
return got_error_from_errno("got_delta_open");
/* delta is freed in got_object_close() */
deltas->nentries++;
- SIMPLEQ_INSERT_HEAD(&deltas->entries, delta, entry);
+ STAILQ_INSERT_HEAD(&deltas->entries, delta, entry);
return NULL;
}
memcpy(&(*obj)->id, id, sizeof((*obj)->id));
(*obj)->pack_offset = offset + tslen;
- SIMPLEQ_INIT(&(*obj)->deltas.entries);
+ STAILQ_INIT(&(*obj)->deltas.entries);
(*obj)->flags |= GOT_OBJ_FLAG_DELTIFIED;
(*obj)->flags |= GOT_OBJ_FLAG_PACKED;
(*obj)->pack_idx = idx;
uint64_t base_size = 0, result_size = 0;
*max_size = 0;
- SIMPLEQ_FOREACH(delta, &deltas->entries, entry) {
+ STAILQ_FOREACH(delta, &deltas->entries, entry) {
/* Plain object types are the delta base. */
if (delta->type != GOT_OBJ_TYPE_COMMIT &&
delta->type != GOT_OBJ_TYPE_TREE &&
*result_size = 0;
- if (SIMPLEQ_EMPTY(&deltas->entries))
+ if (STAILQ_EMPTY(&deltas->entries))
return got_error(GOT_ERR_BAD_DELTA_CHAIN);
/* We process small enough files entirely in memory for speed. */
}
/* Deltas are ordered in ascending order. */
- SIMPLEQ_FOREACH(delta, &deltas->entries, entry) {
+ STAILQ_FOREACH(delta, &deltas->entries, entry) {
int cached = 1;
if (n == 0) {
size_t mapoff;
*outbuf = NULL;
*outlen = 0;
- if (SIMPLEQ_EMPTY(&deltas->entries))
+ if (STAILQ_EMPTY(&deltas->entries))
return got_error(GOT_ERR_BAD_DELTA_CHAIN);
err = got_pack_get_delta_chain_max_size(&max_size, deltas, pack);
return got_error_from_errno("malloc");
/* Deltas are ordered in ascending order. */
- SIMPLEQ_FOREACH(delta, &deltas->entries, entry) {
+ STAILQ_FOREACH(delta, &deltas->entries, entry) {
int cached = 1;
if (n == 0) {
size_t delta_data_offset;
blob - f8ee356d48c9238a0edda7b7eb1bd5077fd643a1
blob + b850ce5f22966a3ccbc122c9b002eaad1de24ce6
--- lib/pack_create.c
+++ lib/pack_create.c
err = got_object_qid_alloc(&qid, id);
if (err)
break;
- SIMPLEQ_INSERT_TAIL(ids, qid, entry);
+ STAILQ_INSERT_TAIL(ids, qid, entry);
} else if (S_ISREG(mode)) {
err = add_meta(v, idset, id, p, GOT_OBJ_TYPE_BLOB,
mtime, loose_obj_only, repo);
if (err)
return err;
- SIMPLEQ_INIT(&tree_ids);
- SIMPLEQ_INSERT_TAIL(&tree_ids, qid, entry);
+ STAILQ_INIT(&tree_ids);
+ STAILQ_INSERT_TAIL(&tree_ids, qid, entry);
- while (!SIMPLEQ_EMPTY(&tree_ids)) {
+ while (!STAILQ_EMPTY(&tree_ids)) {
if (cancel_cb) {
err = (*cancel_cb)(cancel_arg);
if (err)
break;
}
- qid = SIMPLEQ_FIRST(&tree_ids);
- SIMPLEQ_REMOVE_HEAD(&tree_ids, entry);
+ qid = STAILQ_FIRST(&tree_ids);
+ STAILQ_REMOVE_HEAD(&tree_ids, entry);
if (got_object_idset_contains(idset, qid->id)) {
got_object_qid_free(qid);
if (err)
return err;
- SIMPLEQ_INSERT_TAIL(ids, qid, entry);
+ STAILQ_INSERT_TAIL(ids, qid, entry);
qid->data = (void *)&findtwixt_colors[color];
return NULL;
}
struct got_object_id_queue ids;
struct got_object_qid *qid;
- SIMPLEQ_INIT(&ids);
+ STAILQ_INIT(&ids);
err = got_object_qid_alloc(&qid, id);
if (err)
return err;
- SIMPLEQ_INSERT_HEAD(&ids, qid, entry);
+ STAILQ_INSERT_HEAD(&ids, qid, entry);
- while (!SIMPLEQ_EMPTY(&ids)) {
+ while (!STAILQ_EMPTY(&ids)) {
if (cancel_cb) {
err = (*cancel_cb)(cancel_arg);
if (err)
break;
}
- qid = SIMPLEQ_FIRST(&ids);
- SIMPLEQ_REMOVE_HEAD(&ids, entry);
+ qid = STAILQ_FIRST(&ids);
+ STAILQ_REMOVE_HEAD(&ids, entry);
if (got_object_idset_contains(drop, qid->id)) {
got_object_qid_free(qid);
struct got_object_qid *qid;
int i, ncolor, nkeep, obj_type;
- SIMPLEQ_INIT(&ids);
+ STAILQ_INIT(&ids);
*res = NULL;
*nres = 0;
goto done;
}
- while (!SIMPLEQ_EMPTY(&ids)) {
+ while (!STAILQ_EMPTY(&ids)) {
int qcolor;
- qid = SIMPLEQ_FIRST(&ids);
+ qid = STAILQ_FIRST(&ids);
qcolor = *((int *)qid->data);
if (got_object_idset_contains(drop, qid->id))
if (ncolor == COLOR_DROP || (ncolor == COLOR_KEEP &&
qcolor == COLOR_KEEP)) {
- SIMPLEQ_REMOVE_HEAD(&ids, entry);
+ STAILQ_REMOVE_HEAD(&ids, entry);
got_object_qid_free(qid);
continue;
}
}
parents = got_object_commit_get_parent_ids(commit);
if (parents) {
- SIMPLEQ_FOREACH(pid, parents, entry) {
+ STAILQ_FOREACH(pid, parents, entry) {
err = queue_commit_id(&ids, pid->id,
qcolor, repo);
if (err) {
goto done;
}
- SIMPLEQ_REMOVE_HEAD(&ids, entry);
+ STAILQ_REMOVE_HEAD(&ids, entry);
got_object_qid_free(qid);
}
blob - ebbe86bd40a3407e2166b0cfbe3a8490c353f30c
blob + acb20d28e5fa0d935383503926b1be70789b9e42
--- lib/privsep.c
+++ lib/privsep.c
len += author_len;
memcpy(buf + len, commit->committer, committer_len);
len += committer_len;
- SIMPLEQ_FOREACH(qid, &commit->parent_ids, entry) {
+ STAILQ_FOREACH(qid, &commit->parent_ids, entry) {
memcpy(buf + len, qid->id, SHA1_DIGEST_LENGTH);
len += SHA1_DIGEST_LENGTH;
}
break;
memcpy(qid->id, imsg->data + len +
i * SHA1_DIGEST_LENGTH, sizeof(*qid->id));
- SIMPLEQ_INSERT_TAIL(&(*commit)->parent_ids, qid, entry);
+ STAILQ_INSERT_TAIL(&(*commit)->parent_ids, qid, entry);
(*commit)->nparents++;
}
done:
if (err)
break;
memcpy(qid->id->sha1, sha1, SHA1_DIGEST_LENGTH);
- SIMPLEQ_INSERT_TAIL(commit_ids, qid, entry);
+ STAILQ_INSERT_TAIL(commit_ids, qid, entry);
/* The last commit may contain a change. */
if (i == icommits->ncommits - 1) {
blob - 2f1abf58087e2648591e03485c907e2b79bb7baa
blob + a8727af0dda8619fc955177c35f9183919571c0c
--- lib/repository.c
+++ lib/repository.c
struct got_object_id_queue matched_ids;
int packdir_fd;
- SIMPLEQ_INIT(&matched_ids);
+ STAILQ_INIT(&matched_ids);
packdir_fd = openat(got_repo_get_fd(repo),
GOT_OBJECTS_PACK_DIR, O_DIRECTORY);
if (err)
break;
- SIMPLEQ_FOREACH(qid, &matched_ids, entry) {
+ STAILQ_FOREACH(qid, &matched_ids, entry) {
if (obj_type != GOT_OBJ_TYPE_ANY) {
int matched_type;
err = got_object_get_type(&matched_type, repo,
blob - c6a9ee611f39f7106cbf6b33215f75f9f7a5c715
blob + 57631f318cb2eb1b8a1bfc2cbe610407f87d90da
--- lib/worktree.c
+++ lib/worktree.c
char *fileindex_path = NULL;
struct got_pathlist_entry *pe;
struct tree_path_data {
- SIMPLEQ_ENTRY(tree_path_data) entry;
+ STAILQ_ENTRY(tree_path_data) entry;
struct got_object_id *tree_id;
int entry_type;
char *relpath;
char *entry_name;
} *tpd = NULL;
- SIMPLEQ_HEAD(tree_paths, tree_path_data) tree_paths;
+ STAILQ_HEAD(tree_paths, tree_path_data) tree_paths;
- SIMPLEQ_INIT(&tree_paths);
+ STAILQ_INIT(&tree_paths);
err = lock_worktree(worktree, LOCK_EX);
if (err)
} else
tpd->entry_name = NULL;
- SIMPLEQ_INSERT_TAIL(&tree_paths, tpd, entry);
+ STAILQ_INSERT_TAIL(&tree_paths, tpd, entry);
}
/*
if (err)
goto done;
- tpd = SIMPLEQ_FIRST(&tree_paths);
+ tpd = STAILQ_FIRST(&tree_paths);
TAILQ_FOREACH(pe, paths, entry) {
struct bump_base_commit_id_arg bbc_arg;
if (err)
break;
- tpd = SIMPLEQ_NEXT(tpd, entry);
+ tpd = STAILQ_NEXT(tpd, entry);
}
sync_err = sync_fileindex(fileindex, fileindex_path);
if (sync_err && err == NULL)
got_object_commit_close(commit);
if (fileindex)
got_fileindex_free(fileindex);
- while (!SIMPLEQ_EMPTY(&tree_paths)) {
- tpd = SIMPLEQ_FIRST(&tree_paths);
- SIMPLEQ_REMOVE_HEAD(&tree_paths, entry);
+ while (!STAILQ_EMPTY(&tree_paths)) {
+ tpd = STAILQ_FIRST(&tree_paths);
+ STAILQ_REMOVE_HEAD(&tree_paths, entry);
free(tpd->relpath);
free(tpd->tree_id);
free(tpd);
*new_commit_id = NULL;
- SIMPLEQ_INIT(&parent_ids);
+ STAILQ_INIT(&parent_ids);
err = got_object_open_as_commit(&head_commit, repo, head_commit_id);
if (err)
err = got_object_qid_alloc(&pid, worktree->base_commit_id);
if (err)
goto done;
- SIMPLEQ_INSERT_TAIL(&parent_ids, pid, entry);
+ STAILQ_INSERT_TAIL(&parent_ids, pid, entry);
err = got_object_commit_create(new_commit_id, new_tree_id, &parent_ids,
1, author, time(NULL), committer, time(NULL), logmsg, repo);
got_object_qid_free(pid);
blob - bcef0951dbb771b4b70ab05125138f52e08c7b7a
blob + aac58b1e8c9fc029985629a172044af08fa045df
--- libexec/got-index-pack/got-index-pack.c
+++ libexec/got-index-pack/got-index-pack.c
const char *obj_label;
deltas.nentries = 0;
- SIMPLEQ_INIT(&deltas.entries);
+ STAILQ_INIT(&deltas.entries);
err = got_pack_resolve_delta_chain(&deltas, packidx, pack,
obj->off, obj->tslen, obj->type, obj->size,
done:
free(buf);
free(header);
- while (!SIMPLEQ_EMPTY(&deltas.entries)) {
- delta = SIMPLEQ_FIRST(&deltas.entries);
- SIMPLEQ_REMOVE_HEAD(&deltas.entries, entry);
+ while (!STAILQ_EMPTY(&deltas.entries)) {
+ delta = STAILQ_FIRST(&deltas.entries);
+ STAILQ_REMOVE_HEAD(&deltas.entries, entry);
free(delta);
}
return err;
blob - 612026c469e1b0b43b39ffebdb8592d4b22c474f
blob + 2013a7ab842fd854267c057defa8cbe437fa7bc4
--- libexec/got-read-pack/got-read-pack.c
+++ libexec/got-read-pack/got-read-pack.c
memcpy(commit_ids[ncommits - 1].sha1, id.sha1,
SHA1_DIGEST_LENGTH);
- pid = SIMPLEQ_FIRST(&commit->parent_ids);
+ pid = STAILQ_FIRST(&commit->parent_ids);
if (pid == NULL)
break;
blob - b6840e939dec6d2d98e812c0a0ca34d74e03eee1
blob + a79424ab0bfcca1e5f2241c26300b9cea521b99d
--- tog/tog.c
+++ tog/tog.c
};
struct tog_color {
- SIMPLEQ_ENTRY(tog_color) entry;
+ STAILQ_ENTRY(tog_color) entry;
regex_t regex;
short colorpair;
};
-SIMPLEQ_HEAD(tog_colors, tog_color);
+STAILQ_HEAD(tog_colors, tog_color);
static struct got_reflist_head tog_refs = TAILQ_HEAD_INITIALIZER(tog_refs);
static struct got_reflist_object_id_map *tog_refs_idmap;
return err;
}
tc->colorpair = idx;
- SIMPLEQ_INSERT_HEAD(colors, tc, entry);
+ STAILQ_INSERT_HEAD(colors, tc, entry);
return NULL;
}
{
struct tog_color *tc;
- while (!SIMPLEQ_EMPTY(colors)) {
- tc = SIMPLEQ_FIRST(colors);
- SIMPLEQ_REMOVE_HEAD(colors, entry);
+ while (!STAILQ_EMPTY(colors)) {
+ tc = STAILQ_FIRST(colors);
+ STAILQ_REMOVE_HEAD(colors, entry);
regfree(&tc->regex);
free(tc);
}
{
struct tog_color *tc = NULL;
- SIMPLEQ_FOREACH(tc, colors, entry) {
+ STAILQ_FOREACH(tc, colors, entry) {
if (tc->colorpair == colorpair)
return tc;
}
if (diff_view == NULL)
return got_error_from_errno("view_open");
- parent_id = SIMPLEQ_FIRST(got_object_commit_get_parent_ids(commit));
+ parent_id = STAILQ_FIRST(got_object_commit_get_parent_ids(commit));
err = open_diff_view(diff_view, parent_id ? parent_id->id : NULL,
commit_id, NULL, NULL, 3, 0, 0, log_view, repo);
if (err == NULL)
}
s->log_branches = log_branches;
- SIMPLEQ_INIT(&s->colors);
+ STAILQ_INIT(&s->colors);
if (has_colors() && getenv("TOG_COLORS") != NULL) {
err = add_color(&s->colors, "^$", TOG_COLOR_COMMIT,
get_color_value("TOG_COLOR_COMMIT"));
{
struct tog_color *tc = NULL;
- SIMPLEQ_FOREACH(tc, colors, entry) {
+ STAILQ_FOREACH(tc, colors, entry) {
if (match_line(line, &tc->regex, 0, NULL))
return tc;
}
struct got_tree_object *tree1 = NULL, *tree2 = NULL;
struct got_object_qid *qid;
- qid = SIMPLEQ_FIRST(got_object_commit_get_parent_ids(commit));
+ qid = STAILQ_FIRST(got_object_commit_get_parent_ids(commit));
if (qid != NULL) {
struct got_commit_object *pcommit;
err = got_object_open_as_commit(&pcommit, repo,
goto done;
} else {
parent_ids = got_object_commit_get_parent_ids(commit2);
- SIMPLEQ_FOREACH(pid, parent_ids, entry) {
+ STAILQ_FOREACH(pid, parent_ids, entry) {
if (got_object_id_cmp(s->id1, pid->id) == 0) {
err = write_commit_info(
&s->line_offsets, &s->nlines,
s->log_view = log_view;
s->repo = repo;
- SIMPLEQ_INIT(&s->colors);
+ STAILQ_INIT(&s->colors);
if (has_colors() && getenv("TOG_COLORS") != NULL) {
err = add_color(&s->colors,
"^-", TOG_COLOR_DIFF_MINUS,
return err;
parent_ids = got_object_commit_get_parent_ids(selected_commit);
free(s->id1);
- pid = SIMPLEQ_FIRST(parent_ids);
+ pid = STAILQ_FIRST(parent_ids);
s->id1 = pid ? got_object_id_dup(pid->id) : NULL;
got_object_commit_close(selected_commit);
return NULL;
const struct got_error *err = NULL;
struct tog_blame_view_state *s = &view->state.blame;
- SIMPLEQ_INIT(&s->blamed_commits);
+ STAILQ_INIT(&s->blamed_commits);
s->path = strdup(path);
if (s->path == NULL)
return err;
}
- SIMPLEQ_INSERT_HEAD(&s->blamed_commits, s->blamed_commit, entry);
+ STAILQ_INSERT_HEAD(&s->blamed_commits, s->blamed_commit, entry);
s->first_displayed_line = 1;
s->last_displayed_line = view->nlines;
s->selected_line = 1;
s->commit_id = commit_id;
memset(&s->blame, 0, sizeof(s->blame));
- SIMPLEQ_INIT(&s->colors);
+ STAILQ_INIT(&s->colors);
if (has_colors() && getenv("TOG_COLORS") != NULL) {
err = add_color(&s->colors, "^", TOG_COLOR_COMMIT,
get_color_value("TOG_COLOR_COMMIT"));
if (s->blame.thread)
err = stop_blame(&s->blame);
- while (!SIMPLEQ_EMPTY(&s->blamed_commits)) {
+ while (!STAILQ_EMPTY(&s->blamed_commits)) {
struct got_object_qid *blamed_commit;
- blamed_commit = SIMPLEQ_FIRST(&s->blamed_commits);
- SIMPLEQ_REMOVE_HEAD(&s->blamed_commits, entry);
+ blamed_commit = STAILQ_FIRST(&s->blamed_commits);
+ STAILQ_REMOVE_HEAD(&s->blamed_commits, entry);
got_object_qid_free(blamed_commit);
}
s->repo, id);
if (err)
break;
- pid = SIMPLEQ_FIRST(
+ pid = STAILQ_FIRST(
got_object_commit_get_parent_ids(commit));
if (pid == NULL) {
got_object_commit_close(commit);
s->done = 0;
if (thread_err)
break;
- SIMPLEQ_INSERT_HEAD(&s->blamed_commits,
+ STAILQ_INSERT_HEAD(&s->blamed_commits,
s->blamed_commit, entry);
err = run_blame(view);
if (err)
}
case 'B': {
struct got_object_qid *first;
- first = SIMPLEQ_FIRST(&s->blamed_commits);
+ first = STAILQ_FIRST(&s->blamed_commits);
if (!got_object_id_cmp(first->id, s->commit_id))
break;
s->done = 1;
s->done = 0;
if (thread_err)
break;
- SIMPLEQ_REMOVE_HEAD(&s->blamed_commits, entry);
+ STAILQ_REMOVE_HEAD(&s->blamed_commits, entry);
got_object_qid_free(s->blamed_commit);
s->blamed_commit =
- SIMPLEQ_FIRST(&s->blamed_commits);
+ STAILQ_FIRST(&s->blamed_commits);
err = run_blame(view);
if (err)
break;
err = got_object_open_as_commit(&commit, s->repo, id);
if (err)
break;
- pid = SIMPLEQ_FIRST(
+ pid = STAILQ_FIRST(
got_object_commit_get_parent_ids(commit));
if (view_is_parent_view(view))
begin_x = view_split_begin_x(view->begin_x);
}
s->repo = repo;
- SIMPLEQ_INIT(&s->colors);
+ STAILQ_INIT(&s->colors);
if (has_colors() && getenv("TOG_COLORS") != NULL) {
err = add_color(&s->colors, "\\$$",
s->repo = repo;
TAILQ_INIT(&s->refs);
- SIMPLEQ_INIT(&s->colors);
+ STAILQ_INIT(&s->colors);
err = ref_view_load_refs(s);
if (err)