Menu
Is free
check in
the main  /  Programs / What configuration file. Configuration files

What configuration file. Configuration files

The Linux operating system unlike Windows does not have a common registry for storing the system settings, all settings are stored in configuration files. Most of these files are posted in the / etc / folder.

Settings of most system and third-party programs are in these files, it can be settings for a graphics server, login manager, system services, web server, initialization systems.

Only part of the configuration files are located in other folders, such as the work environment setting files in the user's home directory. The beginners are very important to understand that they are responsible for those or other configuration files so that if necessary, it is very quick to navigate. In this article, we will look at the main configuration files of Linux, their location and purpose.

In fact, there are no configuration files in the Linux system itself. Since the operating system is just a set of programs and a kernel, all these files were created by certain programs and are read by them to configure behavior. Most files that we used to consider standard are the initialization system or other system utilities.

As I said, most files are posted in / etc. The name of this folder is decrypted as "Et Cetera", which from Latin means "and others" or "and so on." First, let's see the contents of the / etc linux directory:

There are many different files here. Then we will consider the appointment of many of them. The list is sorted by alphabet.

1. / etc / adjtime

This configuration file is responsible for setting up system time format and read by the SystemD-Timedated service. Time can be represented in two options: Local - the time of the current time zone and UTC - the time of Greenwich. You can manually change the value or use the TIMEDATECTL utility.

2. /etc/bash.bashrc.

This file belongs to the bash command shell. This is not a completely configuration file - and the script, its contents is performed when the Bash instance is started to adjust the shell. Similarly, the contents of the file ~ / .bashrc for each user.

3. / etc / crontab

6. / ETC / GROUP

25. / etc / sudoers

/ etc / sudoers is a setup file. This utility allows you to execute commands on behalf of other users, including on behalf of the superuser. But only those users who are spelled out in this file can use it.

26. /etc/sysctl.conf.

This file is responsible for execution. Here you can specify all the parameters from the subsystem / SYS / and they will be saved after rebooting.

27. /etc/vconsole.conf.

This file has only one goal - set the encoding, keyboard layout and default font for all virtual consoles running by machine.

28. /Boot/Grub/Grub.cfg.

This Linux configuration file is not in / etc due to its special purpose. It contains all the bootloader settings, menu items and other parameters, so it must be accessible before the root file system was connected.

conclusions

In this article, we reviewed the main Linux configuration files that are in the / etc / folder. Perhaps any important files, in your opinion, are missed, then you will definitely tell about them and their purpose in the comments!

Task profile using the command line - the method is far from always convenient. Even when working with the most command line, the environment is used to save the settings to not specify them every time and for any team. What to talk about complex system services whose properties should be saved not from a session to a session, but constantly (including when rebooting the system). The output is simple: the profile must be kept in the file, such as what is created by the "Save Settings" command.

However, the approach to the storage of the profile in the file, in which the user cannot change this file is directly, but uses "smart" configurators, it is convenient only in cases where the settings are many, and the cost of error is small (for example, when setting up the appearance of the desktop). In general, it is quite difficult to set behavior systems based on the description (frequently implicit) properties of the fact that this system should receive as a result. In other words, from the description of what should happen, it is not always possible to automatically conclude how it must be obtained.

Configuration file.. A text file containing the settings of some part of the system (utility, demon, etc.). As a rule, it is read by it when starting. Typical for Linux method of organizing profile.

In short, if there is configuration file., There must be the editing tools for this file. Considering that a highly developed storage system is implemented in Linux processing (both manual and automatic) data in text form, to invent some kind of new format is like to reinvent the bike. Moreover, it is the text that divided into strings and words is best suited when there is a clear division of the profile on control objects and their properties (for example, the settings of some daemon and the values \u200b\u200bof these settings). In addition, Linux text editors are canceled with the structured texts: vi, Emacs, etc.

[Email Protected]: ~ $ cat .vimrc SO $ vimruntime / vimrc_example.vim "Some Mappings Map: Wall! ^ M Map! ^ o: Wall! ^ M" Tune Up Set ShiftWidth \u003d 2 Tabstop \u003d 8 History \u003d 200 Viminfo \u003d "50 Set Showmode ShowMatch Showcmd Ruler Modeline Set Autoindent Ignorecast SmartCase Set Nohlsearch NoincSearch Set Dir \u003d / Var / TMP SET Wildmode \u003d List: Longest, Full Set Wildmenu "Coloring Syntax On Colorscheme Desert Example 12.2. Settings Editor Vim.

That's what looks like configuration file. For VIM, written by Methodius on the basis of the file taken from Gurevich. It is easy to notice that the file consists of command line commands VI command line with comments (unlike most Linux utilities, in VI comments begin on ""). Symbols "^ o" and "^ M" - this is the corresponding control characters (inserted in a text file using "^ V", see lecture 9). Such configuration file. Easy to understand and change.

As already seen, the set of environment variables is a special profile to which all the launched programs are sensitive - this is its dignity. Surrounding variables are specified in the command script, which can also be considered as configuration file.). For example, in many distributions used configuration file. .i18n To configure keyboard language characteristics, message output language, etc. 2 The designation "I18N" comes from the word "INTERNATIONALIZATION", in which 20 letters, i.e. "i", "n" and 18 letters between them. :

[Email Protected]: ~ $ cat .i18n lang \u003d ru_en.koi8-r Language \u003d ru_en.koi8-r sysfontacm \u003d koi8-r sysfontacm \u003d koi8-r sysfont \u003d unicyr_8x16 dictionary \u003d russian mpage \u003d "- CKOI8-R" Export Dictionary MPAGE Example 12.3. Language feature configuration file

However, to store the settings of a specific program (not needed by everything else) surrounded - not the most successful solution: syntax that specifies the environment variable, too simple ( present_name \u003d value), and the variables themselves becomes too much, so when viewing it is difficult to select which one to which group settings are. If you try to pack all settings to the value one variable, this value will be difficult, and all the advantage of a text format will come to no. For example, standard configuration file. LS utilities (more precisely, only its color preferences) - / etc / dir_colors (it can be replaced with a personal file ~ / .dir_colors) takes about a hundred lines along with comments. The LS command uses not this file, but the Dircolors utility being created by the variable ls_colors, the value of which is the 600-character string without any comments.

If the profile is too big, keep it in one configuration file - So, to deliver the user a dubious pleasure to disassemble this file entirely, if necessary, make a minimum change. Methods of combating uncomfortable somewhat. In particular, the ".d" mechanism already known on the lecture: the file is divided into several independent Files from each other so that it is only one of the files to edit, and the program reads everything during self-use.

Another way relies on what changeThat the user contributes to the profile, as a rule, significantly less than the volume of the entire profile. Therefore, it can be advantageous to store all default settings in some file, which is not necessary at all, and the user settings file use as it were "on top", changing the profile according to them after how the default profile is set. An additional advantage of this method is that the user can always be brought to the "big" file to find out how this or another setting is made. For example, the UPDFSTAB utility that changes the contents / etc / fstab when or deleting a removable disk carrier (for example, a laser disk), reads data from configuration file /etc/updfstab.conf. This file itself consists of the singular line: include /etc/updfstab.conf.default.What leads to the reading file with default settings, where a way to work with many removable system devices is set. If the administrator needs to somehow change the UPDFSTAB behavior with respect to a specific device, it copies the corresponding group of settings from Updfstab.conf.Default in Updfstab.conf after Strits include include .. And corrects them. The fact that these settings groups are read twice, does not play a special role: reading short files is performed quickly.

Finally, the third way to do configuration file. readable - partitioning Profile when all settings are broken into groups, each group is given its own name, and syntax configuration file It is designed so that the boundaries of the groups differ well when viewing. In essence, this method is the ancestor of the ".d" schema, where the group corresponds to a separate file, but the situation is not uncomfortable when the files are inconvenient (for example, if the groups are not fully independent, therefore it may be necessary to edit them at once). Configuration file. WVDIAL dial utilities, for example, partitioned by addressee (provider) plus a separate section "Default". Sections themselves are separated from each other headlines enclosed in square brackets:

[Email Protected]: ~\u003e cat .wvdialrc modem \u003d / dev / modem baud \u003d 115200 init1 \u003d atz init2 \u003d atq0 L0 M4 V1 E1 S0 \u003d 0 & C1 & D2 + FCLASS \u003d 0 & C1 & D2 + FCLASS \u003d 0 AUTO DNS \u003d ON MODEM TYPE \u003d ANALOG MODEM PHONE \u003d 0123456 USERNAME \u003d Fireman Password \u003d Fire! Fire! Tonline \u003d True Phone \u003d 0246813 USERNAME \u003d COP-120 PASSWORD \u003d GIMMETHEGUN FORCE ADDRESS \u003d 10.0.0.120 Example 12.4. Partitioned configuration file

The WVDIAL utility has a highly developed artificial intelligence: it deigns independently, which type of identification is used on the server. For example, "from the other side" may be the Linux terminal, which is required to first enter an ordinary input name and password, then you need to get a command line, run on server Network demon pPPD.And only after that run PPPD on your own machine. Another variant: pPPD. The server is already running, and the "UserName" and "Password" settings mean the identification information of the CHAP protocol used pPPD.. All this and many WVDIAL is able to guess, as well as WVDialConf knew how to determine which device is a modem.

However, on any artificial intelligence there is an incomprehensible life situation. On one of the servers ("DIALER HotSpace" section) also There is a program with the incarnations of artificial intelligence, which also Trying to determine what way I want to identify that called. Because these two cockpit, conclosed, everyone is waiting for anyone, while someone does not show themselves ... Helps tonline configuration, which causes WVDIAL to immediately use the PPP protocol, to which the server, thinking "Ah, PPP!", Launches with relief pPPD.. The question remains: why this useful tuning is not reflected in the documentation (I found it in the source texts of the program Gurevich)? Is it because the WVDialConf-Wvdial pair does not seem to do everything for the user, but it became, the user documentation for the developers of this program is not important?

The default settings idea can be developed. It turns out that it is convenient when the setup description is not placed in the manual, but directly in configuration file. in the form of comments. Then, when changing this setting, the user immediately sees that it represents, while it disappears the need to first find a line in the file, and then look for it in the manual. Such a common way of registration is called self-documenting Profile. For example, the /etc/man.conf file, managing the work of the MAN command, is decorated in a modified style:

[Email Protected]: ~ $ Cat /etc/man.conf. . . # Nocache Keeps Man from Creating Cache Pages ("Cat Pages") # (Generally One Enables / Disable Cat Page Creation by # Creating / Deleting The Directory Thewood Mkdir) # # Nocache # The Command "man -a Xyzzy "Will Show All Man Pages for Xyzzy. # WHEN CMP IS Defined Man Will Try to Avoid Showing The Same # Text Twice. (But Compressed Pages Compare Unequal.) # CMP / USR / BIN / CMP -S. . . Example 12.5. Self-documenting configuration file

Methodius, maybe I would not immediately understand, why the MAN command to use the CMP utility, however, in the explanatory comments, it is written: when you need to show several manuals at once, they are pre-compared, and only inconsistent are shown.

If you go even further, you can create several different files with examples of settings so that the user can take one of them and bring to the state of them. It is such a thing - a demonstration - configuration of the Methodius and turned on as default settings to your .Vimrc (in the first line). By the way, in fact, the vim profile is quite complicated, but most of its default settings are located in various directory files / usr / Share / vim. - The shape ".d / .d" scheme, where the profile files corresponding to the settings subgroups are in subdirectories corresponding to groups. The inclusion of a specific configuration file can occur implicitly: for example, the line Colorscheme Desert from .vimrc leads to reading / usr / Share / vim / Colors / Desert. Vim..

Configuration files may have a fairly intricate syntax if comply with complex data structures (such, for example, configuring IRC client IRSSI) or contain additional funds self-documenting (For example, the Lynx text www-browser text setup file is not just well documented, but also marked the same tools that are used in the browser itself to represent HTML).

Configuration file.

Configuration file.

The configuration file is a file that describes:
- structure of the software system; and / or
- Auxiliary parameters defining its specific setting.
Usually the configuration file is implemented as a text file, which is interpreted by the software system.

See also: Files

Financial Dictionary Finams.


Watch what is a "configuration file" in other dictionaries:

    configuration file. - binary or text file containing information that determines the behavior of the application, computer or network device. Networks Network Computing En Configuration File ... Technical translator directory

    Or a configuration file is used to store computer program settings, including operating systems. As a rule, configuration files have a text format and can be read and edited by the user of the program. ... ... Wikipedia

    The configuration file or configuration file is used to store computer program settings, including operating systems. As a rule, configuration files have a text format and can be read and edited ... ... Wikipedia

    Type File System, Encryption Developer Valient Gough Operating System Linux, FreeBSD, Mac OS Latest Version 1.7.4 (September 5, 2010) License G ... Wikipedia

    Server statistics page ... Wikipedia

    This article or section needs recycling. Please improve the article in accordance with the writing rules of articles. Descriptor ... Wikipedia

    Btrieve software product (DBMS), to organize transactional (or "navigation") databases. Based on the ISAM data organization method, which provides high search and data extraction speed. There were several versions ... ... Wikipedia

    Opera Browser Screenshot Opera 9.6 Browser Type Developer Opera Software ASA written on ... Wikipedia

    This term also has other values, see PHP (values). PHP semantics: multiparadigre ... Wikipedia

BB Rpmoshn Urreulpn Bthyfelfhtop-ibdleyounds Rbtbneftpch Huftspufch PVTBFYFUESH L ZBKMH NOTES H FPN Tse Lbfbmza, YuFP I Generic. Btyfelfhtop Oebchilights RBTBneples Obphdsfus H / USR / SRC / SYS / CONF / NOTES.

dytelfychb Include UFBMB DPUFHROPK DMS Yurpmshppchwis h Lpbyzchtbgypo-zbkmbby. RPCHPMSEF CHLMAYUBFSH H FELHEYK LPZHTBGYPOSTEP ZBKM UPTAYNPE DTHZPZP ZBKKMB, Hairdryer Ubnshchenn Horthpebs RTPGUUU SHEYUEYAS OEEVPMSHYY YYNEYUKEYAK HT UHWEYUFCHHEYK ZHBKM. Ottinet, Eumy Chbn Opepvipdinp DPVBchyfs Chuzp Oletulpmshlp DPRPMAFEMFEMFEEMSKI PRGYK YMY DTBCHTPH H SDTP GENERIC, FP Chbn RTidadfus Rapdabychbfsh FPMSLP TBYEGH L ZHBKMH GENERIC:

Include Generic Ident Mykernel Options Ipfirewall Options DummyNet Options ipfirewall_default_to_accept Options iPdivert

vPMShOFFCHP BDNYUYUFTBFTPH PHEOSF ъBYUUFEMFEMCHOSKE URPUPVPN - OBRYUBOYEN LPZHTBGYPOPZP ZBKMB UHHSS \u003e\u003e: ChbmizhtbgyPoshk ZBKM VKHDAF PFPVTBFSBF FPMSLP YENICOYYAYS PFPUIFEMSHOP GENERIC. BPUME PVOPCHMEYK YUPDDOPPP LPDB, NDPCPUFUFY ZHHLHHYPOVOSCHOSCHOP, RSSchycheus h GENERIC, VHDHF DPVBCHMESH Ч ЧЧ Блый ХП ХФ ДП ДХЧТБГА, EMUY FPMSLP OE RTRSFUFCHPHBFSHPNH Dytelfucks Nooptions yy nodevice. DBME HFPN TBIDEME PRIESCHBEFUS FIRPCHPK LPZHTBHTBGEPOSHK ZBKM, OZP PRGYY HUFPKUFCHB, B FBLTER YI TPMY.

rTYNYUBYA:

dMS OHPTLY SDTB UP CHENY CPNPSSHOP PRGSNY (PVSHUOP YURPMSHEFUS DMS FEUFTPECHS), CHSCHPMEF PF Inea Uphrpmshpchbfems (root) Umvedhaech Lfbodh:

# CD / USR / SRC / SYS / i386./ CONF && Make Lint

lFP RTYNET LPZHTBGYPOPSP ZBKMB SDTB GENERIC at TBMIOSPY DPRMOFMFEMSKNY LPNNEFBTYSNY, LPFPTCTP NPZHF Rpobdpvyfsus DMS Suopugy. LFPF RTynet DPMTSEO Upgrbdbfs in Chbehak Lprikek h / usr / src / sys / i386./ CONF / GENERIC RTBLFYYUELE RPMOPUFSH.

Machine i386.

bFP Bintifelf chopstick. CIS DPMTSOB VSSFS PDOPK YEADKHEY: AMD64, I386, IA64, PC98, PowerPC, YM SPARC64.

CPU i486_CPU CPU i586_CPU CPU i686_CPU

lFB PRGS HLBSCHBEF FIR RTPGUUUPTB, LPFTSCHK Yurpmshhefus H Chbekhek Uyufen. h LPOZHYZHTBGYPOOPN ZHBKME NPTSEF VSCHFSH OEULPMSHLP CHIPTSDEOYK PRGYY FPK (OBRTYNET, EUMY BL OE HCHETEOSCH, LBLPK dv FYRPCH RTPGEUUPTB OEPVIPDYNP YURPMSHPCHBFSH - I586_CPU YMY I686_CPU), OP LCA UPVUFCHEOOPZP SDTB MHYUYE HLBSCHCHBFSH FPMSHLP FPF FYR RTPGEUUPTB, LPFPTSCHK HUFBOPCHMEO H CHBYEK UYUFENE. Eumy Church Hetekets, LBPK FIR OPVIPDINP YURPMSHPCHBFSH ChbN, CHIST NPSEFE ChPURPMSHPCHBFSHUS ZhBKMPN /Var/run/dmesg.Boot, Üfpvysch Hatchfsh RTPFPLPM Бабзтхлю уйфенст.

IDENT GENERIC.

lFPF RBTBNEFT Preddemsef Neflch \u003e\u003e SDTB. Opepvipdinp, UFPVCH Uppüchfüchpchbmbmbb Combagging LPGKMB LPOZHTBGY SDTB, Ottinet Mykernel. , EMUM CHRC UFTPCHBMY YOFTHLGYSN H RT'Stshdheia Rtynetby. OBYuEOYE, LPFPTPE BL RTYUCHPYFE RBTBNEFTH ident VHDEF CHSCHCHPDYFSHUS H RTPGEUUE BZTHLY, RPFPNH RPMEOP DBCHBFSH OPCHSCHN SDTBN DTHZYE YNEOB FPZP LCA, the PD YUFPVSCH PFMYYUBFSH YEE PVSCHYUOPZP SDTB (OBRTYNET, EUMY BL IPFYFE UPVTBFSH LURETYNEOFBMSHOPE RAS).

#To Statically Compile in Device Wiring Instad of /Boot/Device.hints #hints "Generic.hints" # Default Places to Look for Devices. Options Schedu_ule # Ule Scheduler

rMBYTPCHEL RP HNPMYUBA PE FreeBSD. PUFBCHF IFK PRGA.

Options Preemption # Enable Kernel Thread Preemption

rPCHPMSF ChistripThyptypefectural OIFSN SDTB CHSChPHEOSFSFCHTEOOFRPH, Obihydsayius h Tserin Khschpmois. BFB PRGS NPCCF TBLFYUFSUFS UJFENSKU PPP PFAKAYA LI CHEYYOIN CHPADEKUFCHYSN, OPPETNET, BBB UUFEF OUTCOOKS MBFOFOPUFY OUFEK, PVTBVBFSHCHBEI RTTTTSCHCHUKS.

Options inet # internetworking

rapdabyzlb Uphonchi ChPNPCopouffek. PUFBCHFA OPH PRGA CHLMAYUOOPK, DBCE EMUY CHIST OE RBSUTFE RPDLMAYUBFSHUS L UEFY. VPMShOFCHP RTPZTBNN FTEVHAF, IPFS TBVPFBM IPFS VSHN YOPETHEKUK PVTBFOPK Academy (LOOPBACK) (F.E. Uphtheck Upheck Updaeoye Chokhft Chchezp RL), FBL YUFP BFB PRGS H RTyogire Schamsefus PVSBFEMSHOPK.

Options inet6 # IPv6 Communications Protocols

cHLMAYUBEF RPDBETSLH LDNNHYLBGYPOOBYA IPv6 RTPFPLPMPMP.

Options FFS # Berkeley Fast FileSystem

cHLMAYUBEF RPDDezlch Poopchopk ZBBMPC Uyufenz. OE HDBMSKFE IFH PRGA, EMUY CHIST RambiThef Obbztchsbfsus in Zeuflpzp Dyoleb.

Options SoftUpdates # Enable FFS Soft Updates Support

lFPF RBTBNFFF CHLMAYUBEF H SDTE FAYOPMPZYA SOFT UPDATES, LPFPTBS RPCHESTBEF ULPTPUFSH OBBRYUY ABOUT DYULY. OEUNPFTS ON FP, YuFP BFB FEOPMPGZISES CHLMAYEOB H SDTHE, SCC DMPSOB VSSFSH CHLMAYEOB DMS PFDEXSKETS DYULPH. RTPUNPFFFE CHISPPD LPNBodshchy Sophpwesch PoddenimiFs, Chlmayuz Wesel Soft Updates DMS DYULPH ChBeshek Uyufenz. EMUM CHISTER HHIDEF RBTBNEST SOFT-UPDATES, CHBN VKHDEF OPVIPDINP BLFYCHYTPCHBFS HTZP RTY RPNPEY LPNBODCH (DMS ULEUFCHHEI ZBKMPCHSI UYUFEN) YMY LPNBodshchi (DMS and LDC).

Options UFS_ACL # Support for Access Control Lists

lFPF RBTBNEFT CHLMAYUBEF H SDTE RPDDezlch Urreulpch Horthbchmeoise DPUFHRPN (ACL). PUPPCHCHBEFUS ABOUT YURPMSHAPHBEY TBUTEOPEOPHESHIE BFFMSHOP, PRIUBOYE CHIST UNPSEFE OBKFY H TBDEMљ14.12,\u003e. ACL CHLMAYUEOSCH RP HNPMYUBOYA TH OE DPMTSOSCH CHSCHLMAYUBFSHUS B UMHYUBE, EUMY Sing TBOEE YURPMSHPCHBMYUSH ON ZHBKMPCHPK UYUFENE, FBL LBL FP HDBMYF URYULY HRTBCHMEOYS DPUFHRPN J YNEOYF AF LBL BEYEEOSCH ZHBKMSCH, OERTEDULBHENSCHN PVTBPN.

Options UFS_Dirhash # Improve Performance On Big Directories

bFB PRGS CHLMAYUBEF ZHHOLGYPOBMSHOPUFSHOPH, LPFPTBS RPCHESCHYBEF ULPTPUFSH DYULRCHISCHI PLASTGGYK ON PVMSYY LBFBMBSBI H PVNEO ABOUT YURPMSHAPHBEY DPRPMAFEMSHOPK RBNSFY. DMS VPMShIPZP Utcheb YMY TBVPYEK Ufbogi Telpneeodhefus Pufbchyfs Her Chlmayuoopk, Chchchchchchchayufsh DMS Uyufensh, DMS LPFTPK NME RTYPTFEFOB RBNSFSF, Yuen Ulptpuffs DPUFHRB L DYULBHTB, Optylenet DMS VTBODNBHTB.

Options MD_Root # MD IS A Potential Root Device

lFPF RBTBNext Chlmayubef Rapdabyzlch Yurpmshpchyus Dyoulpch h RBNSFY DMS LPTECK ZBBMPC Uyufenc.

Options NFSClient # Network FileSystem Client Options NFSSERVER # Network Filesystem Server Options NFS_ROOT # NFS USABLE AS /, Requires NFSClient

ufhechbs ZhBKMPCBS Uyufenb. EMUY CHISTER RMBETHEFE NPFYTPCHBFSP TBDEMCH at ZBKMPCPPZP UTUCHB UNIX (R) TCP / IP, CHIST NPSEFA YULMAYUFSH BFPF RBTBNext Ya Lpbyzchtbgjpoppzp ZBKMB SDTB.

Options MSDOSFS # MSDOS FILESSTEM

zBCMPCBS Uyufenb MS-DOS (R). EMUM CHIST OE UPVITBEFEUUSH NPFYTPCHBFS SHPTNBFTPECTS CH DOS TBIDE CSEUFLPZP DYULB H NPNEOPODOPTHEFTHLY, CHIST NPSEFE PROTEPRBOPUP SBLPNNEFYTPCHBFSHPFF RBTBNEFT. OpepvipDeschk NPDHMSH VKHDAF BCHPNBfyueli Obbzthzeo, LPDB Chtchchchchchk TB UNPFYThef TBIDEM DOS, FBL, LBP LFP PREUBOP OTSE. LTPNE FPZP, Blefmühchoshoscope RBlef Rpchpmsef RPMKHYUFSHD DPUFHR L DOS Dyulefbn Vej OpepvipDinpufi NpoFightpchBFSH TBNPFTPCHBFSH (th oe FTEVHEF Obmyius MSDOSFS).

Options CD9660 # ISO 9660 FileSystem

zBBMPCBS Uyufenb ISO 9660 DMS LPNRBF DYULPH. eUMY X CHBU RFU RTYCHPDB CDROM YMY BL VHDEFE MYYSH YTEDLB NPOFYTPCHBFSH LPNRBLF-DYULY have DBOOSCHNY, BLPNNEOFYTHKFE FH UFTPLH, FBL LBL OEPVIPDYNSCHK NPDHMSH VHDEF BZTHTSEO BCHFPNBFYYUEULY RTY RETCHPN NPOFYTPCHBOYY LPNRBLF-DYULB have DBOOSCHNY. DMS Yurpmshpchbuis chchlppychi LPNRBF-DYULPH LFB ZBKMPCS Uyufenb OE RPPTEMHEFUS.

Options Procfs # Process Filesystem (Requires Pseudofs)

zBBKMPCBS Uyufenb RTpgeupch. LFP ChITFHBMSHOBS \u003e\u003e ZhBKMPCHBS Uyufenb NPFUTHENBS C / PROC, LPFPTBS RPCHPMSEF FLBTNESPSAOYSN, LLB CHISTBCHBFSH PBN VMSHPTNBGY P OBBRKHEEOPHEBGY RTPGEUUBI. Yurpmshptoma ProCFS OE FTEVHEFUS, FBL LB LVMShOFFCHP NPOFTHPHTHNOPHPHPHTHPHPHTPSP BDBRFTHBOP DMS TBVPFFS ProCFS: Uyufenb RP KhNPMYUBCH Uyufenh RTpgeupch.

Options Pseudofs # Pseudo-Filesystem Framework

sDTB, LPFPSKHA Yurpmshhef Procfs, DPDCSP FBLTCE CHLMAYUBFSH RPDBETSLKH PSEUDOFS,

Options geom_part_gpt # guid partition tables. # PCI Ethernet NICS. Device De # DEC / Intel DC21X4X (Tulip \u003e\u003e) Device Em # Intel Pro / 1000 Adapter Gigabit Ethernet Card Device IXGB # Intel Pro / 10GBE Ethernet Card Device TXP # 3Com 3CR990 (Typhoon \u003e\u003e) Device VX # 3COM 3C590, 3C595 ( Vortex \u003e\u003e)

dBCCHEB Uphonchi LBTF PCI. Blpnneofythkfa YMY HDBMYFE DTBKCHB Fai LBTF, LPFPTESK PUHUFUFCHAF HB Cheek Uyufen.

# PCI Ethernet NICS That Use The Common Mii Bus Controller Code. # Note: Be Sure to Keep The "Device Miibus" Line in Order to Use These NICS! Device Miibus # Mii Bus Support

rapdablb їze-mii FTEvhefus DMS Oelfpfphatshi PCI 10/100 Ethernet LBTF, LPFPTKTCHA Yurpmshaf Mii-Superfined Retheed Blue Yyi Tebmighaf Yofheck Khtbchmeois Retbfühlpn, LPFPTSCHEF IMIFYTCHEF MII. dPVBChMEOYE device miibus B LPOZHYZHTBGYPOOSCHK ZHBKM SDTB CHLMAYUBEF RPDDETTSLH UFBODBTFOPZP API miibus J CHUEI DTBKCHETPCH PHY, CHLMAYUBS UFBODBTFOSCHK LCA FEI PHY, LPFPTSCHE OE PVTBVBFSCHCHBAFUS UREGYZHYYUEULYN PVTBPN LPOLTEFOSCHN DTBKCHETPN.

Device BFE # Broadcom BCM440X 10/100 Ethernet Device BGE # Broadcom BCM570XX Gigabit Ethernet Device DC # Device FXP # Intel EtherExpress Pro / 100B (82557, 82558) Device LGE # LEVEL 1 LXT1001 Gigabit Ethernet Device MSK # Marvell / Syskonnect Yukon II Gigabit Ethernet Device NGE # Natsemi DP83820 Gigabit Ethernet Device PCN # AMD AM79C97X PCI 10/100 (Precedence Over "LNC") Device Re # Realtek 8139c + / 8169 / 8169c / 8110s Device RL # Realtek 8129/8139 Device SF # Adaptec AIC-6915 (Starfire \u003e\u003e) Device Sis # SILICON INTEGRATED SYSTEMS SIS 900 / SIS 7016 Device SK # SYSKONNECT SK-984X\u003e SK-982X GIGABIT Ethernet Device Ste # Sundance ST201 (D-Link DFE-550TX) Device StGe # Sundance / Tamarack TC9021 Gigabit Ethernet Device Ti # Alteon Networks Tigon I / I / II Gigabit Ethernet Device TL # Texas Instruments Thunderlan Device TX # SMC Etherpower II (83C170 EPIC \u003e\u003e) Device VGE # VIA VT612X Gigabit Ethernet Device VR # Via Rhine, Rhine II Device WB # Winbond W89C840F Device XL # 3Com 3C90X (Boomerang \u003e\u003e, Cyclone \u003e\u003e)

dTBCHEB, LPFPTCHA Yurpmshaf Lpoftpmmet Luzhezh Mii.

# ISA Ethernet NICS. PcCard NICS included. Device CS89x0 Nic # "Device Ed" Requires "Device Miibus" Device ED # NE000, SMC Ultra, 3C503, DS8390 Cards Device Ex # Intel EtherExpress Pro / 10 and Pro / 10 + Device Ep # Etherlink III Based Cards Device Fe # Fujitsu MB8696X Based Cards Device Ie # EtherExpress 8/16, 3C507, Starlan 10 etc. Device LNC # NE2100, NE32-VL Lance Ethernet Cards Device SN # SMC "S 9000 Series of Ethernet Chips Device Xe # Xircom PcCard Ethernet # ISA Devices That Use The Old Isa Shims #device Le

dBCCHEB UFEFECHSI LBTF ISA. Pooblpnshfushu at ZhBCMP / USR / SRC / SYS / i386./ CONF / NOTES, IFPWSCH KHOBFSH, LBYEY U U UFEHHEKHESK LBTFSH LLBLIN DTBCHUPN Rapdabychbafus.

# Wireless Nic Cards Device Wlan # 802.11 Support

Generic 802.11 Support. This Line Is Required for Wireless Networking.

Device Wlan_Wep # 802.11 WEP Support Device Wlan_CCMP # 802.11 CCMP Support Device Wlan_tkip # 802.11 TKIP Support

Crypto Support for 802.11 Devices. These Lines Are Needed If You Intend to Use Encryption and 802.11i Security Protocols.

Device An # Aironet 4500/4800 802.11 Wireless NICS. Device ATH # ATHEROS PCI / Cardbus Nic "S Device Ath_Hal # Atheros Hal (Hardware Access Layer) Device Ath_Rate_Sample # Samplerate TX Rate Control for Ath Device AWI # BayStack 660 and Others Device Wi # Wavelan / Intersil / Symbol 802.11 Wireless NICS. #device WL # Older Non 802.11 Wavelan Wireless Nic.

rapdabtzlb TBMIUSTOVABSOBSPTF LBTF.

# Pseudo Devices Device Loop # Network Loopback

ufbodbthfopa HuftPKUFCHP PVTBFOPK Acquisition DMS TCP / IP. EMUM CHIST OBBRKHULBEFE TELNET YMY FTP RP PFOPEIA Localhost (at Que 127.0.0.1), FP Updaeoye RTPKDUF Yuete LFP Khuftpcchp. LFPF RBTBneft. PVSBFEMEO .

Device Random # Entropy Device

zeetbfpt Umkhukhukovy by Yuyem DMS LTYRFPZTBZhYEULPK Obabifshch.

Device Ether # Ethernet Support

ether Opecher Myshyube, Eumen XBB EUFS Uphuchbs LBTFB. According to Chlmayubef Rapdabtzlch Ufbodbtfopp PDB RTPFPLPMB Ethernet.

Device SL # Kernel Slip

sL - LFP Rapdablb Slip. Slip Village RTBLFYYUELE CHSCHFEUEO PPP, LPFTSCHEM Mesuyu Shortbikefus, Mkhyuyi Rpdipdym DMS Design Book NPD-NPDPSOFUFEK.

Device PPP # Kernel PPP

rapdablb PPP H SDTE DMS designer Dial-Up. FBLS UCHEUFCHEF CHETSIS PPP, TEBMYPCHBOPZP LLB RTYMPSEYE, YURPMSHAHAEEE TUN, RTEDBZBAEEY SPMYEYUFCHP SPNPCOFUFEK, LLB, OPPTINET, UPTUE RTY OPVIPVIPFUFY (Ekjiyuy Pwbeeois L UEFY).

Device Tun # Packet Tunnel.

yurpmshhefus RPMshpchbfemshulene RTPZTBNNOW Pveoureyuyen PPP. PVTBFYFUESH L TBDEM PPP Loise BBB DBMSheeks YozhpTNBGYEK.

Device Pty # pseudo-ttys (Telnet etc)

Ruchedp-Fetteobm \u003e\u003e YMY Imifeed-cover RPTF DMS Chipdb. Yurpmshhephus Chipdseyine Telnet th Rlogin -Uhuyusniy, RTympatsoien Xterm Oelpfptschniy Dtkhsen RTympsoisy, Flendine Lonb Emacs.

Device MD # Memory Disks \u003e\u003e

ruredep-Khuftspufchb Dyoulpch H RBNSFY.

Device Gif # IPv6 and IPv4 Tunneling

rapdablb FhoMemitfucked IPv6 Yuete IPv4, IPv4 Yuete IPv6, IPv4 YueTe IPv4 I IPv6 Yute IPv6. Huftspufchp GIF SCMSefus BCFPLPYATKHENSHN\u003e\u003e, Y VKHDAF UKDBCHBFS ZBKMSK HuftPkuffs RP Nethe OpepvipDins.

Device Faith # ipv6-to-ipv4 relaying (translation)

lFP RUPRUP-HUFTPKUFCHP IBICHBFSHCPF RBLEFSH, LPFPT Schemes of the RPUMBCH YE RETETICTBCHMSEF YI DBENPOH FTBUMSGY IPv4 / IPv6.

# The `BPF" Device Enables The Berkeley Packet Filter. # BE Aware of the Administrative Consequency of Enabling This! # Note That "BPF" is Required for DHCP. Device BPF # Berkeley Packet Filter

zhemshft RBlefpch Berkeley. LFP RUPREP-HUFPKUFCHP RPCHPMSEF RetoshpDyfs U Uphonzchek Yofhekhecuce h OtbangTyuchchku \u003e\u003e (Promiscuous) Thezzin, h LPFPTPN RTechichBfshchbefus Mavpk RBlef ChiTplepchebfemshopk UEFY (Optylenet Ethernet). BFF RBlefshch NPZHF RUSFS-Upitboo about Dyulya / Ymyi Yumed Adcobs of RTY RPNPEY.

rTYNYUBYA:

huftspufchp FBLSTBNPK DMS FPZP, UFPVCH RPMHYUFSH BDTEU РП РП ХНПмюбая y F.R. EMUM CHIST YURPMSHEFE DCHP, OE HDBMSKFE OBH PRGA.

# USB Support Device Uhci # Uhci PCI-\u003e USB Interface Device Ohci # Ohci PCI-\u003e USB Interface Device Ehci # EHCI PCI-\u003e USB Interface (USB 2.0) Device USB # USB Bus (Required) #DEVICE UDBP # USB Double Bulk Pipe Devices Device Ugen Interface Device Uhid # Human Interface Devices\u003e Device UKBD # Keyboard Device Ulpt # Printer Device Umass # Disks / Mass Storage - Requires ScBus and Da Device UMS # Mouse Device Ural # Ralink Technology RT2500USB Wireless Nics Device Urio # Diamond Rio 500 MP3 player device uscanner # Scanners # USB Ethernet, requires mii device aue # ADMtek USB Ethernet device axe # ASIX Electronics USB Ethernet device cdce # Generic USB over Ethernet device cue # CATC USB Ethernet device kue # Kawasaki LSI USB Ethernet device rue # RealTek RTL8150 USB Ethernet Intel (R) Pentium (R) Pro NME RPLOYA RPCHPMSEF YURPMSHPCHBFSH PP 64 Zyzbvbkf Pretgfychopk RBNSFi. FreeBSD Ynef Rapdablch LFPC ChPNPTCopufy Riput UPTB PRGY SDTB PAE, Dpufhropk ChP Selui Felhay Chetuyi FreeBSD. Housing at PZTBYUYEYASN BTIFELFHTECH INTEL, OE Dembefus Oillebpzp TBMYYUISE NEFF RBNSFsFSH Ozsey Yymchschy 4 Zyzbvbkf. RBNSFSH, TBNEEOOBS couch 4 Zyzbvbkf, RTPUP DPVBChmsefus L DPUFHROP RBNSFY.

dMS FPZP, Juffsch Chlmayufsh PAE H SDTTE, RTPUP DPVBCHF RTYCHEDEOOHOOKH WFTPLh hp lpbyhtbgyposhk zbkm SDTB:

Options PAE

rTYNYUBYA:

rapdablb PAE H FreeBSD UWEUFCHF FPMSLP DMS RTPGEUPTPH Intel (R) IA-32. FBBNTS, UFP PAE h Freebsd, OE Lushcop RPMPUFSF RTPFEUFTPCHBOPI DPMCOP UBIFBFSHUS Obihydsaynus h Upufpsumy Velbieoye RP UTBSNI, Ufbwehoshkney ChPNPCOFSNY FreeBSD.

rapdablb PAE H FreeBSD Ynef Usedhaee PZTBYUYUEYAS:

    rTPGUUU OE NPCCR RPMHYUFSHD DPUFHR L NEME, Yuen 4 Zyzbvbkfbn RTPUTBOUFHB VM.

    dtbketchschu Huftspuch, LPFPTSCHA OE YURPMSHAF YOPETHEKUK, RTYCHEDHF L RPCTCEDUEYA YozhpTNBGY H SDTTE at Chlmayuoshchenn PAE. OE TELPNEODHEFUS YURPMSHAPHBFSH FBLYE DTBKCHETS. RP FPK RTyuyuh h FreeBSD Chlmayuo LpbyzchtbgyPoshk ZBBM SDTB PAE, YEY LPFPTPZP HDBMES Chue Dtbketsch, P LPFPTSKI YUCHUUFOP, YUFP SOUNT TBVFBAF RTY CHLMAYUEOOPK RPDDezl PAE.

    oellpptpt Success Uyufenosh Reather Prodemsaf Yurpmshptoma Tehumutuch RBNSFI RP LPMYUYUUFHH DPUFHROPK ZHYYYEULPK RBNSFY. Flite Reather NPZKHF RTYCHUFY L OEOOKHOPH NUTYUTOPNH CVDSEOEA RBNSFY YA-BB Pupvelopeophek TBVPFSh Uyufenc PAE. PDYJ FBLYY RTynetpch - Retenteoobs kern.maxvnodes, LPFPTBS HTBCHMSEF NBLUINBMSOSCHPN LPMYUYUUFCHPN VNode, TBEEOPH HC SDTE. Telpneeoduhefus HufBopchyFSHI \u200b\u200bof the LFF RPDPVOSE EK Retenta Vegetable Châchojo h Blochbuff is a bobbyuyas.

    chPNPCOP, RPobdpvymifus Hchechyuhufs RTPUFTBOUFCHP Chertfkhbmschoshki BDTeupch SDTB (KVA) YMY HNEOPHYFSH LBKHA-MYVP REISEEOOKH (UN. Church), LPTPTPK LSPTBCHDBOPK SUBLPE NPZMP RTYCHUFY L YEYETRBEA KVA. DMSI LFPP NPCCF VSFSH Yurpmschbobbob PBGS SDTB KVA_Pages.

h Umkhyube said Pfopufemshop RTPYCHPDIFEMSHOPUFY I. Ufbvymshopufi Telpneeodhefus Putbafshus L Uphlbuga THlpchpdufchb. UFFBUGB THLPchpduFCHB Ustecky Education YozhpTNBGY P Rapdabtzle PAE H FreeBSD.

  • Recovery Mode.

Introduction

Somehow being in the search for how I fasten the configuration INI files or JSON to my server came through options, but for some reason they were uncomfortable or too simple, or bicycles. And even though I love XML configuration, but sometimes it is excessively huge files and uncomfortable for a small number of settings to write a lot of text. Once asked a friend on this topic, he threw me a library. She reminds JSON in a mixture with Yaml.

The library has two interfaces: functional and object. They are very similar, since the object uses inside the functional implementation, but have some differences considered in this post.

Configure and connection

The library is in many repositories, so the installation is simple:
$ sudo aptitude install libconfig8 libconfig8-dev liveconfig ++ libconfig ++ - dev

In C ++ sources is connected by the include:
#Include.
or
#Include.
Or for S.
#Include.

Configuration file.

The config file is the following type of structure:
# EXAMPLE Application Configuration File Version \u003d "1.0"; Application: (Window: (Title \u003d "(! Lang: My Application"; size = { w = 640; h = 480; }; pos = { x = 350; y = 250; }; }; list = (("abc", 123, true), 1.234, (/* an empty list */)); books = ({ title = "Treasure Island"; author = "Robert Louis Stevenson"; price = 29.95; qty = 5; }, { title = "Snow Crash."; author = "Neal Stephenson"; price = 9.99; qty = 8; }); misc: { pi = 3.141592654; bigint = 9223372036854775807L; columns = [ "Last Name", "First Name", "MI" ]; bitmask = 0x1FC3; }; }; !}

The main types of records in the config are such types:

Element (SETTING)
This is the minimum significant part of the configuration structure and have a key value:
Name \u003d Value;
or
Name: Value.
Groups (groups)
Groups may contain any number of items, but each element must contain a unique key within the group. Recorded in curly brackets:
(settings ...)
Arrays (Arrays)
Contain any number of elements, even zero, but all elements consist only of values \u200b\u200band should have the same scalar type within the array. Writes in square brackets:
[Value, Value ...]
Lists (Lists)
Lists contain zero or more scalar type elements, arrays, groups or lists. Recorded in parentheses:
(Value, Value ...)
Integers (Integers)
They are recorded in the usual decimal method (± 0-9) or hexadecimal form (0xa-f). But integer values \u200b\u200bare limited to the range -2147483648..2147483647 (32bit), but if large ranges are needed, the 'L' is added at the end.
3578934 897893450934L
Float Floats (Floats)
Written too familiar to us
3.1415
Recording with an exponent standard with "E".
Boolean values \u200b\u200b(Boolean)
Values \u200b\u200bare written as 'true' or 'false' and register-dependent (without quotes, of course).
Strings (Strings)
Write in double quotes as "the usual long string recorded for example."
The following options will eventually give the same value of the string:
"The usual long string" "recorded for example"
"Normal long string" / * Comment * / "Recorded" // Comment "For example".
Comments
The config is possible three familiarities in C ++:
  • # Single-line until the end of the line
  • // also single-line until the end of the line
  • / * ... * / Multiline Comment including Row Transfer
External connections (includes)
This is generally the most delicious taste.
# File: quote.cfg quote \u003d "Criticism May Not Be Agreeable, But It Is Necessary." "IT FULFILS THE SAME FUNCTION AS PAIN IN THE HUMAN" "BODY. IT Calls Attention to An Unhealthy State of" "Things. \\ N" "\\ t - Winston Churchill";
# File: test.cfg info: (Name \u003d "Winston Churchill"; @include "quote.cfg" circumtry \u003d "uk";);

With API

In this part, I will not paint all the functions, only the main, since they are generally similar, and the main nuances.

Description of used functions below

#Include. #Include. #Include. / * This example reads the configuration file "example.cfg" and displays its components * / int Main (INT ARGC, CHAR ** ARGV) (/ * These types are used. * / Config_t cfg; config_setting_t * setting; Const char * str; config_init (& CFG); / * Mandatory Initialization * / / * We read the file. If an error, you complete the operation * / if (! config_read_file (& cfg, "example.cfg")) (fprintf (stderr, "% s:% d - % s \\ n ", config_error_file (& cfg), config_error_line (& cfg), config_error_text (& cfg)); config_destroy (& cfg); RETURN (EXIT_FAILURE);) / * Search for some kind of" name ". * / if (config_lookup_string (& CFG, "Name", & str)) printf ("Store Name:% s \\ n \\ n", str); else fprintf (STDERR, "NO" NAME "setting in configuration file. \\ n"); / * Output of the list of books with shelves * / setting \u003d config_lookup (& cfg, "inventory.books"); if (setting! \u003d NULL) (int count \u003d config_setting_length (setting); int i; PrintF ("% - 30s% -30s% -6S% s \\ n "," title "," author "," price "," qty "); for (i \u003d 0; i< count; ++i) { config_setting_t *book = config_setting_get_elem(setting, i); /* Выводим только те записи, если они имеют все нужные поля. */ const char *title, *author; double price; int qty; if(!(config_setting_lookup_string(book, "title", &title) && config_setting_lookup_string(book, "author", &author) && config_setting_lookup_float(book, "price", &price) && config_setting_lookup_int(book, "qty", &qty))) continue; printf("%-30s %-30s $%6.2f %3d\n", title, author, price, qty); } putchar("\n"); } /* Вывод всех фильмов с полки. */ setting = config_lookup(&cfg, "inventory.movies"); if(setting != NULL) { unsigned int count = config_setting_length(setting); unsigned int i; printf("%-30s %-10s %-6s %s\n", "TITLE", "MEDIA", "PRICE", "QTY"); for(i = 0; i < count; ++i) { config_setting_t *movie = config_setting_get_elem(setting, i); /* Вывод только тех медиа, у которых заполнены все поля. */ const char *title, *media; double price; int qty; if(!(config_setting_lookup_string(movie, "title", &title) && config_setting_lookup_string(movie, "media", &media) && config_setting_lookup_float(movie, "price", &price) && config_setting_lookup_int(movie, "qty", &qty))) continue; printf("%-30s %-10s $%6.2f %3d\n", title, media, price, qty); } putchar("\n"); } config_destroy(&cfg); /* Освободить память обязательно, если это не конец программы */ return(EXIT_SUCCESS); }

Small description of the functionality
Full description in the documentation.

config_t. - Type of configuration file (this is not a record). Roughly speaking, the main container.
config_Setting_T. - The object of the configuration element. The example uses a pointer returned to the container to the desired element.
int. config_read_file(config_t * config, const char * filename) - Function reads the FileName configuration file to memory and fills the type object config_t.. You can not read from the file, and immediately "rain" in config_read_string () or give a file descriptor in config_read ()
int. config_lookup_string (Const config_t * config, const char * path, const char ** value) - searches and returns a value in the form of a pointer to a string value.on the specified path path. inside the config config.
Config_Setting_T * config_Lookup. (Const Config_t * Config, Const Char * Path) - looking for an entry inside the config over the specified inner path and returns it.
Config_Setting_T * config_setting_get_Elem. (Const config_setting_t * setting, unsigned int index) - Used for arrays, lists to return elements from it with such a number in order
int. config_Setting_Lookup_String (Const Config_setting_t * Setting, Const Char * Name, Const Char ** Value) -
Returns the value value. Daughter element name. Regarding a given recording setting.
When it is necessary to get a value in a specific set record, then type functions are used.
int. config_setting_get_int. (Const Config_Setting_T * SETTING)

C ++ API.

The same example, but on C ++. Full documentation on the site

#Include. #Include. #Include. #Include. Using Namespace STD; Using Namespace libconfig; // Example that reads the configuration file "example.cfg" and displays its entry record (int argc, char ** ARGV) (config CFG; // read the file. Or exit an error // Class in C ++ does not return an error , and throws the exclusion of try (CFG.ReadFile ("example.cfg");) Catch (Const FileException & Fiex) (STD :: CERR<< "I/O error while reading file." << std::endl; return(EXIT_FAILURE); } catch(const ParseException &pex) { std::cerr << "Parse error at " << pex.getFile() << ":" << pex.getLine() << " - " << pex.getError() << std::endl; return(EXIT_FAILURE); } // Получить некое название. try { string name = cfg.lookup("name"); cout << "Store name: " << name << endl << endl; } catch(const SettingNotFoundException &nfex) { cerr << "No "name" setting in configuration file." << endl; } const Setting& root = cfg.getRoot(); // Найти все книжки на полке. try { const Setting &books = root["inventory"]["books"]; int count = books.getLength(); cout << setw(30) << left << "TITLE" << " " << setw(30) << left << "AUTHOR" << " " << setw(6) << left << "PRICE" << " " << "QTY" << endl; for(int i = 0; i < count; ++i) { const Setting &book = books[i]; // Находим только те записи, что имеют все заполненные поля. string title, author; double price; int qty; if(!(book.lookupValue("title", title) && book.lookupValue("author", author) && book.lookupValue("price", price) && book.lookupValue("qty", qty))) continue; cout << setw(30) << left << title << " " << setw(30) << left << author << " " << "$" << setw(6) << right << price << " " << qty << endl; } cout << endl; } catch(const SettingNotFoundException &nfex) { // Ignore. } // Вывод всех фильмов с полки. try { const Setting &movies = root["inventory"]["movies"]; int count = movies.getLength(); cout << setw(30) << left << "TITLE" << " " << setw(10) << left << "MEDIA" << " " << setw(6) << left << "PRICE" << " " << "QTY" << endl; for(int i = 0; i < count; ++i) { const Setting &movie = movies[i]; // Вывод только тех, что содержат все поля. string title, media; double price; int qty; if(!(movie.lookupValue("title", title) && movie.lookupValue("media", media) && movie.lookupValue("price", price) && movie.lookupValue("qty", qty))) continue; cout << setw(30) << left << title << " " << setw(10) << left << media << " " << "$" << setw(6) << right << price << " " << qty << endl; } cout << endl; } catch(const SettingNotFoundException &nfex) { // Ignore. } return(EXIT_SUCCESS); }
Here the same principle as in a functional style, only before receiving data from the config, it is necessary to obtain the root element cFG.Getroot (); And then from him to turn to the rest of the elements. It is also necessary to be attentive to the fact that almost all errors are thrown exceptions.

Conclusion

In addition to reading convenient configs, the API also provides the functionality of the creation of config items and write it to the media.