cleanup: move dive_table from dive.h to divelist.h

This allows us to decouple dive.h and divelist.h, a small step in
include disentangling.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-05-01 13:43:52 +02:00 committed by Dirk Hohndel
parent c13040798c
commit 95284c026e
34 changed files with 54 additions and 23 deletions

View file

@ -1,11 +1,12 @@
// SPDX-License-Identifier: GPL-2.0
/* divelist.c */
#include "divelist.h"
#include "subsurface-string.h"
#include "deco.h"
#include "device.h"
#include "divesite.h"
#include "divelist.h"
#include "dive.h"
#include "fulltext.h"
#include "planner.h"
#include "qthelper.h"
@ -745,6 +746,13 @@ void delete_dive_from_table(struct dive_table *table, int idx)
remove_from_dive_table(table, idx);
}
struct dive *get_dive_from_table(int nr, const struct dive_table *dt)
{
if (nr >= dt->nr || nr < 0)
return NULL;
return dt->dives[nr];
}
/* This removes a dive from the global dive table but doesn't free the
* resources associated with the dive. The caller must removed the dive
* from the trip-list. Returns a pointer to the unregistered dive.