home *** CD-ROM | disk | FTP | other *** search
- # include <stdio.h>
- # include <bench.h>
- # include <proc.io>
- # include "field.h"
- # include "screen.h"
- # include "iodef.h"
- # include "sup.h"
-
- #define VNULL (void (*)())0
-
- /*
- * the following routine checks to see if there is only one function defined
- * for the current screen
- * if more than 1 function it returns -1 else it returns the function index
- */
- int check_single(tab, apps)
- struct _table *tab;
- # ifdef ANSI
- int (*apps[])(struct _table *tab, struct a_line **head, struct a_line **lptr, int table);
- # else
- int (*apps[])();
- # endif
- {
- int i, func, num_apps;
-
- for (i = num_apps = 0, func = -1; i < 9; i++)
- {
- if (apps[i] != (int (*)())0)
- {
- num_apps++;
- func = i;
- }
- }
-
- if (num_apps > 1 )
- return(-1); /* more than 1 function found ! */
-
- /*
- * Display Date & Time (if the function is defined)
- */
- if (tab->key_fn != VNULL && tab->extra_fn != VNULL)
- (*tab->extra_fn)();
-
- return(func);
- }
-
-