gpSendFilesCallback

GameSpy SDK

gpSendFilesCallback

This is a callback used by gpSendFiles() to get the list of files to send.

typedef void (*gpSendFilesCallback)(
GPConnection * connection,
int index,
const gsi_char ** path,
const gsi_char ** name,
void * param );
RoutineRequired HeaderDistribution
gpSendFilesCallback<gp.h>SDKZIP

Parameters

connection
[in] The connection the files are to be sent on.
index
[in] This starts at 0 and is incremented by 1 each time the callback gets called.
path
[in] Point this to the path to the file to send, or NULL for a directory.
name
[in] Point this to the name to send the file under, or NULL to use the file's local name.
param
[in] User-data that was passed into gpSendFiles.

Remarks

This function will be called repeatedly until neither path or name are set (or both set to NULL). The callback can be used to specify either a file or a directory. To specify a file, set path to point to a string containing the path to the file. If the name is also set, then it contains the name to send the file under. The name can either be a simple filename ("file.ext"), or it can contain a path ("files/file.ext"). If a path is specified, and name is not set (or set to NULL), then the filename part of the path will be used. For example, if path points to "c:\files\file.ext" and name is not set, then the name will be "file.ext".
To specify a directory, don't set the path (or set it to NULL), then set a name. The name will be treated as a directory to create. For example, if path is not set, and name is "files", this instructs the receiver to create a directory named "files".
The name for a file or folder cannot contain any directory level references (e.g., "../file.exe"), cannot start with a slash or backslash, cannot contain any empty directory names in the path, and cannot contain any invalid characters ( : * ? " < > | \n ).

Unicode Mappings

RoutineGSI_UNICODE Not DefinedGSI_UNICODE Defined
gpSendFilesCallbackgpSendFilesCallbackAgpSendFilesCallbackW

gpSendFilesCallbackW and gpSendFilesCallbackA are UNICODE and ANSI mapped versions of gpSendFilesCallback. The arguments of gpSendFilesCallbackA are ANSI strings; those of gpSendFilesCallbackW are wide-character strings.

Section Reference: Gamespy Presence SDK