From 705ccb221882612b0f1c7b55e5c00ca86ed4c3a9 Mon Sep 17 00:00:00 2001
From: Luigi Rizzo <rizzo@icir.org>
Date: Wed, 29 Mar 2006 02:14:38 +0000
Subject: [PATCH] Introduce an utility macro to set base, offset and datalen of
 a frame, which is a very common operation.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@15970 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 include/asterisk/frame.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/asterisk/frame.h b/include/asterisk/frame.h
index a1fcf8e0be..21b5969286 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;
-- 
GitLab