ReqTools APIs

In this section we'll examine in details all ReqTools APIs. As you should already know, they are just three function calls that do all the work.

reqtools_new ( AFC * AFC )

Synopsis

Reqtools * reqtools_new ( AFC *afc);

Description

This function create a new ReqTools instance. You must call this function before any other ReqTools function call to create a valid environment where ReqTools functions can operate.

Inputs

afc

Pointer to a valid (already allocated) AFC class.

Result

If everything went ok in the inizialization process, a pointer to a valid ReqTools instance is returned. You will get a NULL in case of errors.

reqtools_delete ( Reqtools * ReqTools )

Synopsis

void reqtools_delete ( Reqtools *rt);

Description

This function completely deletes a ReqTools instance and frees all memory related to it. You should call this function at the very end of you program, before exiting. Once this function has been called the ReqTools pointer is not valid anymore.

Inputs

rt

Pointer to a valid ReqTools instance.

Result

This function does not return anything. But all resources related to the passed ReqTools instance will be freed.

reqtools_requester ( Reqtools * ReqTools, int requester, ... )

Synopsis

int reqtools_requester ( Reqtools *rt, int requester, ...);

Description

This function is the real thing. It is able to create several different requesters and to give you back info about what the user selected. Once this function is call, your program will not continue until the user selectes something from your requester.

Inputs

rt

Pointer to a valid ReqTools instance.

requester

One of the standard built-in requesters avaible. At the moment, possible values are:

REQTOOLS_EASY_REQUEST

The standard Are you sure? or similar requester.

REQTOOLS_INPUT_REQUEST

This requester allows the user to insert a small amount of data, eg. a string text or a numerical value.

REQTOOLS_SINGLE_FILE

This is a file requester allowing the user to choose only one file

REQTOOLS_MULTI_FILE

This is a file requester allowing the user to choose more than one file

REQTOOLS_PATH_REQUEST

This is a file requester allowing the user to choose only paths. Files are not shown in the requester's window.

REQTOOLS_COLOR_REQUEST

This is color requester allowing the user to choose a color.

...

A valid tag list of possible tags for the provided requester.

Result

This function always return the button pressed by the user. If the user press the Cancel button or closes the window, the result will be 0.