#ident "$URL: svn://elmer/devel/SVN/SDDAS/trunk/libdB/GoToTop.c $ %D% SwRI" #include "dbf.h" /******************* ** >FILE: GoToTop.c *******************/ /******************************************* ** Function: int GoToTop(int dbf, int ndx) ** ** int dbf handle value to database structure ** ** Description: ** ** Return Values: ** ***************** *****************/ dbRet_t GoToTop(SDDAS_INT dbf, SDDAS_INT ndx) { dbfRecord_t *D; ndxRecord_t *N; if ((D = GetOldDbfHandle(dbf)) == NULL) return FAILURE; if (ndx != -1) { if ((N = GetOldNdxHandle(dbf, ndx)) == NULL) return FAILURE; N->IndexRec = 1; return(GetDbfRecord(dbf, ItoR(N, N->IndexRec))); } return(GetDbfRecord(dbf, 1)); }