Add functions to work with System.env #214

Open
opened 2025-04-15 20:02:05 +02:00 by Doczom · 3 comments
Owner

When writing an application, it became necessary to use environment variables. The necessary functions are missing from the files used for the TCC compiler.

Describe the solution you would like

Functions in libc.obj includes for work with System.env

For example:

int __stdcall get_env(const char* key, char* buff, size_t len);
int __stdcall get_env_info(const char* key, const uint32_t* len_data);
int __stdcall set_env(const char* key, char* buff, size_t len);

Describe alternatives you've considered


Additional context

This is necessary to load the configuration of the "Table" program

### Please describe if your feature request is related to a problem. When writing an application, it became necessary to use environment variables. The necessary functions are missing from the files used for the TCC compiler. ### Describe the solution you would like Functions in libc.obj includes for work with System.env For example: ``` int __stdcall get_env(const char* key, char* buff, size_t len); int __stdcall get_env_info(const char* key, const uint32_t* len_data); int __stdcall set_env(const char* key, char* buff, size_t len); ``` ### Describe alternatives you've considered --- ### Additional context This is necessary to load the configuration of the "Table" program
Owner

I understand and agree that KolibriOS is missing proper support for environment variables. That said, why can't Table load its configuration? Many programs in KolibriOS read their config files at the moment. What is the exact issue with Table?

I understand and agree that KolibriOS is missing proper support for environment variables. That said, why can't Table load its configuration? Many programs in KolibriOS read their config files at the moment. What is the exact issue with Table?
Author
Owner

I understand and agree that KolibriOS is missing proper support for environment variables. That said, why can't Table load its configuration? Many programs in KolibriOS read their config files at the moment. What is the exact issue with Table?

Данное приложение имеет 3 варианта загрузки конфигурации: явное указание файла конфига, неявное через переменные окружения и загрузка стандартного файла со статическим адресом. Неявное указание конфигурации не может быть выполнено, так как нет необходимых функций по работе с переменными окружения.

Описание возможных вариантов загрузки https://git.kolibrios.org/Doczom/Table/src/branch/main/TABLE.INI#L30

Программа Table приведена как пример программы, где наличие такого API необходимо для реализации функционала

> I understand and agree that KolibriOS is missing proper support for environment variables. That said, why can't Table load its configuration? Many programs in KolibriOS read their config files at the moment. What is the exact issue with Table? Данное приложение имеет 3 варианта загрузки конфигурации: явное указание файла конфига, неявное через переменные окружения и загрузка стандартного файла со статическим адресом. Неявное указание конфигурации не может быть выполнено, так как нет необходимых функций по работе с переменными окружения. Описание возможных вариантов загрузки https://git.kolibrios.org/Doczom/Table/src/branch/main/TABLE.INI#L30 Программа Table приведена как пример программы, где наличие такого API необходимо для реализации функционала
Member

Auto translate:

This application has 3 options for loading the configuration: explicitly specifying the config file, implicitly via environment variables, and loading a standard file with a static address. Implicitly specifying the configuration cannot be performed, since there are no necessary functions for working with environment variables.

Description of possible loading options https://git.kolibrios.org/Doczom/Table/src/branch/main/TABLE.INI#L30

The Table program is given as an example of a program where the presence of such an API is necessary for implementing the functionality

Auto translate: > This application has 3 options for loading the configuration: explicitly specifying the config file, implicitly via environment variables, and loading a standard file with a static address. Implicitly specifying the configuration cannot be performed, since there are no necessary functions for working with environment variables. > > Description of possible loading options https://git.kolibrios.org/Doczom/Table/src/branch/main/TABLE.INI#L30 > > The Table program is given as an example of a program where the presence of such an API is necessary for implementing the functionality
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KolibriOS/kolibrios#214
No description provided.