This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/os2/som/classes/student.c

69 lines
1.4 KiB
C

/*
* This file was generated by the SOM Compiler and Emitter Framework.
* Generated using template emitter:
* SOM Emitter emitctm: 2.23.1.9
*/
#ifndef SOM_Module_student_Source
#define SOM_Module_student_Source
#endif
#define Student_Class_Source
#include "student.ih"
#include <stdio.h>
#include <string.h>
/*
* sets up a new student
*/
SOM_Scope void SOMLINK setUpStudent(Student *somSelf, char *id,
char *name)
{
StudentData *somThis = StudentGetData(somSelf);
StudentMethodDebug("Student","setUpStudent");
strcpy(_id, id);
strcpy(_name, name);
}
/*
* prints the student information
*/
SOM_Scope void SOMLINK printStudentInfo(Student *somSelf)
{
StudentData *somThis = StudentGetData(somSelf);
StudentMethodDebug("Student","printStudentInfo");
printf(" Id : %s\n", _id);
printf(" Name : %s\n", _name);
printf(" Type : %s\n", _getStudentType(somSelf));
}
/*
* returns the student type
*/
SOM_Scope char* SOMLINK getStudentType(Student *somSelf)
{
static char *type = "student";
StudentData *somThis = StudentGetData(somSelf);
StudentMethodDebug("Student","getStudentType");
return type;
}
/*
* returns the student ID
*/
SOM_Scope char* SOMLINK getStudentId(Student *somSelf)
{
StudentData *somThis = StudentGetData(somSelf);
StudentMethodDebug("Student","getStudentId");
return _id;
}