/*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/*\
\                                                                          /
/   Table management                  Copyright (c)  Dmitry A. Kazakov     \
\   [initialization]                                 St.Petersburg         /
/   TabInit                                          Autumn, 1993          \
\                                                                          /
/                                                                          \
\   (C, ANSI C)                       Last revision :  18:48 31 Oct 2001   /
/                                                                          \
\   This library is free software; you can redistribute it and/or modify   /
/   it  under  the  terms  of  the GNU Library General Public License as   \
\   published  by  the Free Software Foundation; either version 2 of the   /
/   License, or (at your option) any later version.                        \
\                                                                          /
/   As a special exception, if other  files  instantiate  generics  from   \
\   this unit, or you link this unit with  other  files  to  produce  an   /
/   executable, this  unit  does  not  by  itself  cause  the  resulting   \
\   executable  to  be  covered  by the GNU General Public License. This   /
/   exception  does  not  however  invalidate  any other reasons why the   \
\   executable file might be covered by the GNU Public License.            /
/                                                                          \
\   This library is distributed in the hope that it will be useful,  but   /
/   WITHOUT   ANY   WARRANTY;  without  even  the  implied  warranty  of   \
\   MERCHANTABILITY or FITNESS FOR A PARTICULAR  PURPOSE.  See  the  GNU   /
/   Library General Public License for more details.                       \
\                                                                          /
/   You  should  have  received a copy of the GNU Library General Public   \
\   License  along with this library; if not, write to the Free Software   /
/   Foundation,   Inc.,   59  Temple  Place  -  Suite  330,  Boston,  MA   \
\   02111-1307, USA                                                        /
/                                                                          \
\*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/*/

#include	"tab.h"		/* Table specific		*/
/*>

   TabInit -- Initialize empty table

	Table	- Points to the table to be initialized
	Size	- The table size (bytes)

   This function initializes the table. The new table will be empty. 

   Returns :

        [0]  New size is too small.
        [+]  Available free space in the table.

<*/
#ifndef NON_ANSI
int	TabInit
(
   table  	Table, 
   const int	Size
)
#else
int	TabInit (Table, Size)
   table  	Table;
   const int	Size;
#endif	/*> NON_ANSI <*/
{
   if (Size <= sizeof (TabHeader)) return (0);
   Table->TotalSize = Size;
   Table->TOCSize = 0;
   Table->FreeSpace = Size - sizeof (TabHeader);
   return (Table->FreeSpace);

}	/*>  TabInit <*/
