libini_config 0.5.0

ini_configmod.h

00001 /*
00002     INI LIBRARY
00003 
00004     Interface that allows modification of the INI file.
00005 
00006     Copyright (C) Dmitri Pal <dpal@redhat.com> 2014
00007 
00008     INI Library is free software: you can redistribute it and/or modify
00009     it under the terms of the GNU Lesser General Public License as published by
00010     the Free Software Foundation, either version 3 of the License, or
00011     (at your option) any later version.
00012 
00013     INI Library is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016     GNU Lesser General Public License for more details.
00017 
00018     You should have received a copy of the GNU Lesser General Public License
00019     along with INI Library.  If not, see <http://www.gnu.org/licenses/>.
00020 */
00021 
00022 #ifndef INI_CONFIGMOD_H
00023 #define INI_CONFIGMOD_H
00024 
00025 
00040 enum INI_VA {
00046     INI_VA_NOCHECK    = 0,
00056     INI_VA_MOD        = 1,
00066     INI_VA_MOD_E      = 2,
00067 
00080     INI_VA_MODADD     = 3,
00081 
00094     INI_VA_MODADD_E   = 4,
00095 
00101     INI_VA_CLEAN      = 5,
00102 
00107     INI_VA_DUPERROR   = 6
00108 };
00195 int ini_config_add_section(struct ini_cfgobj *ini_config,
00196                            const char *section,
00197                            const char *comments[],
00198                            size_t count_comment,
00199                            int position,
00200                            const char *other_section,
00201                            int idx);
00202 
00224 int ini_config_comment_section(struct ini_cfgobj *ini_config,
00225                                const char *section,
00226                                const char *comments[],
00227                                size_t count_comment);
00228 
00243 int ini_config_rename_section(struct ini_cfgobj *ini_config,
00244                               const char *section,
00245                               const char *newname);
00246 
00247 
00262 int ini_config_delete_section_by_name(struct ini_cfgobj *ini_config,
00263                                       const char *section);
00264 
00299 int ini_config_delete_section_by_position(struct ini_cfgobj *ini_config,
00300                                           int position,
00301                                           const char *section,
00302                                           int idx);
00303 
00304 
00361 int ini_config_add_str_value(struct ini_cfgobj *ini_config,
00362                              const char *section,
00363                              const char *key,
00364                              const char *value,
00365                              const char *comments[],
00366                              size_t count_comment,
00367                              int border,
00368                              int position,
00369                              const char *other_key,
00370                              int idx,
00371                              enum INI_VA flags);
00372 
00381 int ini_config_add_int_value(struct ini_cfgobj *ini_config,
00382                              const char *section,
00383                              const char *key,
00384                              int value,
00385                              const char *comments[],
00386                              size_t count_comment,
00387                              int border,
00388                              int position,
00389                              const char *other_key,
00390                              int idx,
00391                              enum INI_VA flags);
00392 
00401 int ini_config_add_long_value(struct ini_cfgobj *ini_config,
00402                               const char *section,
00403                               const char *key,
00404                               long value,
00405                               const char *comments[],
00406                               size_t count_comment,
00407                               int border,
00408                               int position,
00409                               const char *other_key,
00410                               int idx,
00411                               enum INI_VA flags);
00412 
00421 int ini_config_add_ulong_value(struct ini_cfgobj *ini_config,
00422                                const char *section,
00423                                const char *key,
00424                                unsigned long value,
00425                                const char *comments[],
00426                                size_t count_comment,
00427                                int border,
00428                                int position,
00429                                const char *other_key,
00430                                int idx,
00431                                enum INI_VA flags);
00432 
00441 int ini_config_add_unsigned_value(struct ini_cfgobj *ini_config,
00442                                   const char *section,
00443                                   const char *key,
00444                                   unsigned value,
00445                                   const char *comments[],
00446                                   size_t count_comment,
00447                                   int border,
00448                                   int position,
00449                                   const char *other_key,
00450                                   int idx,
00451                                   enum INI_VA flags);
00452 
00461 int ini_config_add_int32_value(struct ini_cfgobj *ini_config,
00462                                const char *section,
00463                                const char *key,
00464                                int32_t value,
00465                                const char *comments[],
00466                                size_t count_comment,
00467                                int border,
00468                                int position,
00469                                const char *other_key,
00470                                int idx,
00471                                enum INI_VA flags);
00472 
00481 int ini_config_add_uint32_value(struct ini_cfgobj *ini_config,
00482                                 const char *section,
00483                                 const char *key,
00484                                 uint32_t value,
00485                                 const char *comments[],
00486                                 size_t count_comment,
00487                                 int border,
00488                                 int position,
00489                                 const char *other_key,
00490                                 int idx,
00491                                 enum INI_VA flags);
00492 
00501 int ini_config_add_int64_value(struct ini_cfgobj *ini_config,
00502                                const char *section,
00503                                const char *key,
00504                                int64_t value,
00505                                const char *comments[],
00506                                size_t count_comment,
00507                                int border,
00508                                int position,
00509                                const char *other_key,
00510                                int idx,
00511                                enum INI_VA flags);
00512 
00521 int ini_config_add_uint64_value(struct ini_cfgobj *ini_config,
00522                                 const char *section,
00523                                 const char *key,
00524                                 uint64_t value,
00525                                 const char *comments[],
00526                                 size_t count_comment,
00527                                 int border,
00528                                 int position,
00529                                 const char *other_key,
00530                                 int idx,
00531                                 enum INI_VA flags);
00532 
00541 int ini_config_add_double_value(struct ini_cfgobj *ini_config,
00542                                 const char *section,
00543                                 const char *key,
00544                                 double value,
00545                                 const char *comments[],
00546                                 size_t count_comment,
00547                                 int border,
00548                                 int position,
00549                                 const char *other_key,
00550                                 int idx,
00551                                 enum INI_VA flags);
00552 
00566 int ini_config_add_bin_value(struct ini_cfgobj *ini_config,
00567                              const char *section,
00568                              const char *key,
00569                              void *value,
00570                              size_t value_len,
00571                              const char *comments[],
00572                              size_t count_comment,
00573                              int border,
00574                              int position,
00575                              const char *other_key,
00576                              int idx,
00577                              enum INI_VA flags);
00578 
00588 int ini_config_add_const_str_arr_value(struct ini_cfgobj *ini_config,
00589                                        const char *section,
00590                                        const char *key,
00591                                        const char *value_str_arr[],
00592                                        size_t count_str,
00593                                        char sep,
00594                                        const char *comments[],
00595                                        size_t count_comment,
00596                                        int border,
00597                                        int position,
00598                                        const char *other_key,
00599                                        int idx,
00600                                        enum INI_VA flags);
00601 
00611 int ini_config_add_str_arr_value(struct ini_cfgobj *ini_config,
00612                                  const char *section,
00613                                  const char *key,
00614                                  char *value_str_arr[],
00615                                  size_t count_str,
00616                                  char sep,
00617                                  const char *comments[],
00618                                  size_t count_comment,
00619                                  int border,
00620                                  int position,
00621                                  const char *other_key,
00622                                  int idx,
00623                                  enum INI_VA flags);
00624 
00634 int ini_config_add_int_arr_value(struct ini_cfgobj *ini_config,
00635                                  const char *section,
00636                                  const char *key,
00637                                  int *value_int_arr,
00638                                  size_t count_int,
00639                                  char sep,
00640                                  const char *comments[],
00641                                  size_t count_comment,
00642                                  int border,
00643                                  int position,
00644                                  const char *other_key,
00645                                  int idx,
00646                                  enum INI_VA flags);
00647 
00657 int ini_config_add_long_arr_value(struct ini_cfgobj *ini_config,
00658                                   const char *section,
00659                                   const char *key,
00660                                   long *value_long_arr,
00661                                   size_t count_long,
00662                                   char sep,
00663                                   const char *comments[],
00664                                   size_t count_comment,
00665                                   int border,
00666                                   int position,
00667                                   const char *other_key,
00668                                   int idx,
00669                                   enum INI_VA flags);
00670 
00680 int ini_config_add_double_arr_value(struct ini_cfgobj *ini_config,
00681                                     const char *section,
00682                                     const char *key,
00683                                     double *value_double_arr,
00684                                     size_t count_double,
00685                                     char sep,
00686                                     const char *comments[],
00687                                     size_t count_comment,
00688                                     int border,
00689                                     int position,
00690                                     const char *other_key,
00691                                     int idx,
00692                                     enum INI_VA flags);
00693 
00724 int ini_config_delete_value(struct ini_cfgobj *ini_config,
00725                             const char *section,
00726                             int position,
00727                             const char *key,
00728                             int idx);
00729 
00758 int ini_config_update_comment(struct ini_cfgobj *ini_config,
00759                               const char *section,
00760                               const char *key,
00761                               const char *comments[],
00762                               size_t count_comment,
00763                               int idx);
00767 #endif
 All Data Structures Variables