#ident "$URL: svn://elmer/devel/SVN/SDDAS/trunk/libdB/dbField.c $ %D% SwRI" #include #include #include "dbf.h" /***************** ** >FILE: dbField.c *****************/ /*********************************************************** ** Function: FieldRecord_t *dbField(int handle, char *name) ** ** int handle handle to the database structure ** char *name the name of the field ** ** Description: ** This subroutine returns a pointer to the field associated by name. ** ** Return Values: ** ***************** *****************/ FieldRecord_t *dbField(SDDAS_INT handle, char *name) { dbfRecord_t *D; SDDAS_INT i; if ((D = GetOldDbfHandle(handle)) == NULL) return NULL; for (i=0; iNumFields; i++) { if (strcmp(name, D->Fields[i].Name) == 0) { dbf_msg_clr; dbf_code = 0; return &D->Fields[i]; } } sprintf(msg, "'%s' in '%s'", name, D->FileName); dbf_code = UNKNOWN_FIELD; return NULL; }