The search.c example shows how you can use search functions. It is part of the spshell program
#include <string.h>
#include "spshell.h"
#include "cmd.h"
static void print_album(
sp_album *album)
{
printf(" Album \"%s\" (%d)\n",
}
{
}
{
int i;
puts("");
puts("");
puts("");
puts("");
}
}
static void SP_CALLCONV search_complete(
sp_search *search,
void *userdata)
{
print_search(search);
else
fprintf(stderr, "Failed to search: %s\n",
cmd_done();
}
static void search_usage(void)
{
fprintf(stderr, "Usage: search <query>\n");
}
int cmd_search(int argc, char **argv)
{
char query[1024];
int i;
if (argc < 2) {
search_usage();
return -1;
}
query[0] = 0;
for(i = 1; i < argc; i++)
snprintf(query + strlen(query), sizeof(query) - strlen(query), "%s%s",
i == 1 ? "" : " ", argv[i]);
sp_search_create(g_session, query, 0, 100, 0, 100, 0, 100, 0, 100, SP_SEARCH_STANDARD, &search_complete, NULL);
return 0;
}
int cmd_whatsnew(int argc, char **argv)
{
sp_search_create(g_session,
"tag:new", 0, 0, 0, 250, 0, 0, 0, 0, SP_SEARCH_STANDARD, &search_complete, NULL);
return 0;
}