Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*max@home*/
Toshihiro Shimizu 890ddd
#include "twain.h"
Toshihiro Shimizu 890ddd
#include "ttwain_state.h"
Toshihiro Shimizu 890ddd
#include "ttwainP.h"
Toshihiro Shimizu 890ddd
#include "ttwain_statePD.h"
Toshihiro Shimizu 890ddd
#include "ttwain_util.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifdef __cplusplus
Toshihiro Shimizu 890ddd
extern "C" {
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
extern void TTWAIN_SetState(TWAINSTATE status);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
int TTWAIN_LoadSourceManagerPD(void) {
Shinya Kitaoka 120a6e
  if (TTWAIN_GetState() >= TWAIN_SM_LOADED)
Shinya Kitaoka 120a6e
    return TRUE; /* DSM already loaded */
Shinya Kitaoka 120a6e
  TTwainData.DSM_Entry = DSM_Entry;
Shinya Kitaoka 120a6e
  if (TTwainData.DSM_Entry != 0 /*kUnresolveCFragSymbolAddress*/) {
Shinya Kitaoka 120a6e
    TTWAIN_SetAvailable(AVAIABLE_YES);
Shinya Kitaoka 120a6e
    TTWAIN_SetState(TWAIN_SM_LOADED);
Shinya Kitaoka 120a6e
  } else {
Shinya Kitaoka 120a6e
    printf("DSM Entry NOT found !\n");
Shinya Kitaoka 120a6e
    return FALSE;
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  return (TTWAIN_GetState() >= TWAIN_SM_LOADED);
Toshihiro Shimizu 890ddd
}
Shinya Kitaoka 120a6e
int TTWAIN_UnloadSourceManagerPD(void) {
Shinya Kitaoka 120a6e
  if (TTWAIN_GetState() == TWAIN_SM_LOADED) {
Shinya Kitaoka 120a6e
    TTwainData.DSM_Entry = 0;
Shinya Kitaoka 120a6e
    TTWAIN_SetState(TWAIN_PRESESSION);
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
  return (TTWAIN_GetState() == TWAIN_PRESESSION);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*-----------------------------------------------------------------------------*/
Toshihiro Shimizu 890ddd
#ifdef __cplusplus
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
#endif