<commit_before>/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
 *     Copyright 2013 Couchbase, Inc
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */
#pragma once

#include <platform/cbassert.h>
#include <platform/dynamic.h>

#ifdef WIN32
/* Include winsock2.h before windows.h to avoid winsock.h to be included */
#define NOMINMAX
#include <winsock2.h>
#include <windows.h>
#else
#include <pthread.h>
#include <sys/time.h>
#endif

#include <time.h>
#include <stdio.h>
#include <stdint.h>
#include <platform/visibility.h>

#ifdef __sun
#include <arpa/inet.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

#ifdef WIN32
    typedef DWORD cb_thread_t;
    typedef CRITICAL_SECTION cb_mutex_t;
    typedef CONDITION_VARIABLE cb_cond_t;
    typedef long ssize_t;
    typedef unsigned __int64 hrtime_t;
#define CB_DONT_NEED_BYTEORDER 1
#define DIRECTORY_SEPARATOR_CHARACTER '\\'

#else

#define DIRECTORY_SEPARATOR_CHARACTER '/'

    typedef pthread_t cb_thread_t;
    typedef pthread_mutex_t cb_mutex_t;
    typedef pthread_cond_t cb_cond_t;

#ifndef __sun
    typedef uint64_t hrtime_t;
#endif

#endif

    /***********************************************************************
     *                     Thread related functions                        *
     **********************************************************************/<commit_msg>Add CB_MUST_USE_RESULT function decoractor<commit_after>/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
 *     Copyright 2013 Couchbase, Inc
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */
#pragma once

#include <platform/cbassert.h>
#include <platform/dynamic.h>

#ifdef WIN32
/* Include winsock2.h before windows.h to avoid winsock.h to be included */
#define NOMINMAX
#include <winsock2.h>
#include <windows.h>
#else
#include <pthread.h>
#include <sys/time.h>
#endif

#include <time.h>
#include <stdio.h>
#include <stdint.h>
#include <platform/visibility.h>

#ifdef __sun
#include <arpa/inet.h>
#endif

/* Function attribute to be used where the return value should not be
 * ignored by the caller. For example: allocation functions where the
 * caller should free the result after use.
 */
#if HAVE_ATTR_WARN_UNUSED_RESULT
#define CB_MUST_USE_RESULT __attribute__((warn_unused_result))
#else
#define CB_MUST_USE_RESULT
#endif

#ifdef __cplusplus
extern "C" {
#endif

#ifdef WIN32
    typedef DWORD cb_thread_t;
    typedef CRITICAL_SECTION cb_mutex_t;
    typedef CONDITION_VARIABLE cb_cond_t;
    typedef long ssize_t;
    typedef unsigned __int64 hrtime_t;
#define CB_DONT_NEED_BYTEORDER 1
#define DIRECTORY_SEPARATOR_CHARACTER '\\'

#else

#define DIRECTORY_SEPARATOR_CHARACTER '/'

    typedef pthread_t cb_thread_t;
    typedef pthread_mutex_t cb_mutex_t;
    typedef pthread_cond_t cb_cond_t;

#ifndef __sun
    typedef uint64_t hrtime_t;
#endif

#endif

    /***********************************************************************
     *                     Thread related functions                        *
     **********************************************************************/
{'fraction_non_alphanumeric': 0.1502640422467595, 'fraction_numerical': 0.010081613058089293, 'mean_word_length': 3.8117782909930717, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4122117', 'n_tokens_mistral': 1303, 'n_tokens_neox': 1258, 'n_words': 409}