<commit_before>/* $Id$ */

#ifndef PRIQ_H
#define PRIQ_H

struct fsm_state;

struct priq {
	struct priq *next;
	unsigned cost;

	/* XXX: specific to shortest.c */
	struct fsm_state *state;
	struct priq *prev; /* previous node in shortest path. we could store the edge's character instead */
	int type; /* XXX: should really be fsm_edge_type */
};

/*
 * Pop the minimum cost node.
 */
struct priq *
priq_pop(struct priq **priq);

/*
 * Enqueue with priority.
 */
struct priq *
priq_push(struct priq **priq,
	struct fsm_state *state, unsigned int cost);

/* XXX: set operation */
struct priq *
priq_find(struct priq *priq, const struct fsm_state *state);

/* XXX: set operation */
void
priq_move(struct priq **priq, struct priq *new);

/* XXX: set operation */
void
priq_free(struct priq *priq);

#endif

<commit_msg>Correction; storing an edge label here would not be enough for the BFS.<commit_after>/* $Id$ */

#ifndef PRIQ_H
#define PRIQ_H

struct fsm_state;

struct priq {
	struct priq *next;
	unsigned cost;

	/* XXX: specific to shortest.c */
	struct fsm_state *state;
	struct priq *prev; /* previous node in shortest path */
	int type; /* XXX: should really be fsm_edge_type */
};

/*
 * Pop the minimum cost node.
 */
struct priq *
priq_pop(struct priq **priq);

/*
 * Enqueue with priority.
 */
struct priq *
priq_push(struct priq **priq,
	struct fsm_state *state, unsigned int cost);

/* XXX: set operation */
struct priq *
priq_find(struct priq *priq, const struct fsm_state *state);

/* XXX: set operation */
void
priq_move(struct priq **priq, struct priq *new);

/* XXX: set operation */
void
priq_free(struct priq *priq);

#endif


{'fraction_non_alphanumeric': 0.12279635258358662, 'fraction_numerical': 0.0, 'mean_word_length': 3.8698224852071004, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1502608', 'n_tokens_mistral': 615, 'n_tokens_neox': 581, 'n_words': 201}