myMPD
Internal API documentation
Loading...
Searching...
No Matches
filesystem.c File Reference

myMPD filesystem API More...

#include "compile_time.h"
#include "src/mympd_api/filesystem.h"
#include "dist/utf8/utf8.h"
#include "src/lib/json/json_print.h"
#include "src/lib/json/json_rpc.h"
#include "src/lib/mem.h"
#include "src/lib/rax_extras.h"
#include "src/lib/sds_extras.h"
#include "src/lib/smartpls.h"
#include "src/lib/utility.h"
#include "src/mympd_api/extra_media.h"
#include "src/mympd_api/sticker.h"
#include "src/mympd_client/errorhandler.h"
#include "src/mympd_client/stickerdb.h"
#include "src/mympd_client/tags.h"
#include <libgen.h>
#include <string.h>
Include dependency graph for filesystem.c:

Data Structures

struct  t_dir_entry
 

Functions

static void free_t_dir_entry (void *data)
 
static bool search_dir_entry (rax *rt, sds key, sds entity_name, struct mpd_entity *entity, sds searchstr)
 
sds mympd_api_browse_filesystem (struct t_mympd_state *mympd_state, struct t_partition_state *partition_state, sds buffer, unsigned request_id, sds path, unsigned offset, unsigned limit, sds searchstr, const struct t_fields *tagcols)
 

Detailed Description

myMPD filesystem API

Function Documentation

◆ free_t_dir_entry()

static void free_t_dir_entry ( void *  data)
static

private functions Frees the t_dir_entry struct used as callback for rax_free_data

Parameters
datavoid pointer to a t_dir_entry struct

◆ mympd_api_browse_filesystem()

sds mympd_api_browse_filesystem ( struct t_mympd_state mympd_state,
struct t_partition_state partition_state,
sds  buffer,
unsigned  request_id,
sds  path,
unsigned  offset,
unsigned  limit,
sds  searchstr,
const struct t_fields tagcols 
)

Public functions Lists the entry of directory in the mpd music directory as jsonrpc response Custom order: directories, playlists, songs

Parameters
mympd_statepointer to mympd state
partition_statepointer to the partition state
bufferalready allocated sds string to append result
request_idjsonrpc request id
pathpath to list
offsetoffset for listing
limitmax entries to list
searchstrstring to search
tagcolscolumns to print
Returns
pointer to buffer

◆ search_dir_entry()

static bool search_dir_entry ( rax *  rt,
sds  key,
sds  entity_name,
struct mpd_entity *  entity,
sds  searchstr 
)
static

Search the entry for searchstr and add matches to the rax tree

Parameters
rtrax tree to insert
keykey to insert
entity_namedisplayname of the entity
entitypointer to mpd entity
searchstrstring to search in entity_name
Returns
true on match, else false