mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-02 03:52:49 -05:00
Make strbuf a less opaque type.
Now, instead of being a black box that you shovel strings into and eventually extract a final answer, it exposes enough structure fields to the world that you can append things to it _and_ look inside its current contents. For convenience, it exports its internal pointer as both a char * and an unsigned char *.
This commit is contained in:
6
defs.h
6
defs.h
@ -34,4 +34,10 @@ typedef uint32_t uint32;
|
||||
#define TYPECHECK(to_check, to_return) \
|
||||
(sizeof(to_check) ? (to_return) : (to_return))
|
||||
|
||||
/* Return a pointer to the object of structure type 'type' whose field
|
||||
* with name 'field' is pointed at by 'object'. */
|
||||
#define FROMFIELD(object, type, field) \
|
||||
TYPECHECK(object == &((type *)0)->field, \
|
||||
((type *)(((char *)(object)) - offsetof(type, field))))
|
||||
|
||||
#endif /* PUTTY_DEFS_H */
|
||||
|
Reference in New Issue
Block a user