Ninf Client API

This document gives Ninf Client API.


Our API provides following functions.


This function calls Ninf function on a remote server. The first argument specifies server and function. Here is an example that calls "mmul" function on our server "".
     Ninf_call("ninf://", n, A, B, C);
You can omit the server name and port. In such case, a default server will be used. Default server can be specified by environment variable "NINF_SERVER" and "NINF_SERVER_PORT", or Ninf_parse_arg. This function returns 0 if succeed, returns -1 if failed.


This function is almost same as Ninf_call, but it returns immediately. Using this function, you can invoke several sessions simultaneously. It returns non-negative ID if succeed, returns -1 if failed.
     id = Ninf_call_async("ninf://", n, A, B, C);


This function wait for termination of one session specified by id. It returns 0 if succeed, returns -1 if failed.


This function wait for all sessions which invoked by Ninf_call_async.


This function parse argument list for your client program and get default hostname and port. It recognizes "-server SERVER" and "-port PORT", and remove these arguments from your list. It returns new argc value. Here is an example showing typical usage.
main (int argc, char ** argv){
	argc = Ninf_parse_arg(argc, argv);


This function produces an error massage on the standard error output, describing the last error encountered in Ninf_call. The argument string is printed first, then a colon and a blank, then the message and a newline. Here is an example showing typical usage.
   if (Ninf_call("mmul", n, A, B, C) < 0){
	Ninf_perror("Failed in mmul");