home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
lclint.zip
/
lclint-2_3h-os2-bin.zip
/
test
/
db1
/
employee.c
< prev
next >
Wrap
Text File
|
1997-09-03
|
758b
|
36 lines
# include <stdio.h>
# include <string.h>
# include "employee.h"
bool employee_setName (employee *e, char na [])
{
int i;
for (i = 0; na[i] != '\0'; i++)
{
if (i == maxEmployeeName) return FALSE;
}
strcpy (e->name, na);
return TRUE;
}
bool employee_equal (employee * e1, employee * e2)
{
return ((e1->ssNum == e2->ssNum)
&& (e1->salary == e2->salary)
&& (e1->gen == e2->gen)
&& (e1->j == e2->j)
&& (strncmp (e1->name, e2->name, maxEmployeeName) == 0));
}
void employee_sprint (char s[], employee e)
{
static char *gender[] ={ "male", "female", "?" };
static char *jobs[] = { "manager", "non-manager", "?" };
(void) sprintf (s, employeeFormat, e.ssNum, e.name,
gender[e.gen], jobs[e.j], e.salary);
}