Changeset 010a951 for owl.h


Ignore:
Timestamp:
Mar 5, 2011, 3:25:29 PM (14 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.10, release-1.8, release-1.9
Children:
e3a75ed
Parents:
9620c8d
git-author:
David Benjamin <davidben@mit.edu> (02/28/11 10:53:18)
git-committer:
David Benjamin <davidben@mit.edu> (03/05/11 15:25:29)
Message:
Make owl_variable's get_tostring_fn return a newly allocated string

The mess with buffer lengths and whatnot is obnoxious. Note that this
does change semantics slightly: instead of (optionally) filling a buffer
and giving a return code for good vs no-variable/invalid, we now return
NULL for missing variables and always return a string if the variable
exists. This also appears to be more accurate from the perspective of
the calls anyway.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • owl.h

    rf54b07d r010a951  
    261261                                 * WARNING:  this approach is hard to make
    262262                                 * thread-safe... */
    263   int  (*get_tostring_fn)(const struct _owl_variable *v,
    264                           char *buf, int bufsize, const void *val);
    265                                 /* converts val to a string
    266                                  * and puts into buf */
     263  char *(*get_tostring_fn)(const struct _owl_variable *v, const void *val);
     264                                /* converts val to a string;
     265                                 * caller must free the result */
    267266  void (*delete_fn)(struct _owl_variable *v);
    268267                                /* frees val as needed */
Note: See TracChangeset for help on using the changeset viewer.