<commit_before>/*
 * D-Bus Messages
 */

#include <c-dvar.h>
#include <c-dvar-type.h>
#include <c-macro.h>
#include <c-ref.h>
#include <endian.h>
#include <stdlib.h>
#include "dbus/message.h"
#include "dbus/protocol.h"
#include "dbus/unique-name.h"
#include "util/fdlist.h"
#include "util/error.h"

static_assert(_DBUS_MESSAGE_FIELD_N <= 8 * sizeof(unsigned int), "Header fields exceed bitmap");

static int message_new(Message **messagep, bool big_endian, size_t n_extra) {
        _c_cleanup_(message_unrefp) Message *message = NULL;

        message = malloc(sizeof(*message) + c_align8(n_extra));
        if (!message)
                return error_origin(-ENOMEM);

        message->n_refs = C_REF_INIT;
        message->big_endian = big_endian;
        message->allocated_data = false;
        message->parsed = false;
        message->sender_id = UNIQUE_NAME_ID_INVALID;
        message->fds = NULL;
        message->n_data = 0;
        message->n_copied = 0;
        message->n_header = 0;
        message->n_body = 0;
        message->data = NULL;
        message->header = NULL;
        message->body = NULL;
        message->original_sender = NULL;

        *messagep = message;
        message = NULL;
        return 0;
}

/**
 * message_new_incoming() - XXX
 */
int message_new_incoming(Message **messagep, MessageHeader header) {
        _c_cleanup_(message_unrefp) Message *message = NULL;
        uint64_t n_header, n_body, n_data;
        int r;
<commit_msg>message: always initialize path/interface/member fields<commit_after>/*
 * D-Bus Messages
 */

#include <c-dvar.h>
#include <c-dvar-type.h>
#include <c-macro.h>
#include <c-ref.h>
#include <endian.h>
#include <stdlib.h>
#include "dbus/message.h"
#include "dbus/protocol.h"
#include "dbus/unique-name.h"
#include "util/fdlist.h"
#include "util/error.h"

static_assert(_DBUS_MESSAGE_FIELD_N <= 8 * sizeof(unsigned int), "Header fields exceed bitmap");

static int message_new(Message **messagep, bool big_endian, size_t n_extra) {
        _c_cleanup_(message_unrefp) Message *message = NULL;

        message = malloc(sizeof(*message) + c_align8(n_extra));
        if (!message)
                return error_origin(-ENOMEM);

        message->n_refs = C_REF_INIT;
        message->big_endian = big_endian;
        message->allocated_data = false;
        message->parsed = false;
        message->sender_id = UNIQUE_NAME_ID_INVALID;
        message->fds = NULL;
        message->n_data = 0;
        message->n_copied = 0;
        message->n_header = 0;
        message->n_body = 0;
        message->data = NULL;
        message->header = NULL;
        message->path = NULL;
        message->interface = NULL;
        message->member = NULL;
        message->body = NULL;
        message->original_sender = NULL;

        *messagep = message;
        message = NULL;
        return 0;
}

/**
 * message_new_incoming() - XXX
 */
int message_new_incoming(Message **messagep, MessageHeader header) {
        _c_cleanup_(message_unrefp) Message *message = NULL;
        uint64_t n_header, n_body, n_data;
        int r;

{'fraction_non_alphanumeric': 0.1286038224813735, 'fraction_numerical': 0.0058309037900874635, 'mean_word_length': 2.7704517704517704, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 46, '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': '4779909', 'n_tokens_mistral': 1050, 'n_tokens_neox': 1023, 'n_words': 216}