<commit_before>// Copyright 2006 <NAME> <<EMAIL>>
// This software is made available under the MIT License
// See COPYING for details

using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.IO;
using System.Net.Sockets;
using System.Runtime.InteropServices;

//for filling padding with random
//using System.Security.Cryptography;

//using Console = System.Diagnostics.Trace;

namespace NDesk.DBus
{
	public unsafe class Message
	{
		public DHeader* Header;

		public int HeaderSize;
		public byte[] HeaderData;

		public MessageType MessageType
		{
			get {
				return Header->MessageType;
			} set {
				Header->MessageType = value;
			}
		}

		public uint Serial
		{
			get {
				return Header->Serial;
			} set {
				Header->Serial = value;
			}
		}

		//TODO: check bit op logic
		public bool ReplyExpected
		{
			get {
				return Header->Flags != HeaderFlag.NoReplyExpected;
			} set {
				if (value)
					//Header->Flags &= HeaderFlag.NoReplyExpected; //flag off
					Header->Flags = HeaderFlag.None; //flag off
				else
					//Header->Flags |= HeaderFlag.NoReplyExpected; //flag on
					Header->Flags = HeaderFlag.NoReplyExpected; //flag on
			}
		}

		public HeaderField[] HeaderFields;
		//public Dictionary<FieldCode,object>;


		public MemoryStream Body;
		//public byte[] Data;
		//public int DataSize;

		public bool Locked;


		//temporary convenience methods
		public void WriteHeader (ObjectPath opath, string iface, string member, string dest)
		{
			WriteHeader (new HeaderField (FieldCode.Path, opath), new HeaderField (FieldCode.Interface, iface), new HeaderField (FieldCode.Member, member), new HeaderField (FieldCode.Destination, dest));
		}

		public void WriteHeader (ObjectPath opath, string iface, string member, string dest, Signature sig)
		{
			WriteHeader (new HeaderField (FieldCode.Path, opath), new HeaderField (FieldCode.Interface, iface), new HeaderField (FieldCode.Member, member), new HeaderField (FieldCode.Destination, dest), new HeaderField (FieldCode.Signature, sig));
		}


		public static void Close (Stream stream)
		{<commit_msg>Fix bit ops<commit_after>// Copyright 2006 <NAME> <<EMAIL>>
// This software is made available under the MIT License
// See COPYING for details

using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.IO;
using System.Net.Sockets;
using System.Runtime.InteropServices;

//for filling padding with random
//using System.Security.Cryptography;

//using Console = System.Diagnostics.Trace;

namespace NDesk.DBus
{
	public unsafe class Message
	{
		public DHeader* Header;

		public int HeaderSize;
		public byte[] HeaderData;

		public MessageType MessageType
		{
			get {
				return Header->MessageType;
			} set {
				Header->MessageType = value;
			}
		}

		public uint Serial
		{
			get {
				return Header->Serial;
			} set {
				Header->Serial = value;
			}
		}

		public bool ReplyExpected
		{
			get {
				return (Header->Flags & HeaderFlag.NoReplyExpected) != HeaderFlag.NoReplyExpected;
			} set {
				if (value)
					Header->Flags &= ~HeaderFlag.NoReplyExpected; //flag off
				else
					Header->Flags |= ~HeaderFlag.NoReplyExpected; //flag on
			}
		}

		public HeaderField[] HeaderFields;
		//public Dictionary<FieldCode,object>;


		public MemoryStream Body;
		//public byte[] Data;
		//public int DataSize;

		public bool Locked;


		//temporary convenience methods
		public void WriteHeader (ObjectPath opath, string iface, string member, string dest)
		{
			WriteHeader (new HeaderField (FieldCode.Path, opath), new HeaderField (FieldCode.Interface, iface), new HeaderField (FieldCode.Member, member), new HeaderField (FieldCode.Destination, dest));
		}

		public void WriteHeader (ObjectPath opath, string iface, string member, string dest, Signature sig)
		{
			WriteHeader (new HeaderField (FieldCode.Path, opath), new HeaderField (FieldCode.Interface, iface), new HeaderField (FieldCode.Member, member), new HeaderField (FieldCode.Destination, dest), new HeaderField (FieldCode.Signature, sig));
		}


		public static void Close (Stream stream)
		{
{'fraction_non_alphanumeric': 0.10160818713450293, 'fraction_numerical': 0.001949317738791423, 'mean_word_length': 3.7129735935706085, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7099246', 'n_tokens_mistral': 1369, 'n_tokens_neox': 1177, 'n_words': 376}