mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add helper function to translate cylinder use text to matching idx
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
0d7c192e6e
commit
74582de06c
2 changed files with 11 additions and 0 deletions
9
dive.c
9
dive.c
|
@ -583,6 +583,15 @@ void copy_cylinders(struct dive *s, struct dive *d, bool used_only)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int cylinderuse_from_text(const char *text)
|
||||||
|
{
|
||||||
|
for (enum cylinderuse i = 0; i < NUM_GAS_USE; i++) {
|
||||||
|
if (same_string(text, cylinderuse_text[i]))
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
void copy_samples(struct divecomputer *s, struct divecomputer *d)
|
void copy_samples(struct divecomputer *s, struct divecomputer *d)
|
||||||
{
|
{
|
||||||
/* instead of carefully copying them one by one and calling add_sample
|
/* instead of carefully copying them one by one and calling add_sample
|
||||||
|
|
2
dive.h
2
dive.h
|
@ -647,6 +647,8 @@ extern int git_load_dives(struct git_repository *, const char *);
|
||||||
extern const char *saved_git_id;
|
extern const char *saved_git_id;
|
||||||
extern void clear_git_id(void);
|
extern void clear_git_id(void);
|
||||||
extern void set_git_id(const struct git_oid *);
|
extern void set_git_id(const struct git_oid *);
|
||||||
|
int cylinderuse_from_text(const char *text);
|
||||||
|
|
||||||
|
|
||||||
struct user_info {
|
struct user_info {
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue