netatalk  4.6.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
FPSpotlightRPC.c File Reference
#include <stdio.h>
#include <inttypes.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/param.h>
#include "afpcmd.h"
#include "afphelper.h"
#include "testhelper.h"

Macros

#define PAG_CORPUS_SMALL   50
#define PAG_CORPUS_PAGED   250
#define PAG_PREFIX_530   "paginate530-f-"
#define PAG_PREFIX_531   "paginate531-p-"
#define PAG_DIR_SMALL   "pagtest_small"
#define PAG_DIR_PAGED   "pagtest_paged"
#define PHRASE_DIR   "pagtest_phrase"
#define SCOPE_DIR   "pagtest_scope"
#define SCOPE_SUB_IN   "scope633-inside"
#define SCOPE_SUB_OUT   "scope633-outside"
#define SCOPE_SUB_UML   "scope633-u\xCC\x88" "ber"
#define SCOPE_FILE   "scope633-file.txt"

Functions

static int pag_create_dir_get_did (uint16_t vol, uint32_t parent_did, char *name)
 Create a directory and return its DID.
static void pag_log_ret (const char *testname, const char *opop, unsigned int ret)
static int pag_spotlight_open (uint16_t vol, const char *testname)
static void pag_log_create_dir_failure (const char *testname, const char *dirname)
static void pag_log_create_file_failure (const char *testname, const char *filename, unsigned int ret)
STATIC void test547 ()
STATIC void test548 ()
STATIC void test560 ()
STATIC void test561 ()
STATIC void test562 ()
STATIC void test563 ()
STATIC void test565 ()
static int phrase_query_count (const char *testname, uint16_t vol, const char *query, const char *scope, uint32_t ctx, int *got)
 Run one Spotlight query and return the drained result count.
STATIC void test632 ()
STATIC void test633 ()
STATIC void test634 ()
void FPSpotlightRPC_test ()

Macro Definition Documentation

◆ PAG_CORPUS_PAGED

#define PAG_CORPUS_PAGED   250

◆ PAG_CORPUS_SMALL

#define PAG_CORPUS_SMALL   50

◆ PAG_DIR_PAGED

#define PAG_DIR_PAGED   "pagtest_paged"

◆ PAG_DIR_SMALL

#define PAG_DIR_SMALL   "pagtest_small"

◆ PAG_PREFIX_530

#define PAG_PREFIX_530   "paginate530-f-"

◆ PAG_PREFIX_531

#define PAG_PREFIX_531   "paginate531-p-"

◆ PHRASE_DIR

#define PHRASE_DIR   "pagtest_phrase"

◆ SCOPE_DIR

#define SCOPE_DIR   "pagtest_scope"

◆ SCOPE_FILE

#define SCOPE_FILE   "scope633-file.txt"

◆ SCOPE_SUB_IN

#define SCOPE_SUB_IN   "scope633-inside"

◆ SCOPE_SUB_OUT

#define SCOPE_SUB_OUT   "scope633-outside"

◆ SCOPE_SUB_UML

#define SCOPE_SUB_UML   "scope633-u\xCC\x88" "ber"

Function Documentation

◆ FPSpotlightRPC_test()

void FPSpotlightRPC_test ( )

◆ pag_create_dir_get_did()

int pag_create_dir_get_did ( uint16_t vol,
uint32_t parent_did,
char * name )
static

Create a directory and return its DID.

Convention reminder: in the testsuite, FPCreate* / FPOpen* helpers return the new DID (NETWORK byte order, treated as int) on success and 0 on failure — they do NOT return AFP error codes.

AFPCreateDir extracts the new DID from dsi->commands with a straight memcpy (no byte swap). The returned value is therefore the on-the-wire NETWORK-byte-order CNID stored as int. It must be passed straight back to FPCreateFile()/FPOpenDir() without an ntohl() — those helpers will memcpy it onto the next request's wire as-is. Applying ntohl() here would silently corrupt the DID.

Returns
the network-byte-order new DID on success, 0 on error

◆ pag_log_create_dir_failure()

void pag_log_create_dir_failure ( const char * testname,
const char * dirname )
static

◆ pag_log_create_file_failure()

void pag_log_create_file_failure ( const char * testname,
const char * filename,
unsigned int ret )
static

◆ pag_log_ret()

void pag_log_ret ( const char * testname,
const char * op,
unsigned int ret )
static

◆ pag_spotlight_open()

int pag_spotlight_open ( uint16_t vol,
const char * testname )
static

◆ phrase_query_count()

int phrase_query_count ( const char * testname,
uint16_t vol,
const char * query,
const char * scope,
uint32_t ctx,
int * got )
static

Run one Spotlight query and return the drained result count.

Returns
1 on success (count in *got), 0 after recording the failure

◆ test547()

STATIC void test547 ( )

◆ test548()

STATIC void test548 ( )

◆ test560()

STATIC void test560 ( )

◆ test561()

STATIC void test561 ( )

◆ test562()

STATIC void test562 ( )

◆ test563()

STATIC void test563 ( )

◆ test565()

STATIC void test565 ( )

◆ test632()

STATIC void test632 ( )

◆ test633()

STATIC void test633 ( )

◆ test634()

STATIC void test634 ( )