<commit_before>/*
 * libosengine - A synchronization engine for the opensync framework
 * Copyright (C) 2004-2005  <NAME> <<EMAIL>>
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library 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
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
 * 
 */
 
#ifndef OPENSYNC_OBJ_ENGINE_INTERNALS_H_
#define OPENSYNC_OBJ_ENGINE_INTERNALS_H_

struct OSyncObjEngine {
	/** Reference counting */
	int ref_count;
	
	/** Pointer to (parent) OSyncEngine */
	OSyncEngine *parent;

	/** The object type of this Object Engine **/
	char *objtype;

	/** Status of Slow Sync **/
	osync_bool slowsync;

	/** Pointer to assinged OSyncArchive */
	OSyncArchive *archive;
	
	/** Pointer to assinged OSyncMappingTable */
	OSyncMappingTable *mapping_table;

	/** List of OSyncMappingEngine-elemenets */
	OSyncList *mapping_engines;
	
	/** List of OSyncSinkEngine-elements */
	OSyncList *sink_engines;

	/** List of Active OSyncSinkEngine-elements */
	OSyncList *active_sink_engines;

	/** List of Dummy OSyncSinkEngine-elements */
	OSyncList *dummy_sink_engines;

	/** Pointer to OSyncObjEngine assinged error struct */
	OSyncError *error;
	/** Pointer to format enviornment */
	OSyncFormatEnv *formatenv;
	
	/** Total number of Sink Engine errors */
	int sink_errors;
	/** Total number of initiated connections */
	int sink_connects;
	/** Total number of finalized connections */
	int sink_connect_done;
	/** Total number of disconnects */
	int sink_disconnects;
	/** Total number of get latest changes/all recores calls */
	int sink_get_changes;
	/** Total number of completed synchronization */
	int sink_sync_done;
	/** Total number of completed write-/commit-phases */
	int sink_written;
	
	/** Callback to give feedback to (parent) OSyncEngine */ 
	OSyncObjEngineEventCallback callback;
	/** Userdata poitner of callback */
	void *callback_userdata;
	
	/** List of OSyncMappingEngine-elements with pending conflicts */
	OSyncList *conflicts;

	/** Written status of Object Engine. - TODO: Is this still needed?! **/
	osync_bool written;

	/** Conflicts already solved */
	osync_bool conflicts_solved;
};

OSyncMappingEngine *_osync_obj_engine_create_mapping_engine(OSyncObjEngine *engine, OSyncError **error);<commit_msg>Added explanatory comments for bit count totals in OSyncObjEngine<commit_after>/*
 * libosengine - A synchronization engine for the opensync framework
 * Copyright (C) 2004-2005  <NAME> <<EMAIL>>
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library 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
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
 * 
 */
 
#ifndef OPENSYNC_OBJ_ENGINE_INTERNALS_H_
#define OPENSYNC_OBJ_ENGINE_INTERNALS_H_

struct OSyncObjEngine {
	/** Reference counting */
	int ref_count;
	
	/** Pointer to (parent) OSyncEngine */
	OSyncEngine *parent;

	/** The object type of this Object Engine **/
	char *objtype;

	/** Status of Slow Sync **/
	osync_bool slowsync;

	/** Pointer to assinged OSyncArchive */
	OSyncArchive *archive;
	
	/** Pointer to assinged OSyncMappingTable */
	OSyncMappingTable *mapping_table;

	/** List of OSyncMappingEngine-elemenets */
	OSyncList *mapping_engines;
	
	/** List of OSyncSinkEngine-elements */
	OSyncList *sink_engines;

	/** List of Active OSyncSinkEngine-elements */
	OSyncList *active_sink_engines;

	/** List of Dummy OSyncSinkEngine-elements */
	OSyncList *dummy_sink_engines;

	/** Pointer to OSyncObjEngine assinged error struct */
	OSyncError *error;
	/** Pointer to format enviornment */
	OSyncFormatEnv *formatenv;
	
	/* Note that by "bit count total", we mean that the status of each
	 * sink_engine is represented by its corresponding bit.  That is,
	 * the first sink engine in the above list will have its state
	 * represented by bit 0 in the following variables. */

	/** Bit count total number of Sink Engine errors */
	int sink_errors;
	/** Bit count total number of initiated connections */
	int sink_connects;
	/** Bit count total number of finalized connections */
	int sink_connect_done;
	/** Bit count total number of disconnects */
	int sink_disconnects;
	/** Bit count total number of get latest changes/all records calls */
	int sink_get_changes;
	/** Bit count total number of completed synchronization */
	int sink_sync_done;
	/** Bit count total number of completed write-/commit-phases */
	int sink_written;
	
	/** Callback to give feedback to (parent) OSyncEngine */ 
	OSyncObjEngineEventCallback callback;
	/** Userdata poitner of callback */
	void *callback_userdata;
	
	/** List of OSyncMappingEngine-elements with pending conflicts */
	OSyncList *conflicts;

	/** Written status of Object Engine. - TODO: Is this still needed?! **/
	osync_bool written;

	/** Conflicts already solved */
	osync_bool conflicts_solved;
};

OSyncMappingEngine *_osync_obj_engine_create_mapping_engine(OSyncObjEngine *engine, OSyncError **error);
{'fraction_non_alphanumeric': 0.08325057927838464, 'fraction_numerical': 0.008109897384971863, 'mean_word_length': 4.160546541417592, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '406905', 'n_tokens_mistral': 1832, 'n_tokens_neox': 1711, 'n_words': 675}