Writing an Entry Point Function

Your entry point function will be called when the plugin is loaded. Its job is to tell the breve engine what new steve functions to add, their names, and the arguments they will take.

The prototype for an entry-point function is:

void entryPointFunctionName(void *data);

The name may be anything you'd like, but it must be a unique symbol.

This entry-point function will be filled with one or more calls to the function brNewBreveCall. The calling convention for this function is:

brNewBreveCall(data, "functionName", cFunctionPointer, returnType, arg1, arg2, ..., 0);
  • The first argument, data, is the "data" pointer which gets passed in to the entry-point function.

  • The second argument, functionName, is the quoted function name as it will appear in steve.

  • The third argument, cFunctionPointer, is the unquoted name of the C function.

  • The fourth argument, returnType, is the return type (as a steve constant, listed in the previous section).

  • Subsequent arguments are the types of input arguments (as steve constants, listed in the previous section) that your steve function will expect, with the value 0 afterwards indicating the end of the parameter list.

  • The final argument, to follow all of the input types, must be 0.

For example, if you have a function which takes two vector inputs and produces an int output, your brNewBreveCall might look like this:

brNewBreveCall(data, "mySteveFunctionName", myCFunctionName, AT_INT, AT_VECTOR, AT_VECTOR, 0);