libfossil
deprecated.h
Go to the documentation of this file.
1/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* vim: set ts=2 et sw=2 tw=80: */
3#if !defined(FSL_OMIT_DEPRECATED)
4#if !defined(ORG_FOSSIL_SCM_LIBFOSSIL_DEPRECATED_H_INCLUDED)
5#define ORG_FOSSIL_SCM_LIBFOSSIL_DEPRECATED_H_INCLUDED
6/*
7 Copyright 2013-2021 The Libfossil Authors, see LICENSES/BSD-2-Clause.txt
8
9 SPDX-License-Identifier: BSD-2-Clause-FreeBSD
10 SPDX-FileCopyrightText: 2021 The Libfossil Authors
11 SPDX-FileType: Code
12
13 Heavily indebted to the Fossil SCM project (https://fossil-scm.org).
14*/
15
16/** @file deprecated.h
17
18 This file holds APIs which are deprecated or otherwise "on the chopping
19 block." The libfossil public API has gathered a good deal of cruft
20 over the years.
21*/
22
23/**
24 @deprecated fsl_db_role_name() is easier to deal with.
25
26 Similar to fsl_cx_db_file_ckout() and friends except that it
27 applies to DB name (as opposed to DB _file_ name) implied by the
28 specified role (2nd parameter). If no such role is opened, or the
29 role is invalid, NULL is returned.
30
31 If the 3rd argument is not NULL, it is set to the length, in bytes,
32 of the returned string. The returned strings are NUL-terminated and
33 are either static or owned by the db handle they correspond to.
34
35 If the client does not care whether the db in question is
36 actually opened, the name for the corresponding role can be
37 fetched via fsl_db_role_name().
38
39 This is the "easiest" way to figure out the DB name of the given
40 role, independent of what order f's databases were opened
41 (because the first-opened DB is always called "main").
42
43 The Fossil-standard names of its primary databases are: "localdb"
44 (checkout), "repository", and "configdb" (global config DB), but
45 libfossil uses "ckout", "repo", and "cfg", respective. So long as
46 queries use table names which unambiguously refer to a given
47 database, the DB name is normally not needed. It is needed when
48 creating new non-TEMP db tables and views. By default such
49 tables/views would go into the "main" DB, and which one is the
50 "main" db is dependent on the order the DBs are opened, so it's
51 important to use the correct DB name when creating such constructs.
52
53 Note that the role of FSL_DBROLE_TEMP is invalid here.
54*/
55char const * fsl_cx_db_name_for_role(fsl_cx const * const f,
57 fsl_size_t * len);
58
59/**
60 Equivalent to `fcli_setup_v2(argc,argv,fcli.cliFlags,fcli.appHelp)`.
61
62 @see fcli_pre_setup()
63 @see fcli_setup_v2()
64 @see fcli_end_of_main()
65 @deprecated Its signature will change to fcli_setup_v2()'s at some point.
66*/
67int fcli_setup(int argc, char const * const * argv );
68
69/** @deprecated fsl_close_scm_dbs()
70
71 As of 2021-01-01, this functions identically to
72 fsl_close_scm_dbs(). Prior to that...
73
74 If fsl_repo_open_xxx() has been used to open a respository db,
75 perhaps indirectly via opening of a checkout, this call closes that
76 db and any corresponding checkout db.
77
78 Returns 0 on success or if no repo/checkout db is opened. It may
79 propagate an error from the db layer if closing/detaching the db
80 fails.
81
82 @see fsl_repo_open()
83 @see fsl_repo_create()
84*/
85int fsl_repo_close( fsl_cx * const f );
86
87
88/** @deprecated use fsl_close_scm_dbs() instead
89
90 As of 2021-01-01, this functions identically to
91 fsl_close_scm_dbs(). Prior to that...
92
93 If fsl_ckout_open_dir() (or similar) has been used to open a
94 checkout db, this call closes that db, as well as any
95 corresponding repository db.
96
97 Returns 0 on success or if no checkout db is opened. It may
98 propagate an error from the db layer if closing/detaching the db
99 fails. Returns FSL_RC_MISUSE if f has any transactions pending.
100
101 This also closes the repository which was implicitly opened for the
102 checkout.
103*/
104int fsl_ckout_close( fsl_cx * const f );
105
106#endif /* ORG_FOSSIL_SCM_LIBFOSSIL_DEPRECATED_H_INCLUDED */
107#endif /* FSL_OMIT_DEPRECATED */
uint64_t fsl_size_t
fsl_size_t is an unsigned integer type used to denote absolute ranges and lengths.
Definition config.h:192
fsl_dbrole_e
This enum defines type ID tags with which the API tags fsl_db instances so that the library can figur...
Definition core.h:156
char const * fsl_cx_db_name_for_role(fsl_cx const *const f, fsl_dbrole_e r, fsl_size_t *len)
int fcli_setup(int argc, char const *const *argv)
Equivalent to fcli_setup_v2(argc,argv,fcli.cliFlags,fcli.appHelp).
int fsl_ckout_close(fsl_cx *const f)
int fsl_repo_close(fsl_cx *const f)
The main Fossil "context" type.
Definition internal.h:400