<commit_before>
#ifndef AT_BLUETOOTH_H
#define AT_BLUETOOTH_H


// Because bluetooth implementations build it on top of the socket
// libraries, we can't doubly define here (or we get linking errors)
// so we will reference the networking stuff (from atNetwork.c++) here 
// and then only define Bluetooth-specific elements here (constants, etc.)
#include "atNetwork.h++"
#include "atSymbols.h++"


// Under Windows, define stuff that we need
#ifdef _MSC_VER
    #define WIN32_LEAN_AND_MEAN
    #include <bthsdpdef.h>
    #include <bluetoothapis.h>
    #include <winsock2.h>
    #include <ws2bth.h>
    #undef WIN32_LEAN_AND_MEAN

    #define AF_BLUETOOTH     AF_BTH
    #define BTPROTO_RFCOMM   BTHPROTO_RFCOMM
    #define BTPROTO_L2CAP    BTHPROTO_L2CAP

    typedef SOCKADDR_BTH   BluetoothSockAddr;

   // FUNCTIONS
   #ifdef __cplusplus
      extern "C"
      {
         ATLAS_SYM int ba2str(const bdaddr_t * btaddr, char * straddr);
         ATLAS_SYM int str2ba(const char * straddr, bdaddr_t * btaddr);
      }
   #else
      ATLAS_SYM int ba2str(const bdaddr_t * btaddr, char * straddr);
      ATLAS_SYM int str2ba(const char * straddr, bdaddr_t * btaddr);
   #endif
#else
    #include <bluetooth/bluetooth.h>
    #include <bluetooth/rfcomm.h>
    #include <bluetooth/l2cap.h>

    typedef sockaddr_rc   BluetoothSockAddr;
#endif


#ifdef __cplusplus
   extern "C"
   {
      ATLAS_SYM void   setBTAddress(BluetoothSockAddr * btAddr, 
                                    char * address, u_char channel);
      ATLAS_SYM void   getBTAddress(BluetoothSockAddr * btAddr, 
                                    char * address);
      ATLAS_SYM void   getBTChannel(BluetoothSockAddr * btAddr, 
                                    u_char * channel);
   }

   // These are defined in atNetwork.c++
   extern "C"
   {
      void   initNetwork();
      void   cleanupNetwork();

      Socket   openSocket(int domain, int type, int protocol);
      void     closeSocket(Socket socket);

      void   setBlockingFlag(Socket socket, bool block);
      bool   getBlockingFlag(Socket socket);
   }
#else
   ATLAS_SYM void   setBTAddress(BluetoothSockAddr * btAddr, 
                                 char * address, u_char channel);
   ATLAS_SYM void   getBTAddress(BluetoothSockAddr * btAddr, char * address);
   ATLAS_SYM void   getBTChannel(BluetoothSockAddr * btAddr, u_char * channel);


   // These are defined in atNetwork.c++
   extern
   {
      void   initNetwork();
      void   cleanupNetwork();

      Socket   openSocket(int domain, int type, int protocol);
      void     closeSocket(Socket socket);

      void   setBlockingFlag(Socket socket, bool block);
      bool   getBlockingFlag(Socket socket);
   }
#endif


#endif
<commit_msg>Added missing functions and a definition to the header<commit_after>
#ifndef AT_BLUETOOTH_H
#define AT_BLUETOOTH_H


// Because bluetooth implementations build it on top of the socket
// libraries, we can't doubly define here (or we get linking errors)
// so we will reference the networking stuff (from atNetwork.c++) here 
// and then only define Bluetooth-specific elements here (constants, etc.)
#include "atNetwork.h++"
#include "atSymbols.h++"


// Under Windows, define stuff that we need
#ifdef _MSC_VER
    #define WIN32_LEAN_AND_MEAN
    #include <bthsdpdef.h>
    #include <bluetoothapis.h>
    #include <winsock2.h>
    #include <ws2bth.h>
    #undef WIN32_LEAN_AND_MEAN

    #define AF_BLUETOOTH     AF_BTH
    #define BTPROTO_RFCOMM   BTHPROTO_RFCOMM
    #define BTPROTO_L2CAP    BTHPROTO_L2CAP

    #define bdaddr_t         BTH_ADDR

    typedef SOCKADDR_BTH   BluetoothSockAddr;

   // FUNCTIONS
   #ifdef __cplusplus
      extern "C"
      {
         ATLAS_SYM int ba2str(const bdaddr_t * btaddr, char * straddr);
         ATLAS_SYM int str2ba(const char * straddr, bdaddr_t * btaddr);
      }
   #else
      ATLAS_SYM int ba2str(const bdaddr_t * btaddr, char * straddr);
      ATLAS_SYM int str2ba(const char * straddr, bdaddr_t * btaddr);
   #endif
#else
    #include <bluetooth/bluetooth.h>
    #include <bluetooth/rfcomm.h>
    #include <bluetooth/l2cap.h>

    typedef sockaddr_rc   BluetoothSockAddr;
#endif


#ifdef __cplusplus
   extern "C"
   {
      #ifdef _MSC_VER

         ATLAS_SYM int   ba2str(const bdaddr_t * btaddr, char * straddr);
         ATLAS_SYM int   str2ba(const char * straddr, bdaddr_t * btaddr);

      #endif


      ATLAS_SYM void   setBTAddress(BluetoothSockAddr * btAddr, 
                                    char * address, u_char channel);
      ATLAS_SYM void   getBTAddress(BluetoothSockAddr * btAddr, 
                                    char * address);
      ATLAS_SYM void   getBTChannel(BluetoothSockAddr * btAddr, 
                                    u_char * channel);
   }

   // These are defined in atNetwork.c++
   extern "C"
   {
      void   initNetwork();
      void   cleanupNetwork();

      Socket   openSocket(int domain, int type, int protocol);
      void     closeSocket(Socket socket);

      void   setBlockingFlag(Socket socket, bool block);
      bool   getBlockingFlag(Socket socket);
   }
#else

   #ifdef _MSC_VER

      ATLAS_SYM int   ba2str(const bdaddr_t * btaddr, char * straddr);
      ATLAS_SYM int   str2ba(const char * straddr, bdaddr_t * btaddr);

   #endif


   ATLAS_SYM void   setBTAddress(BluetoothSockAddr * btAddr, 
                                 char * address, u_char channel);
   ATLAS_SYM void   getBTAddress(BluetoothSockAddr * btAddr, char * address);
   ATLAS_SYM void   getBTChannel(BluetoothSockAddr * btAddr, u_char * channel);


   // These are defined in atNetwork.c++
   extern
   {
      void   initNetwork();
      void   cleanupNetwork();

      Socket   openSocket(int domain, int type, int protocol);
      void     closeSocket(Socket socket);

      void   setBlockingFlag(Socket socket, bool block);
      bool   getBlockingFlag(Socket socket);
   }
#endif


#endif

{'fraction_non_alphanumeric': 0.07910271546635184, 'fraction_numerical': 0.005059875189745319, 'mean_word_length': 2.559423769507803, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5172665', 'n_tokens_mistral': 2005, 'n_tokens_neox': 1894, 'n_words': 509}