Menu

ChLibAlias

api (7)
AntifreeZZe

What is ChLibAlias (ChLA) ?

It is simple API to load system libraries without writing their full paths. It always located in /lib and always ready for use.

API

AddLibForOneTime(n,l)

Function that allows you to add your lib alias that will work until the system is rebooted. <n> is the name of alias. <l> is a table with lib info, e.g. {ild=true,path="somelib"} (<ild> is bool. If true, it tell that your library is located in /lib. In that example, the full path of library is /lib/somelib.)

getLib(n)

Returns full path of library <n>.

loadLib(n)

Loads library <n>.

tLibs [table]

Table of aliases

How to load ChLA?

If ChLA is not loaded yet, you have to use

os.loadAPI("/lib/chla")

If ChLA is loaded, you are ready for using it.

How to load System Library?

First(native) way

os.loadAPI("path/to/lib")

This is most obvious way that doesn't need ChLA to be loaded.

Second way

os.loadAPI(chla.getLib("lib"))

This way needs ChLA to be loaded.

Third way

chla.loadLib("lib")

This way needs ChLA to be loaded.


Related

Wiki: Home

MongoDB Logo MongoDB