
210 DCE Replacement Strategies
Example 10-4 shows an extract of the business logic function.
Example 10-4 Extract from business logic
typedef struct {
char *emp_name;
char *dept_name;
long grade_value;
double salary_value;
} emp_entry_t;
emp_entry_t emp_table [] = {
{"peter_morgan", "Accounting",1,24000.0},
{"ruth_jones", "Marketing",2,38000.0},
{"howard_stein","Finance",2,42000.0},
{"fran_cooper", "Administration",1,27000.0},
{"john_doe", "Training",1,18000.0},
{NULL,NULL,-1,0}
};
DIRECTORY_EXPORT long getGradeImpl(char *name) {
emp_entry_t *emp_table_p=emp_table;
int i=0;
for (i=0;; i++) {
if(emp_table_p->emp_name==NULL) return -1;
if (! strcmp ...