- Timestamp:
- Aug 15, 2009, 7:08:18 PM (16 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 1077891a
- Parents:
- fa4562c
- git-author:
- Anders Kaseorg <andersk@mit.edu> (08/04/09 02:37:51)
- git-committer:
- Anders Kaseorg <andersk@mit.edu> (08/15/09 19:08:18)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
owl.h
rc529ac8 re19eb97 202 202 #endif 203 203 204 /* Convert char * * into char **. This conversion is safe,204 /* Convert char *const * into const char *const *. This conversion is safe, 205 205 * and implicit in C++ (conv.qual 4) but for some reason not in C. */ 206 static inline c har **strs(char **pstr)206 static inline const char *const *strs(char *const *pstr) 207 207 { 208 return (c har **)pstr;208 return (const char *const *)pstr; 209 209 } 210 210 … … 218 218 char *description; /* detailed description */ 219 219 void *val; /* current value */ 220 int (*validate_fn)(struct _owl_variable *v, void *newval);220 int (*validate_fn)(struct _owl_variable *v, const void *newval); 221 221 /* returns 1 if newval is valid */ 222 int (*set_fn)(struct _owl_variable *v, void *newval);222 int (*set_fn)(struct _owl_variable *v, const void *newval); 223 223 /* sets the variable to a value 224 224 * of the appropriate type. … … 226 226 * should make a copy. 227 227 * returns 0 on success. */ 228 int (*set_fromstring_fn)(struct _owl_variable *v, c har *newval);228 int (*set_fromstring_fn)(struct _owl_variable *v, const char *newval); 229 229 /* sets the variable to a value 230 230 * of the appropriate type. … … 232 232 * should make a copy. 233 233 * returns 0 on success. */ 234 void *(*get_fn)(struct _owl_variable *v);234 const void *(*get_fn)(struct _owl_variable *v); 235 235 /* returns a reference to the current value. 236 236 * WARNING: this approach is hard to make 237 237 * thread-safe... */ 238 238 int (*get_tostring_fn)(struct _owl_variable *v, 239 char *buf, int bufsize, void *val);239 char *buf, int bufsize, const void *val); 240 240 /* converts val to a string 241 241 * and puts into buf */ … … 299 299 300 300 /* These don't take any context */ 301 char *(*cmd_args_fn)(int argc, c har **argv,char *buff);301 char *(*cmd_args_fn)(int argc, const char *const *argv, const char *buff); 302 302 /* takes argv and the full command as buff. 303 303 * caller must free return value if !NULL */ … … 306 306 307 307 /* The following also take the active context if it's valid */ 308 char *(*cmd_ctxargs_fn)(void *ctx, int argc, c har **argv,char *buff);308 char *(*cmd_ctxargs_fn)(void *ctx, int argc, const char *const *argv, const char *buff); 309 309 /* takes argv and the full command as buff. 310 310 * caller must free return value if !NULL */ … … 328 328 329 329 typedef struct _owl_pair { 330 c har *key;330 const char *key; 331 331 char *value; 332 332 } owl_pair; … … 342 342 struct _owl_fmtext_cache * fmtext; 343 343 int delete; 344 c har *hostname;344 const char *hostname; 345 345 owl_list attributes; /* this is a list of pairs */ 346 346 char *timestr;
Note: See TracChangeset
for help on using the changeset viewer.