Example #1
0
// From tagdefs
char* IDLStruct::MakeStruct(
        vector<IDL_STRUCT_TAG_DEF>& tagdefs,
        IDL_MEMINT len, 
        IDL_VPTR* vptr)
{
    IDL_StructDefPtr defptr = MakeStructDef(tagdefs);
    char* result=MakeStruct(defptr, len, vptr);
    return(result);
}
Example #2
0
// From a taginfo struct
char* IDLStruct::MakeStruct(
        TAG_INFO_STRUCT& taginfo,
        IDL_MEMINT len, 
        IDL_VPTR* vptr)
{
    IDL_StructDefPtr defptr = MakeStructDef(taginfo.stagdefs.tagdefs);
    char* result=MakeStruct(defptr, len, vptr);
    return(result);
}
Example #3
0
// This one takes a vector of numbers matches it up to the tag nums in the 
// structure
char* IDLStruct::MakeSubStruct(
        vector<IDL_MEMINT>& tagnums,
        IDL_MEMINT len,
        IDL_VPTR* vptr)
{
    char* result;

    // Match the requested tag names to the structure tags
    vector<IDL_MEMINT> keeptags;
    if (!MatchTagNums(tagnums, keeptags))
        return(NULL);

    // Info for the substructure
    IDL_STRUCT_TAG_DEF_SAFE ssubtagdefs;
    if (!MakeTagDefs(mStructVptr, tagnums, mTagInfo, ssubtagdefs))
        return(NULL);

    result = MakeStruct(ssubtagdefs.tagdefs, len, vptr);

    return(result);
}
Example #4
0
File: dio.c Project: rolk/ug
int DIO_Init (void)
{
#ifdef __MGIO_USE_IN_UG__

  INT error=0;

  /* path to grid-dirs */
  datapathes_set = 0;
  if (ReadSearchingPaths(DEFAULTSFILENAME,"datapaths")==0)
    datapathes_set = 1;

  /* create struct and fill stringvars */
  if (MakeStruct(":IO")!=0)
  {
    SetHiWrd(error,__LINE__);
    return (error);
  }

#endif

  return (0);
}
Example #5
0
File: initug.c Project: rolk/ug
INT NS_DIM_PREFIX InitUg (int *argcp, char ***argvp)
{
  INT err;
#ifdef Debug
  char buffer[256];
  char debugfilename[NAMESIZE];
#endif

#ifdef ModelP
  /* init ppif module */
  if ((err = InitPPIF (argcp, argvp)) != PPIF_SUCCESS)
  {
    printf ("ERROR in InitParallel while InitPPIF.\n");
    printf ("aborting ug\n");

    return (1);
  }
#endif

  /* init the low module */
  if ((err = InitLow ()) != 0)
  {
    printf
      ("ERROR in InitUg while InitLow (line %d): called routine line %d\n",
      (int) HiWrd (err), (int) LoWrd (err));
    printf ("aborting ug\n");

    return (1);
  }

  /* init parallelization module */
#ifdef ModelP
  PRINTDEBUG (init, 1, ("%d:     InitParallel()...\n", me))
  if ((err = InitParallel (argcp, argvp)) != 0)
  {
    printf
      ("ERROR in InitUg while InitParallel (line %d): called routine line %d\n",
      (int) HiWrd (err), (int) LoWrd (err));
    printf ("aborting ug\n");

    return (1);
  }
#endif

  /* create struct for configuration parameters */
  if (MakeStruct (":conf"))
    return (__LINE__);
  if (SetStringVar ("conf:arch", ARCHNAME))
    return (__LINE__);

  /* set variable for parallel modus */
#ifdef ModelP
  if (SetStringValue ("conf:parallel", 1.0))
    return (__LINE__);
  if (SetStringValue ("conf:procs", (DOUBLE) procs))
    return (__LINE__);
  if (SetStringValue ("conf:me", (DOUBLE) me))
    return (__LINE__);
#else
  if (SetStringValue ("conf:parallel", 0.0))
    return (__LINE__);
  if (SetStringValue ("conf:procs", 1.0))
    return (__LINE__);
  if (SetStringValue ("conf:me", 0.0))
    return (__LINE__);
#endif

  /* init the devices module */
  if ((err = InitDevices (argcp, *argvp)) != 0)
  {
    printf
      ("ERROR in InitUg while InitDevices (line %d): called routine line %d\n",
      (int) HiWrd (err), (int) LoWrd (err));
    printf ("aborting ug\n");

    return (1);
  }

#ifdef Debug
  {
    int i;
    for (i = 1; i < *argcp; i++)
      if (strncmp ((*argvp)[i], "-dbgfile", 8) == 0)
        break;
    if ((i < *argcp)
        && (GetDefaultValue (DEFAULTSFILENAME, UGDEBUGRFILE, buffer) == 0)
        && (sscanf (buffer, " %s ", debugfilename) == 1))
    {
      if (SetPrintDebugToFile (debugfilename) != 0)
      {
        printf ("ERROR while opening debug file '%s'\n", debugfilename);
        printf ("aborting ug\n");
        return (1);
      }
      UserWriteF ("debug info is captured to file '%s'\n", debugfilename);
    }
    else
    {
      SetPrintDebugProc (printf);
      UserWriteF ("debug info is printed to stdout\n");
    }
  }
#endif

  /* init the domain module */
  if ((err = InitDom ()) != 0)
  {
    printf
      ("ERROR in InitDom while InitDom (line %d): called routine line %d\n",
      (int) HiWrd (err), (int) LoWrd (err));
    printf ("aborting ug\n");

    return (1);
  }

  /* init the gm module */
  if ((err = InitGm ()) != 0)
  {
    printf
      ("ERROR in InitUg while InitGm (line %d): called routine line %d\n",
      (int) HiWrd (err), (int) LoWrd (err));
    printf ("aborting ug\n");

    return (1);
  }

  /* init the numerics module */
  if ((err = InitNumerics ()) != 0)
  {
    printf
      ("ERROR in InitUg while InitNumerics (line %d): called routine line %d\n",
      (int) HiWrd (err), (int) LoWrd (err));
    printf ("aborting ug\n");

    return (1);
  }

  /* init the ui module */
  if ((err = InitUi (argcp[0], argvp[0])) != 0)
  {
    printf
      ("ERROR in InitUg while InitUi (line %d): called routine line %d\n",
      (int) HiWrd (err), (int) LoWrd (err));
    printf ("aborting ug\n");

    return (1);
  }

  /* init the graphics module */
  if ((err = InitGraphics ()) != 0)
  {
    printf
      ("ERROR in InitUg while InitGraphics (line %d): called routine line %d\n",
      (int) HiWrd (err), (int) LoWrd (err));
    printf ("aborting ug\n");

    return (1);
  }

  return (0);
}