Diff

Differences From Artifact [caede5b68d]:

To Artifact [9235a07e28]:


169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
int callback_ifmodule(const char *shortvar, const char *var,
                      const char *arguments, const char *value,
                      lc_flags_t flags, void *extra) {
	if (flags == LC_FLAGS_SECTIONEND) {
		return(LC_CBRET_OKAY);
	}

	if (flags != LC_FLAGS_SECTIONSTART) {
		lc_seterrstr("IfModule can only be used as a \\
		              section.");
		return(LC_CBRET_ERROR);
	}
	if (arguments == NULL) {
		lc_seterrstr("You must specify an argument to \\
		              IfModule.");
		return(LC_CBRET_ERROR);
	}

	printf("IfModule %s\\n", arguments);

	if (strcasecmp(arguments, "MyModule") == 0) {
		return(LC_CBRET_IGNORESECTION);
	}

	return(LC_CBRET_OKAY);
}

int main(int argc, char **argv) {
	int lc_rc_ret = 0, lc_p_ret;

	lc_rc_ret = lc_register_callback("*.IfModule", 0, LC_VAR_NONE,
	                                 callback_ifmodule, NULL);

	if (lc_rc_ret != 0) {
		fprintf(stderr, "Error registering callback.\\n");
		return(EXIT_FAILURE);
	}








<
<
<
<
<
















|

|







169
170
171
172
173
174
175





176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
int callback_ifmodule(const char *shortvar, const char *var,
                      const char *arguments, const char *value,
                      lc_flags_t flags, void *extra) {
	if (flags == LC_FLAGS_SECTIONEND) {
		return(LC_CBRET_OKAY);
	}






	if (arguments == NULL) {
		lc_seterrstr("You must specify an argument to \\
		              IfModule.");
		return(LC_CBRET_ERROR);
	}

	printf("IfModule %s\\n", arguments);

	if (strcasecmp(arguments, "MyModule") == 0) {
		return(LC_CBRET_IGNORESECTION);
	}

	return(LC_CBRET_OKAY);
}

int main(int argc, char **argv) {
	int lc_rc_ret, lc_p_ret;

	lc_rc_ret = lc_register_callback("*.IfModule", 0, LC_VAR_SECTION,
	                                 callback_ifmodule, NULL);

	if (lc_rc_ret != 0) {
		fprintf(stderr, "Error registering callback.\\n");
		return(EXIT_FAILURE);
	}