︙ | | |
768
769
770
771
772
773
774
775
776
777
778
779
780
781
|
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
|
+
+
+
|
}
int lc_process_var(const char *var, const char *varargs, const char *value, lc_flags_t flags) {
struct lc_varhandler_st *handler = NULL;
const char *lastcomponent_handler = NULL, *lastcomponent_var = NULL;
lc_errno = LC_ERR_NONE;
lc_err_usererrmsg = NULL;
lastcomponent_var = strrchr(var, '.');
if (lastcomponent_var == NULL) {
lastcomponent_var = var;
} else {
lastcomponent_var++;
}
|
︙ | | |
817
818
819
820
821
822
823
824
825
826
827
828
829
830
|
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
|
+
+
+
|
return(-1);
}
int lc_register_callback(const char *var, char opt, lc_var_type_t type, int (*callback)(const char *, const char *, const char *, const char *, lc_flags_t, void *), void *extra) {
struct lc_varhandler_st *newhandler = NULL;
lc_errno = LC_ERR_NONE;
lc_err_usererrmsg = NULL;
newhandler = malloc(sizeof(*newhandler));
if (newhandler == NULL) {
return(-1);
}
if (var == NULL) {
|
︙ | | |
843
844
845
846
847
848
849
850
851
852
853
854
855
856
|
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
|
+
+
+
|
return(0);
}
int lc_register_var(const char *var, lc_var_type_t type, void *data, char opt) {
struct lc_varhandler_st *newhandler = NULL;
lc_errno = LC_ERR_NONE;
lc_err_usererrmsg = NULL;
newhandler = malloc(sizeof(*newhandler));
if (newhandler == NULL) {
return(-1);
}
if (var == NULL) {
|
︙ | | |
869
870
871
872
873
874
875
876
877
878
879
880
881
882
|
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
|
+
+
+
|
return(0);
}
int lc_process_file(const char *appname, const char *pathname, lc_conf_type_t type) {
int chkretval = 0;
lc_errno = LC_ERR_NONE;
lc_err_usererrmsg = NULL;
switch (type) {
case LC_CONF_SECTION:
chkretval = lc_process_conf_section(appname, pathname);
break;
case LC_CONF_APACHE:
chkretval = lc_process_conf_apache(appname, pathname);
break;
|
︙ | | |
966
967
968
969
970
971
972
973
974
975
976
977
978
979
|
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
|
+
+
+
|
return(retval);
}
void lc_cleanup(void) {
struct lc_varhandler_st *handler = NULL, *next = NULL;
lc_errno = LC_ERR_NONE;
lc_err_usererrmsg = NULL;
handler = varhandlers;
while (handler != NULL) {
if (handler->var != NULL) {
free(handler->var);
}
next = handler->_next;
|
︙ | | |
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
|
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
|
-
-
|
lc_err_t lc_geterrno(void) {
lc_err_t retval;
retval = lc_errno;
lc_errno = LC_ERR_NONE;
return(retval);
}
void lc_seterrstr(const char *usererrmsg) {
lc_err_usererrmsg = strdup(usererrmsg);
}
|
︙ | | |