summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ/tlv.h
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/IcqOscarJ/tlv.h')
-rw-r--r--protocols/IcqOscarJ/tlv.h88
1 files changed, 88 insertions, 0 deletions
diff --git a/protocols/IcqOscarJ/tlv.h b/protocols/IcqOscarJ/tlv.h
new file mode 100644
index 0000000000..12553bde49
--- /dev/null
+++ b/protocols/IcqOscarJ/tlv.h
@@ -0,0 +1,88 @@
+// ---------------------------------------------------------------------------80
+// ICQ plugin for Miranda Instant Messenger
+// ________________________________________
+//
+// Copyright 2000-2001 Richard Hughes, Roland Rabien, Tristan Van de Vreede
+// Copyright 2001-2002 Jon Keating, Richard Hughes
+// Copyright 2002-2004 Martin berg, Sam Kothari, Robert Rainwater
+// Copyright 2004-2008 Joe Kucera
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+// -----------------------------------------------------------------------------
+//
+// File name : $URL: http://miranda.googlecode.com/svn/trunk/miranda/protocols/IcqOscarJ/tlv.h $
+// Revision : $Revision: 8822 $
+// Last change on : $Date: 2009-01-11 19:17:05 +0200 (Вс, 11 янв 2009) $
+// Last change by : $Author: jokusoftware $
+//
+// DESCRIPTION:
+//
+// Describe me here please...
+//
+// -----------------------------------------------------------------------------
+
+#ifndef __TLV_H
+#define __TLV_H
+
+/*---------* Structures *--------------*/
+
+struct oscar_tlv
+{
+ WORD wType;
+ WORD wLen;
+ BYTE *pData;
+};
+
+
+struct oscar_tlv_chain
+{
+ oscar_tlv tlv;
+ oscar_tlv_chain *next;
+
+ WORD getChainLength();
+
+ oscar_tlv* getTLV(WORD wType, WORD wIndex);
+ oscar_tlv* putTLV(WORD wType, WORD wLen, BYTE *pData, BOOL bReplace);
+ oscar_tlv_chain* removeTLV(oscar_tlv *tlv);
+ WORD getLength(WORD wType, WORD wIndex);
+
+ DWORD getDWord(WORD wType, WORD wIndex);
+ WORD getWord(WORD wType, WORD wIndex);
+ BYTE getByte(WORD wType, WORD wIndex);
+ int getNumber(WORD wType, WORD wIndex);
+ double getDouble(WORD wType, WORD wIndex);
+ char* getString(WORD wType, WORD wIndex);
+};
+
+
+struct oscar_tlv_record_list
+{
+ oscar_tlv_chain *item;
+ oscar_tlv_record_list *next;
+
+ oscar_tlv_chain* getRecordByTLV(WORD wType, int nValue);
+};
+
+/*---------* Functions *---------------*/
+
+oscar_tlv_chain* readIntoTLVChain(BYTE **buf, WORD wLen, int maxTlvs);
+void disposeChain(oscar_tlv_chain** chain);
+
+oscar_tlv_record_list* readIntoTLVRecordList(BYTE **buf, WORD wLen, int nCount);
+void disposeRecordList(oscar_tlv_record_list** list);
+
+
+#endif /* __TLV_H */