Constants

Many constants defined in saf.h have similar limitations to some C programming language constants such as ‘stderr’ and ‘stdout’. If you have a file-scope static variable initialized to stderr or stdout, you will find that your variable gets initialized with garbage. In C, the reason is that these constants don’t really get defined until run-time and when you initialize a file-scope static, you are relying upon it having been defined at compile time.

The same is true for many of SAF’s constants. Therefore, you should take care not to use them in a manner which assumes they are defined at compile time. We have made an effort to denote all such constants in the reference manual so that you can easily determine for which constants this is true.

Some constants require a database argument. This means the constant is not defined except within the scope of an open database. Thus, these constants are even more restricted in use than those that can be used at any run-time.

In summary, there are three classes of constants. Compile-time constants can be used anywhere. Run-time constants can be used only after the code has begun executing. Database-time constants can be used only after a database has been opened.