libscipaper 1.0.x
scipaper.h
1/*
2 * scipaper.h
3 * Copyright (C) Carl Philipp Klemm 2022 <carl@uvos.xyz>
4 *
5 * scipaper.h is free software: you can redistribute it and/or modify it
6 * under the terms of the lesser GNU General Public License as published by the
7 * Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * scipaper.h is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
14 *
15 * You should have received a copy of the lesser GNU General Public License along
16 * with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#pragma once
20
21#include <stdbool.h>
22#include <scipaper/types.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
41
53RequestReturn* sci_fill_meta(const DocumentMeta* meta, const FillReqest* fill, size_t maxCount, size_t page);
54
62DocumentMeta* sci_find_by_doi(const char* doi, int backendId);
63
70DocumentMeta* sci_find_by_title(const char* title);
71
79RequestReturn* sci_find_by_author(const char* author, size_t maxCount);
80
88RequestReturn* sci_find_by_journal(const char* journal, size_t maxCount);
89
97
105
112bool sci_save_pdf_to_file(const PdfData* data, const char* fileName);
113
120bool sci_save_document_to_file(const DocumentMeta* meta, const char* fileName);
121
128
136
143int sci_backend_get_id_by_name(const char* name);
144
150const char* sci_get_backend_name(int id);
151
157
166bool sci_paper_init(const char* config_file, const char* data, size_t length);
167
172void sci_paper_exit(void);
173
179
185#ifdef __cplusplus
186}
187#endif
RequestReturn * sci_find_by_author(const char *author, size_t maxCount)
Tries to find the documents by a certain author.
bool sci_save_pdf_to_file(const PdfData *data, const char *fileName)
Tries to get save the PDF of a certain document to disk.
int sci_backend_get_id_by_name(const char *name)
gives you the id of the backend with a given name
PdfData * sci_get_document_pdf_data(const DocumentMeta *meta)
Tries to get the PDF data of a certain document.
char * sci_get_document_text(const DocumentMeta *meta)
Tries to get the full text of a certain document.
RequestReturn * sci_find_by_journal(const char *journal, size_t maxCount)
Tries to find the documents by in a certain journal.
void sci_paper_exit(void)
Exits libscipaper, this function must be your final call to libscipaper, it is an error to reinit lib...
loglevel_t
Severity of loglevels.
Definition types.h:37
bool sci_save_document_to_file(const DocumentMeta *meta, const char *fileName)
Saves the PDF of a certain document to disk.
RequestReturn * sci_fill_meta(const DocumentMeta *meta, const FillReqest *fill, size_t maxCount, size_t page)
Takes a DocumentMeta and tries to find maxCount documents that match the fields set in the meta struc...
void sci_log_set_verbosity(loglevel_t verbosity)
Sets the verbosity of sicpaper output.
DocumentMeta * sci_find_by_title(const char *title)
Tries to find the metadata of the document with the given title.
bool sci_paper_init(const char *config_file, const char *data, size_t length)
Inits libscipaper, this function must be your first call to libscipaper, besides sci_get_version() an...
size_t sci_get_backend_count(void)
gives you the number of backends currently registered
const char * sci_get_backend_name(int id)
gives you the name of the backend with id
const BackendInfo * sci_get_backend_info(int id)
gives you a BackendInfo struct describing the backend with the id
const BackendInfo ** sci_get_all_backends(void)
gives you an array describing each backend registered with libscipaper.
DocumentMeta * sci_find_by_doi(const char *doi, int backendId)
Tries to find the metadata of the document with the given DOI.
const VersionFixed * sci_get_version(void)
get the version of scipaper in use
Backend information struct.
Definition types.h:75
This struct contains the metadata of a paper, must be created via document_meta_new() and freed via d...
Definition types.h:103
This bitfield tells libscipaper what fields you require to have filled.
Definition types.h:84
This struct contains the raw data of a PDF document.
Definition types.h:260
This struct is details the result of a metadata search.
Definition types.h:234
This struct contains the version of libscipaper in use.
Definition types.h:66