The TAG system

As mentioned above, the tagging system is what makes ReqTools very expandible, without having to change the APIs every day. The tagging system is flexible and offers also better code readability, since all values you'll pass using tagging system are preceded by the attribute name.

To better understand its features, suppose you have a function like this one:

int draw_3d_sphere(Env3D *env, int faces, int slices, float radius, Color * color, intxpos, intypos);

it is a very complex function, with a lot of parameters. Almost for sure, each time you'll have to use it you'll go for the function prototype or for a line in your code already using that function for a quick help reminding all params and their right order. And there's more: once you realized that you also need the zpos parameter in you function call, you'll have to add yet another param, breaking compatibility with old code. (Please, keep in mind that this is just an example...)

Using the tagging system, you should have a function prototype like this one:

int draw_3d_sphere(Env3D *env, ... );

well... it is much better. But how would you pass all the parameters to the new function? The answer is simple: by using tagging system.

All you have to do pass all parameters followed by their value and separated by commas, one at a time, like this:
	draw_3d_sphere ( env,  SPHERE_TAG_SLICES,   10,
	                       SPHERE_TAG_RADIUS,    5,
	                       SPHERE_TAG_COLOR,  &col,
	                       SPHERE_TAG_XPOS,      x,
	                       SPHERE_TAG_YPOS,      y,
	                       SPHERE_TAG_ZPOS,      z,
	                       SPHERE_TAG_END );
		
As you can see there are many advantages: