$ABOUTCATEG$
  C-API
$SUMMARY$
	C-functions that allows using C-language
	along with CLIP.
$LANG_RU$
	C-, 	 C   CLIP.
$DESCRIPTION$
	CLIP's C-API is a set of C-functions that allows using C-language
	along with CLIP. It could be necessary for writing some speed critical
	functions of your project; for writing "wrappers" for existing 3rd party
	functions or whole libraries, etc. Besides, learning C-API will help you
	understand internal structure of CLIP.

	C-functions aimed to be used with CLIP (that is, which can be called
	from some CLIP function, 'exported functions' in further) are in
	separate C source file(s). This file must include "clip.h", which
	contains declarations of C-API functions and structures.

	Each exported function's name must have prefix 'clip_' and the name itself
	must be in capital letters. Type of function must be 'int' and it
	must get one and only parameter of type 'ClipMachine *', which is a pointer
	to the structure containing context of the current CLIP Virtual Machine.

	Exported function should return 0 (zero) if successful, or appropriate
	error code (those described in error.ch, with 'EG_' prefix).

	<pre>
	Example:
	/* my.c */
	#include <stdio.h>
	#include "clip.h"

	int clip_MYFUNCTION(ClipMachine *cm)
	{
		printf("Hello from MyFunction()\n");
		return 0;
	}
	/* end of my.c */

	/* test.prg */
	MyFunction()
	/* end of test.prg */

	Compilation:

	gcc -c -I${CLIPROOT}/include my.c
	clip -eM test.prg my.o

	Running:
	#./test
	Hello from MyFunction
	#
	</pre>
$LANG_RU$
	C-API  CLIP    C-, 
	 C   CLIP.   , , 
	 ,    ;  
	-     ,  ..
	 C-API        
	CLIP.

	C-,     CLIP (..  
	   CLIP-,   ' '),
	     C,   .  
	      "clip.h",  
	   C-API   .

	      'clip_',   
	     .   
	  'int',      
	'ClipMachine *' -  ,   
	  CLIP.

	    0 ()   ,
	    (  error.ch,   'EG_').

	<pre>
	:
	/* my.c */
	#include <stdio.h>
	#include "clip.h"

	int clip_MYFUNCTION(ClipMachine *cm)
	{
		printf("Hello from MyFunction()\n");
		return 0;
	}
	/* end of my.c */

	/* test.prg */
	MyFunction()
	/* end of test.prg */

	Compilation:

	gcc -c -I${CLIPROOT}/include my.c
	clip -eM test.prg my.o

	Running:
	#./test
	Hello from MyFunction
	#
	</pre>
