zathura
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Data Structures | Functions
bookmarks.h File Reference
#include <stdbool.h>
#include "zathura.h"

Go to the source code of this file.

Data Structures

struct  zathura_bookmark_t

Functions

zathura_bookmark_t * zathura_bookmark_add (zathura_t *zathura, const gchar *id, unsigned int page)
bool zathura_bookmark_remove (zathura_t *zathura, const gchar *id)
zathura_bookmark_t * zathura_bookmark_get (zathura_t *zathura, const gchar *id)
void zathura_bookmark_free (zathura_bookmark_t *bookmark)
bool zathura_bookmarks_load (zathura_t *zathura, const gchar *file)
int zathura_bookmarks_compare (zathura_bookmark_t *lhs, zathura_bookmark_t *rhs)

Function Documentation

zathura_bookmark_t* zathura_bookmark_add ( zathura_t *  zathura,
const gchar *  id,
unsigned int  page 
)

Create a bookmark and add it to the list of bookmarks.

Parameters
zathuraThe zathura instance.
idThe bookmark's id.
pageThe bookmark's page.
Returns
the bookmark instance or NULL on failure.

Definition at line 23 of file bookmarks.c.

void zathura_bookmark_free ( zathura_bookmark_t *  bookmark)

Free a bookmark instance.

Parameters
bookmarkThe bookmark instance.

Definition at line 105 of file bookmarks.c.

zathura_bookmark_t* zathura_bookmark_get ( zathura_t *  zathura,
const gchar *  id 
)

Get bookmark from the list of bookmarks.

Parameters
zathuraThe zathura instance.
idThe bookmark's id.
Returns
The bookmark instance if it exists or NULL otherwise.

Definition at line 96 of file bookmarks.c.

bool zathura_bookmark_remove ( zathura_t *  zathura,
const gchar *  id 
)

Remove a bookmark from the list of bookmarks.

Parameters
zathuraThe zathura instance.
idThe bookmark's id.
Returns
true on success, false otherwise

Definition at line 73 of file bookmarks.c.

int zathura_bookmarks_compare ( zathura_bookmark_t *  lhs,
zathura_bookmark_t *  rhs 
)

Compare two bookmarks.

Parameters
lhsa bookmark
rhsa bookmark
Returns
g_strcmp0(lhs->id, rhs->id)

Definition at line 137 of file bookmarks.c.

bool zathura_bookmarks_load ( zathura_t *  zathura,
const gchar *  file 
)

Load bookmarks for a specific file.

Parameters
zathuraThe zathura instance.
fileThe file.
Returns
true on success, false otherwise

Definition at line 116 of file bookmarks.c.