Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
lektor
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Kubat
lektor
Validations
20c9c840
Vérifiée
Valider
20c9c840
rédigé
2 years ago
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
RUST: Expose more things to the C part of lektor for the SQLite connexion
parent
178aaf0a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
3
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
3 fichiers modifiés
inc/liblektor-rs/database.h
+10
-0
10 ajouts, 0 suppression
inc/liblektor-rs/database.h
src/rust/lektor_db/src/connexion.rs
+0
-5
0 ajout, 5 suppressions
src/rust/lektor_db/src/connexion.rs
src/rust/lektor_unsafe/src/db.rs
+66
-0
66 ajouts, 0 suppression
src/rust/lektor_unsafe/src/db.rs
avec
76 ajouts
et
5 suppressions
inc/liblektor-rs/database.h
+
10
−
0
Voir le fichier @
20c9c840
...
...
@@ -7,6 +7,7 @@ extern "C" {
#include
<stdint.h>
struct
lkt_uri
;
struct
lkt_sqlite_connection
;
typedef
struct
lkt_sqlite_connection
lkt_sqlite_connection
;
...
...
@@ -27,6 +28,15 @@ bool lkt_database_delete_kara_by_local_id(lkt_sqlite_connection *, int64_t);
bool
lkt_database_get_kara_info
(
lkt_sqlite_connection
*
,
int64_t
,
lkt_info_cb
,
void
*
restrict
);
bool
lkt_database_get_kara_tags
(
lkt_sqlite_connection
*
,
int64_t
,
lkt_info_cb
,
void
*
restrict
);
bool
lkt_database_add_to_history
(
lkt_sqlite_connection
*
,
int64_t
);
bool
lkt_database_iter_history
(
lkt_sqlite_connection
*
,
void
(
*
)(
int64_t
,
void
*
restrict
),
void
*
restrict
);
bool
lkt_database_clear_history
(
lkt_sqlite_connection
*
);
bool
lkt_database_search
(
lkt_sqlite_connection
*
,
lkt_uri
*
,
void
(
*
)(
int64_t
,
void
*
restrict
),
void
*
restrict
);
bool
lkt_database_search_playlist
(
lkt_sqlite_connection
*
,
const
char
*
,
lkt_uri
*
,
void
(
*
)(
int64_t
,
void
*
restrict
),
void
*
restrict
);
#if defined(__cplusplus)
}
#endif
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/rust/lektor_db/src/connexion.rs
+
0
−
5
Voir le fichier @
20c9c840
...
...
@@ -234,11 +234,6 @@ impl LktDatabaseConnection {
todo!
()
}
/// Search the queue by URIs. We return the local ids.
pub
fn
search_queue
(
&
mut
self
,
_uri
:
LktCUri
)
->
LktDatabaseResult
<
Vec
<
i64
>>
{
todo!
()
}
/// Search the given playlist by URIs. We return the local ids.
pub
fn
search_playlist
<
S
:
AsRef
<
str
>>
(
&
mut
self
,
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/rust/lektor_unsafe/src/db.rs
+
66
−
0
Voir le fichier @
20c9c840
...
...
@@ -120,3 +120,69 @@ pub unsafe extern "C" fn lkt_database_get_kara_tags(
)
->
bool
{
unimplemented!
()
}
/// Add the kara to the history.
/// ### Safety
/// The passed db pointer must be created by
/// [`lkt_database_establish_connection`].
#[no_mangle]
pub
unsafe
extern
"C"
fn
lkt_database_add_to_history
(
db
:
*
mut
LktDatabaseConnection
,
local_id
:
i64
,
)
->
bool
{
todo!
()
}
/// Iterate over the history.
/// ### Safety
/// The passed db pointer must be created by
/// [`lkt_database_establish_connection`].
#[no_mangle]
pub
unsafe
extern
"C"
fn
lkt_database_iter_history
(
db
:
*
mut
LktDatabaseConnection
,
cb
:
extern
"C"
fn
(
i64
,
usize
,
*
mut
c_void
),
user
:
*
mut
c_void
,
)
->
bool
{
todo!
()
}
/// Clear the history.
/// ### Safety
/// The passed db pointer must be created by
/// [`lkt_database_establish_connection`].
#[no_mangle]
pub
unsafe
extern
"C"
fn
lkt_database_clear_history
(
db
:
*
mut
LktDatabaseConnection
)
->
bool
{
todo!
()
}
/// Search the database.
/// ### Safety
/// The passed db pointer must be created by
/// [`lkt_database_establish_connection`]. The passed uri pointer must be a
/// valid an address to a URI.
#[no_mangle]
pub
unsafe
extern
"C"
fn
lkt_database_search
(
db
:
*
mut
LktDatabaseConnection
,
uri
:
LktUriPtr
,
cb
:
extern
"C"
fn
(
i64
,
*
mut
c_void
),
user
:
*
mut
c_void
,
)
->
bool
{
todo!
()
}
/// Search the specified playlist in database.
/// ### Safety
/// The passed db pointer must be created by
/// [`lkt_database_establish_connection`]. The passed uri pointer must be a
/// valid an address to a URI. The passed playlist name must be a valid C
/// string (a null terminated string).
#[no_mangle]
pub
unsafe
extern
"C"
fn
lkt_database_search_playlist
(
db
:
*
mut
LktDatabaseConnection
,
playlist
:
*
mut
c_char
,
uri
:
LktUriPtr
,
cb
:
extern
"C"
fn
(
i64
,
*
mut
c_void
),
user
:
*
mut
c_void
,
)
->
bool
{
todo!
()
}
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter