4556260 [rkeene@sledge /home/rkeene/devel/libconfig-0.2.5]$ cat -n lc_geterrstr.3.in
   1: .TH LC_GETERRSTR 3 "25 Oct 04" "@PACKAGE_STRING@"
   2: .SH NAME
   3: lc_geterrstr \- Retrieve a human readable error message.
   4: 
   5: .SH SYNOPSIS
   6: .B #include <libconfig.h>
   7: .sp
   8: .BI "char *lc_geterrstr(void);"
   9: 
  10: .SH DESCRIPTION
  11: The
  12: .BR lc_geterrstr (3)
  13: function returns a string describing the last error code set.
  14: 
  15: .SH EXAMPLE
  16: .nf
  17: #include <libconfig.h>
  18: #include <stdlib.h>
  19: #include <stdio.h>
  20: 
  21: int main(int argc, char **argv) {
  22: 	int lc_p_ret, lc_rv_ret;
  23: 	char *filename = NULL;
  24: 
  25: 	lc_rv_ret = lc_register_var("File", LC_VAR_STRING,
  26: 	                            &filename, 'f');
  27: 
  28: 	if (lc_rv_ret != 0) {
  29: 		fprintf(stderr, "Error registering variable: %s.\\n",
  30: 		        lc_geterrstr());
  31: 		return(EXIT_FAILURE);
  32: 	}
  33: 
  34: 	lc_p_ret = lc_process(argc, argv, "example", LC_CONF_APACHE,
  35: 	                      NULL);
  36: 
  37: 	lc_cleanup();
  38: 
  39: 	if (lc_p_ret != 0) {
  40: 		fprintf(stderr, "Error processing configuration: \\
  41: 		        %s\\n", lc_geterrstr());
  42: 		return(EXIT_FAILURE);
  43: 	}
  44: 
  45: 	if (filename != NULL) {
  46: 		printf("File specified was: %s\\n", filename);
  47: 	} else {
  48: 		printf("No filename specified.\\n");
  49: 	}
  50: 
  51: 	return(EXIT_SUCCESS);
  52: }
  53: .fi
  54: 
  55: .SH "SEE ALSO"
  56: .BR libconfig (3),
  57: .BR lc_register_var (3),
  58: .BR lc_register_callback (3),                          
  59: .BR lc_geterrno (3),                                                                                                           
  60: .BR lc_seterrstr (3),                                                                                                          
  61: .BR lc_handle_type (3),
  62: .BR lc_process (3),                                                                                                            
  63: .BR lc_process_file (3),                                                                                                       
  64: .BR lc_cleanup (3)
4556261 [rkeene@sledge /home/rkeene/devel/libconfig-0.2.5]$

Click here to go back to the directory listing.
Click here to download this file.
last modified: 2006-12-18 01:41:58