home *** CD-ROM | disk | FTP | other *** search
- /* -*- Emacs Mode: C++ -*- */
-
- /* intlink.c - IntLink Class - implementation
-
- Copyright (C) 1989, Integrity Software
- Author: Isaac J. Salzman (salzman@rand.org)
-
- This software may be freely used/modified/distributed
- as desired so long as this copyright notice remains
- in tact.
- */
-
- #ifndef lint
- static char *RcsId = "$Header: /tmp_mnt/amnt/lh/salzman/src/class/RCS/intlink.c,v 1.1 89/09/17 15:01:30 salzman Exp Locker: salzman $";
- #endif
-
- /*
- * $Log: intlink.c,v $
- * Revision 1.1 89/09/17 15:01:30 salzman
- * Initial revision
- *
- */
-
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
-
- #include "intlink.h"
-
- DEF_INIT(IntLink)(int i)
- {
- ival = i;
-
- INIT_SUPER(Link,());
-
- RETURN_THIS;
- }
-
- DEF_DEST(IntLink)(void)
- {
- DESTROY_SUPER;
- }
-
- void IntLink::showval(void)
- {
- printf("integer = %d\n", ival);
- }
-
- int IntLink::compare(char *item)
- {
- int i;
-
- if (!isdigit (*item))
- return -1;
-
- i = atoi(item);
-
- return (( i == ival) ? 0 : (( i < ival) ? -1 : 1));
- }
-