Using Tools > Working with User Code > User Function Interface Reference (C) > Template Library Registration Function uclib (C)

Your Ad Here




Template Library Registration Function uclib (C)

Each user function in the library should be registered with calls to ucfunc and ucarg in uclib, as shown in the examples. The template uclib is:

#include "uclib.h"

void uclib()

{

/* Register user functions here */

}

The header file uclib.h should be created in the same directory as uclib.c to declare the functions used in uclib:

  #ifndef UCLIB_H
  #define UCLIB_H
  #include "Real.h"
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  #if defined(WIN32) || defined(_WINDOWS) || defined(_WINNT)
  # define USERFUNCTION_EXPORT __declspec(dllexport)
  # define USERFUNCTION_IMPORT __declspec(dllimport)
  #else
  # define USERFUNCTION_EXPORT
  # define USERFUNCTION_IMPORT
  #endif
  
  extern void USERFUNCTION_IMPORT ucarg(void *, char *, char *, int);
  extern void USERFUNCTION_IMPORT ucfunc(void *, char *, char *);
  extern void USERFUNCTION_IMPORT ucfunction(void *, char *, char *, int, ...);
  
  void USERFUNCTION_EXPORT uclib();
  #ifdef __cplusplus
  }
  #endif
  #endif

Return to CD-adapco STAR-CCM+ Index


Your Ad Here