diff options
author | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-03-29 02:14:38 +0000 |
---|---|---|
committer | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-03-29 02:14:38 +0000 |
commit | 3353340cebcc9bcaa12e211a47c2f94d119d50a3 (patch) | |
tree | 4b1b9270f94f1cc6dd741af1ac7684708b38fd73 /include | |
parent | 034c8b2f009e5f5c7d99763ccf4abf58220a4d22 (diff) |
Introduce an utility macro to set base, offset and
datalen of a frame, which is a very common operation.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@15970 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/frame.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/asterisk/frame.h b/include/asterisk/frame.h index a1fcf8e0b..21b596928 100644 --- a/include/asterisk/frame.h +++ b/include/asterisk/frame.h @@ -111,6 +111,13 @@ struct ast_frame { struct ast_frame *next; }; +#define FR_SET_BUF(fr, _base, _ofs, _datalen) \ + { \ + (fr)->data = (char *)_base + (_ofs); \ + (fr)->offset = (_ofs); \ + (fr)->datalen = (_datalen); \ + } + /*! Queueing a null frame is fairly common, so we declare a global null frame object for this purpose instead of having to declare one on the stack */ extern struct ast_frame ast_null_frame; |