Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How is the directory of the predefined include libraries determined?

0
Posted

How is the directory of the predefined include libraries determined?

0

The directory of the predefined include libraries is hardcoded in the interpreter. This information is determined when the Seed7 interpreter is compiled. The command ‘make depend’ writes a line, which defines the C preprocessor variable SEED7_LIBRARY, to the file “seed7/src/version.h”. E.g.: The file “version.h” contains the line: #define SEED7_LIBRARY “/home/abc/seed7_5/lib” The preprocessor macro SEED7_LIBRARY is used by the function init_lib_path() which is defined in “seed7/src/infile.c”. The statements handling the predefined include library directory start after the line #ifdef SEED7_LIBRARY The C string from SEED7_LIBRARY is converted to a Seed7 string with cstri_to_stri(). The function stri_to_path() converts the string to the standard path representation of Seed7. Finally the path is appended to the library search list (lib_path) with: append_to_lib_path(path, err_info) Interpreter and compiler use the same strategy to determine the directory with predefined include libraries.

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123