
/*
 * This file was generated by the SOM Compiler.
 * FileName: fm.ih.
 * Generated using:
 *     SOM Precompiler somipc: 2.29.1.19
 *     SOM Emitter emitih.dll: 2.77.1.179
 */

/*
 *   This class is adapted from the book
 *     Class Construction in C and C++, Object Oriented Fundamentals
 *     by Roger Sessions, Copyright (c) 1992 Prentice Hall.
 *   Reprinted with permission.
 */


/*
 * The SOM_STRICT_IDL macro means that we can ignore stars
 * in our declarations of objects.
 */
#define SOM_STRICT_IDL 1


#ifndef SOM_fileMgr_ih
#define SOM_fileMgr_ih


/*
 * Set the scope of method functions
 */
#ifndef SOM_Scope
#define SOM_Scope static
#endif

#ifndef SOM_fileMgr_h
#include "fm.h"
#endif
#include <somcsr.h>
#if defined(__IBMC__) && (__IBMC__ >= 300)
  #pragma info(none)
#else
  #if defined(__IBMC__)
     #pragma checkout(suspend)
  #endif
#endif


/*
 * -- Instance data
 */
typedef struct {
	FILE* funit;
	long buffer[20];
	long putSide;
	long getSide;
} __somC_fileMgr_ProtectedPrivateData;
typedef __somC_fileMgr_ProtectedPrivateData fileMgrData, *fileMgrDataPtr;

/*
 * -- GetData macro
 */
typedef fileMgrDataPtr SOMLINK somTP_fileMgr_DataThunk(void*);
typedef somTP_fileMgr_DataThunk *somTD_fileMgr_DataThunk;

#define fileMgrGetData(somSelf) \
   (((somTD_fileMgr_DataThunk)(fileMgrCClassData.instanceDataToken))(somSelf))
#define _funit somThis->funit
#define _buffer somThis->buffer
#define _putSide somThis->putSide
#define _getSide somThis->getSide

/*
 * -- Primary Implementation File Support
 */
#if (defined(fileMgr_Class_Source) || defined(SOM_Module_fm_Source))

#ifndef fileMgrMethodDebug
   #define fileMgrMethodDebug(c,m) SOMMethodDebug(c,m)
#endif  /* fileMgrMethodDebug */

static void SOMLINK __somC_fileMgr_classInit(SOMClass cls);


/*
 * Init ClassData Structures
 */
struct fileMgrClassDataStructure SOMDLLEXPORT SOMDLINK fileMgrClassData = {0};
struct fileMgrCClassDataStructure SOMDLLEXPORT SOMDLINK fileMgrCClassData = {0};


/*
 * Identifiers
 */
static char __somC_Strings_fileMgr0[] = {"fileMgr"}; /* class name */
static char __somC_Strings_fileMgr1[] = {"fmInit"}; /* method name */
static char __somC_Strings_fileMgr2[] = {"fmGetChar"}; /* method name */
static char __somC_Strings_fileMgr3[] = {"fmPeekChar"}; /* method name */
static char __somC_Strings_fileMgr4[] = {"fmSize"}; /* method name */
static char __somC_Strings_fileMgr5[] = {"fmIncr"}; /* method name */
static char __somC_Strings_fileMgr6[] = {"fmAdd"}; /* method name */
static char __somC_Strings_fileMgr7[] = {"SOMObject"}; /* parent name */
static char __somC_Strings_fileMgr8[] = {"somInit"}; /* overridden method name */
static char __somC_Strings_fileMgr9[] = {"somUninit"}; /* overridden method name */
static char __somC_Strings_fileMgr10[] = {"somDumpSelfInt"}; /* overridden method name */
static char * __somC_fileMgr_regIdsArray[] = {
	__somC_Strings_fileMgr0,
#ifndef __somC_fileMgr_regIds_fmInit
#define __somC_fileMgr_regIds_fmInit 1
#endif
	__somC_Strings_fileMgr1,
#ifndef __somC_fileMgr_regIds_fmGetChar
#define __somC_fileMgr_regIds_fmGetChar 2
#endif
	__somC_Strings_fileMgr2,
#ifndef __somC_fileMgr_regIds_fmPeekChar
#define __somC_fileMgr_regIds_fmPeekChar 3
#endif
	__somC_Strings_fileMgr3,
#ifndef __somC_fileMgr_regIds_fmSize
#define __somC_fileMgr_regIds_fmSize 4
#endif
	__somC_Strings_fileMgr4,
#ifndef __somC_fileMgr_regIds_fmIncr
#define __somC_fileMgr_regIds_fmIncr 5
#endif
	__somC_Strings_fileMgr5,
#ifndef __somC_fileMgr_regIds_fmAdd
#define __somC_fileMgr_regIds_fmAdd 6
#endif
	__somC_Strings_fileMgr6,
	__somC_Strings_fileMgr7,
#ifndef __somC_fileMgr_regIds_somInit
#define __somC_fileMgr_regIds_somInit 8
#endif
	__somC_Strings_fileMgr8,
#ifndef __somC_fileMgr_regIds_somUninit
#define __somC_fileMgr_regIds_somUninit 9
#endif
	__somC_Strings_fileMgr9,
#ifndef __somC_fileMgr_regIds_somDumpSelfInt
#define __somC_fileMgr_regIds_somDumpSelfInt 10
#endif
	__somC_Strings_fileMgr10
};


/*
 * Overridden method: somInit
 */
SOM_Scope void  SOMLINK somInit(fileMgr somSelf);
/* pcalls for somInit/somUninit are turned off */
#define fileMgr_parent_SOMObject_somInit(__somSelf) 
#ifndef parent_SOMObject_somInit
   #define parent_SOMObject_somInit(__somSelf) 
#endif
#ifndef parent_somInit
   #define parent_somInit(__somSelf) 
#endif
#define fileMgr_parents_somInit(__somSelf) 

/*
 * Overridden method: somUninit
 */
SOM_Scope void  SOMLINK somUninit(fileMgr somSelf);
/* pcalls for somInit/somUninit are turned off */
#define fileMgr_parent_SOMObject_somUninit(__somSelf) 
#ifndef parent_SOMObject_somUninit
   #define parent_SOMObject_somUninit(__somSelf) 
#endif
#ifndef parent_somUninit
   #define parent_somUninit(__somSelf) 
#endif
#define fileMgr_parents_somUninit(__somSelf) 

/*
 * Overridden method: somDumpSelfInt
 */
SOM_Scope void  SOMLINK somDumpSelfInt(fileMgr somSelf,
		long level);
static somMethodProc* fileMgr_parent_SOMObject_somDumpSelfInt_resolved;
#define fileMgr_parent_SOMObject_somDumpSelfInt(somSelf,level) \
  ((( somTD_SOMObject_somDumpSelfInt ) \
    fileMgr_parent_SOMObject_somDumpSelfInt_resolved)(somSelf,level))
#ifndef SOMGD_pmc_SOMObject_somDumpSelfInt
  #ifdef parent_SOMObject_somDumpSelfInt
     #define SOMGD_pmc_SOMObject_somDumpSelfInt 1
     #undef parent_SOMObject_somDumpSelfInt
  #else
     #define parent_SOMObject_somDumpSelfInt fileMgr_parent_SOMObject_somDumpSelfInt
  #endif /* parent_SOMObject_somDumpSelfInt */
#endif /* SOMGD_pmc_SOMObject_somDumpSelfInt */
#ifndef SOMGD_pmc_parent_somDumpSelfInt
  #ifdef parent_somDumpSelfInt
    #define SOMGD_pmc_parent_somDumpSelfInt
    #undef parent_somDumpSelfInt
  #else
#define parent_somDumpSelfInt fileMgr_parent_SOMObject_somDumpSelfInt
  #endif
#endif
#define fileMgr_parents_somDumpSelfInt(somSelf,level) (\
   fileMgr_parent_SOMObject_somDumpSelfInt(somSelf,level))
#define SOMPCALLfileMgr_somDumpSelfInt
static somMethodProc* fileMgr_pcall_somDumpSelfInt_resolved;
#define fileMgr_pcall_somDumpSelfInt(somSelf,level) \
  ((( somTD_SOMObject_somDumpSelfInt ) \
    fileMgr_pcall_somDumpSelfInt_resolved)(somSelf,level))
static void  SOMLINK fileMgr_pcallResolve_somDumpSelfInt(fileMgr somSelf,
		long level)
{
   ((somTD_SOMObject_somDumpSelfInt) 
      somPCallResolve(somSelf, _fileMgr, _SOMMTOKEN_SOMObject(somDumpSelfInt)))(somSelf,level);
}


/*
 * New Method: fmInit
 */
SOM_Scope void  SOMLINK fmInit(fileMgr somSelf,
		string newFile);
/*
 *  Initialize and open a new file.
 */
#ifndef somId_fmInit
#define somId_fmInit ((somId)&(__somC_fileMgr_regIdsArray[__somC_fileMgr_regIds_fmInit]))
#endif
#define SOM_MPR_MINFO_fmInit {0, 8, 0}
static somMpRowMethodInfo fileMgr_fmInit_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO_fmInit};
#ifndef DEFINEDfileMgr_fmInit_mp
#define DEFINEDfileMgr_fmInit_mp
/*[ ::fileMgr::fmInit fileMgr_fmInit_mp ]*/
/* Contract specification:
[CALLTYPE_OIDL (1)][VERSION 0]
ARG 0[in]: String
*/
static struct { void * rows; unsigned char csr[4]; } fileMgr_fmInit_mp={&fileMgr_fmInit_mp_minfoRow, {
0x81, 0x01, 0x54},
};
#endif
#define fmInit_somMethodInfoValue 0
#define fmInit_somApplyStubValue &fileMgr_fmInit_mp.csr
#define fmInit_somHasMPlan 8

/*
 * New Method: fmGetChar
 */
SOM_Scope long  SOMLINK fmGetChar(fileMgr somSelf);
/*
 *  Get the next character in the file.
 */
#ifndef somId_fmGetChar
#define somId_fmGetChar ((somId)&(__somC_fileMgr_regIdsArray[__somC_fileMgr_regIds_fmGetChar]))
#endif
/* Contract specification:
[CALLTYPE_OIDL (1)][RESULT][VERSION 0]
RESULT[out]: Long
*/
#define fmGetChar_somMethodInfoValue 0
#define fmGetChar_somApplyStubValue 0x830105
#define fmGetChar_somHasMPlan 24

/*
 * New Method: fmPeekChar
 */
SOM_Scope long  SOMLINK fmPeekChar(fileMgr somSelf,
		long offset);
/*
 *  Peek ahead in the file.
 */
#ifndef somId_fmPeekChar
#define somId_fmPeekChar ((somId)&(__somC_fileMgr_regIdsArray[__somC_fileMgr_regIds_fmPeekChar]))
#endif
#define SOM_MPR_MINFO_fmPeekChar {0, 8, 0}
static somMpRowMethodInfo fileMgr_fmPeekChar_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO_fmPeekChar};
#ifndef DEFINEDfileMgr_fmPeekChar_mp
#define DEFINEDfileMgr_fmPeekChar_mp
/*[ ::fileMgr::fmPeekChar fileMgr_fmPeekChar_mp ]*/
/* Contract specification:
[CALLTYPE_OIDL (1)][RESULT][VERSION 0]
RESULT[out]: Long
ARG 1[in]: Long
*/
static struct { void * rows; unsigned char csr[4]; } fileMgr_fmPeekChar_mp={&fileMgr_fmPeekChar_mp_minfoRow, {
0x85, 0x02, 0x83, 0x43},
};
#endif
#define fmPeekChar_somMethodInfoValue 0
#define fmPeekChar_somApplyStubValue &fileMgr_fmPeekChar_mp.csr
#define fmPeekChar_somHasMPlan 8

/*
 * New Method: fmSize
 */
SOM_Scope long  SOMLINK fmSize(fileMgr somSelf);
#ifndef somId_fmSize
#define somId_fmSize ((somId)&(__somC_fileMgr_regIdsArray[__somC_fileMgr_regIds_fmSize]))
#endif
/* Contract specification:
[CALLTYPE_OIDL (1)][RESULT][VERSION 0]
RESULT[out]: Long
*/
#define fmSize_somMethodInfoValue 0
#define fmSize_somApplyStubValue 0x830105
#define fmSize_somHasMPlan 24

/*
 * New Method: fmIncr
 */
SOM_Scope long  SOMLINK fmIncr(fileMgr somSelf,
		long oldNum);
#ifndef somId_fmIncr
#define somId_fmIncr ((somId)&(__somC_fileMgr_regIdsArray[__somC_fileMgr_regIds_fmIncr]))
#endif
#define SOM_MPR_MINFO_fmIncr {0, 8, 0}
static somMpRowMethodInfo fileMgr_fmIncr_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO_fmIncr};
#ifndef DEFINEDfileMgr_fmIncr_mp
#define DEFINEDfileMgr_fmIncr_mp
/*[ ::fileMgr::fmIncr fileMgr_fmIncr_mp ]*/
/* Contract specification:
[CALLTYPE_OIDL (1)][RESULT][VERSION 0]
RESULT[out]: Long
ARG 1[in]: Long
*/
static struct { void * rows; unsigned char csr[4]; } fileMgr_fmIncr_mp={&fileMgr_fmIncr_mp_minfoRow, {
0x85, 0x02, 0x83, 0x43},
};
#endif
#define fmIncr_somMethodInfoValue 0
#define fmIncr_somApplyStubValue &fileMgr_fmIncr_mp.csr
#define fmIncr_somHasMPlan 8

/*
 * New Method: fmAdd
 */
SOM_Scope long  SOMLINK fmAdd(fileMgr somSelf,
		long oldNum,
		long addNum);
#ifndef somId_fmAdd
#define somId_fmAdd ((somId)&(__somC_fileMgr_regIdsArray[__somC_fileMgr_regIds_fmAdd]))
#endif
#define SOM_MPR_MINFO_fmAdd {0, 12, 0}
static somMpRowMethodInfo fileMgr_fmAdd_mp_minfoRow = {{0, SOM_MP_ROWTYPE_METHODINFO}, SOM_MPR_MINFO_fmAdd};
#ifndef DEFINEDfileMgr_fmAdd_mp
#define DEFINEDfileMgr_fmAdd_mp
/*[ ::fileMgr::fmAdd fileMgr_fmAdd_mp ]*/
/* Contract specification:
[CALLTYPE_OIDL (1)][RESULT][VERSION 0]
RESULT[out]: Long
ARG 1[in]: Long
ARG 2[in]: Long
*/
static struct { void * rows; unsigned char csr[8]; } fileMgr_fmAdd_mp={&fileMgr_fmAdd_mp_minfoRow, {
0x85, 0x03, 0x83, 0x43, 0x43},
};
#endif
#define fmAdd_somMethodInfoValue 0
#define fmAdd_somApplyStubValue &fileMgr_fmAdd_mp.csr
#define fmAdd_somHasMPlan 8

/*
 * Functions for attributes.
 */

/*
 * Special Method Support
 */

/*
 * -- Routines and Structures to create the class object
 */
static SOMClass * __somC_fileMgr_parentArray[] = {
	NULL,
};
void * __somC_fileMgr_parentMtabs[1];

somMethodDefn __somC_fileMgr_newNDMethodsArray[] = {
	{  (0 | fmInit_somHasMPlan), 0, (somMToken)0, (somMethodPtr)fmInit, 
	   0, (somMethodPtr)fmInit_somApplyStubValue, 
	   (somMethodInfo *) fmInit_somMethodInfoValue, &fileMgrClassData.fmInit, 0, 1 },
	{  (0 | fmGetChar_somHasMPlan), 0, (somMToken)0, (somMethodPtr)fmGetChar, 
	   0, (somMethodPtr)fmGetChar_somApplyStubValue, 
	   (somMethodInfo *) fmGetChar_somMethodInfoValue, &fileMgrClassData.fmGetChar, 0, 1 },
	{  (0 | fmPeekChar_somHasMPlan), 0, (somMToken)0, (somMethodPtr)fmPeekChar, 
	   0, (somMethodPtr)fmPeekChar_somApplyStubValue, 
	   (somMethodInfo *) fmPeekChar_somMethodInfoValue, &fileMgrClassData.fmPeekChar, 0, 1 },
	{  (0 | fmSize_somHasMPlan), 0, (somMToken)0, (somMethodPtr)fmSize, 
	   0, (somMethodPtr)fmSize_somApplyStubValue, 
	   (somMethodInfo *) fmSize_somMethodInfoValue, &fileMgrClassData.fmSize, 0, 1 },
	{  (0 | fmIncr_somHasMPlan), 0, (somMToken)0, (somMethodPtr)fmIncr, 
	   0, (somMethodPtr)fmIncr_somApplyStubValue, 
	   (somMethodInfo *) fmIncr_somMethodInfoValue, &fileMgrClassData.fmIncr, 0, 1 },
	{  (0 | fmAdd_somHasMPlan), 0, (somMToken)0, (somMethodPtr)fmAdd, 
	   0, (somMethodPtr)fmAdd_somApplyStubValue, 
	   (somMethodInfo *) fmAdd_somMethodInfoValue, &fileMgrClassData.fmAdd, 0, 1 }
};

static somOverrideMethod_t2 __somC_fileMgr_overridesArray[] = {
{ &(__somC_fileMgr_regIdsArray[__somC_fileMgr_regIds_somInit]), 
#ifdef SOMPCALLfileMgr_somInit
   (somMethodPtr*)&fileMgr_pcall_somInit_resolved, 
   (somMethodPtr)fileMgr_pcallResolve_somInit, 
#else
   (somMethodPtr*)0, 
   (somMethodPtr)0, 
#endif
(somMethodPtr)somInit },
{ &(__somC_fileMgr_regIdsArray[__somC_fileMgr_regIds_somUninit]), 
#ifdef SOMPCALLfileMgr_somUninit
   (somMethodPtr*)&fileMgr_pcall_somUninit_resolved, 
   (somMethodPtr)fileMgr_pcallResolve_somUninit, 
#else
   (somMethodPtr*)0, 
   (somMethodPtr)0, 
#endif
(somMethodPtr)somUninit },
{ &(__somC_fileMgr_regIdsArray[__somC_fileMgr_regIds_somDumpSelfInt]), 
#ifdef SOMPCALLfileMgr_somDumpSelfInt
   (somMethodPtr*)&fileMgr_pcall_somDumpSelfInt_resolved, 
   (somMethodPtr)fileMgr_pcallResolve_somDumpSelfInt, 
#else
   (somMethodPtr*)0, 
   (somMethodPtr)0, 
#endif
(somMethodPtr)somDumpSelfInt }
};

static somClassVars1 __somC_fileMgr_classVars1 = {
	1,		/* layoutVersion */
	(void *)NULL,	/* extension */
	sizeof(fileMgrData),	/* dataSize */
	4,		/* type code dataAlignment */
	(somMethodPtr)0,	/* classAllocate */
	(somMethodPtr)0	/* classDeallocate */
};

static struct fileMgrClassDataStructure __somC_fileMgr_resolvedMTokens;

static void * __somC_fileMgr_CIB_unsharedClassVariablesPtr = 0;
som3ClassInfoStruct __somC_fileMgr_ClassInfo; /* C forward reference */

SOM_CIB fileMgr_ClassInitBlock = {
	1,	/* layoutVersion */
	&__somC_fileMgr_classVars1,
	&__somC_fileMgr_CIB_unsharedClassVariablesPtr,	/* unsharedVars */
	fileMgr_MajorVersion,
	fileMgr_MinorVersion,
	0x40004,	/* constFlags */
	0xFFFFFFFF,	/* inheritVars */
	0,	/* classMeta */
	(somMethodPtr) __somC_fileMgr_classInit,	/* classInit */
	(somMethodPtr) 0,	/* classUninit */
	(somMethodPtr) somInit,	/* legacyInit */
	(somMethodPtr) somUninit,	/* legacyUninit */
	(somMethodPtr) 0,	/* udaAssign */
	(somMethodPtr) 0,	/* udaConstAssign */
	0,	/* protectedDataOffset */
	0,	/* numEmbeddedObjs */
	0,	/* embeddedObjs */
	11,	/* numRegIds */
	__somC_fileMgr_regIdsArray,	/* regIds */
	(sizeof(struct fileMgrClassDataStructure) - sizeof(SOMClass *))/sizeof(somMToken),	/* numClassDataEntries */
	(somClassDataStructurePtr)&fileMgrClassData,
	(somCClassDataStructurePtr)&fileMgrCClassData,
	&__somC_fileMgr_ClassInfo,
	1,	/* numParents */
	(SOMClass**)__somC_fileMgr_parentArray,	/* parents */
	1,	/* numDirectInitClasses */
	(SOMClass**)__somC_fileMgr_parentArray,	/* directInitClasses */
	0,	/* numNewInitializers */
	0,	/* newInitializerSymbols */
	0,	/* numOvInitializers */
	0,	/* ovInitializerSymbols */
	0,	/* special overrides */
	6,	/* maxNDMethods */
	__somC_fileMgr_newNDMethodsArray,	/* newNDMethods */
	3,	/* numOverrides */
	__somC_fileMgr_overridesArray,	/* overrides */
	0,	/* numInheritedSelections */
	0,	/* inheritedSelections */
	0,	/* numMigratedMethods */
	0 	/* migrated methods */
};	/* CIB */

static som3ClassDetails __somC_fileMgr_ClassDetails = {
	(somMethodTabPtr)NULL,	/* mtab */
	(somMethodTabPtr *)__somC_fileMgr_parentMtabs,	/* parentMtabs */
	&fileMgr_ClassInitBlock,	/* CIB pointer */
	(somTD_somRenewNoInitNoZeroThunk)0,	/* somRenewNoInitNoZeroThunk */
	(long)0,	/* instanceSize */
	(somMethodProc**)NULL,	/* resolvedInits */
	(somClassDataStructure *)&__somC_fileMgr_resolvedMTokens,	/* resolvedMTokens */
	{0,0,0,0},	/* initCtrl */
	{0,0,0,0},	/* destructCtrl */
	{0,0,0,0},	/* assignCtrl */
	(long)1,	/* layoutVersion */
	(void*)NULL,	/* extension */
	(somDToken)NULL,	/* publicDataToken */
	(somDToken)NULL,	/* protectedDataToken */
};
som3ClassInfoStruct __somC_fileMgr_ClassInfo = {
	0,	/* classObject */
	&__somC_fileMgr_ClassDetails	/* class details */
};


/*
 * Class Creation and Initialization
 */

#if defined(__IBMC__) && (defined(_WIN32) || defined(__OS2__)) && !defined(SOM_PREWARP)
#pragma alloc_text (SEG0002, __somC_fileMgr_classInit)
#pragma alloc_text (SEG0002, fileMgrNewClass)
#endif

/* classinit function */
SOM_Scope void SOMLINK __somC_fileMgr_classInit(SOMClass somSelf)
{
   SOM_IgnoreWarning(somSelf);
   fileMgr_parent_SOMObject_somDumpSelfInt_resolved = 
	somParentNumResolve(fileMgrCClassData.parentMtab, 1, _SOMMTOKEN_SOMObject(somDumpSelfInt)); 
}

/* NewClass Function */
SOMEXTERN SOMDLLEXPORT SOMClass  SOMLINK fileMgrNewClass (long reqMajorVersion, long reqMinorVersion)
{
   if (_SOMCLASS_fileMgr && _somCheckVersion(_SOMCLASS_fileMgr,reqMajorVersion,reqMinorVersion))
      return _SOMCLASS_fileMgr;
__somC_fileMgr_parentArray[0] = (SOMClass *)&_SOMCLASS_SOMObject;
   /* require parents */
   if (!_SOMCLASS_SOMObject) SOMObjectNewClass(SOMObject_MajorVersion,SOMObject_MinorVersion);
   /* return new class */
   return somBuildClass2( &fileMgr_ClassInitBlock, reqMajorVersion, reqMinorVersion );
}

#endif       /* Primary Implementation Support */
#if defined(__IBMC__) && (__IBMC__ >= 300)
  #pragma info(restore)
#else
  #if defined(__IBMC__)
    #pragma checkout(resume)
  #endif
#endif

#endif       /* SOM_fileMgr_ih */
