<commit_before>// @(#)root/proofd:$Name:  $:$Id: XProofProtUtils.cxx,v 1.7 2006/10/19 14:53:24 rdm Exp $
// Author: <NAME>  12/12/2005

/*************************************************************************
 * Copyright (C) 1995-2005, <NAME> and <NAME>.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// XProofProtUtils.cxx                                                  //
//                                                                      //
// Authors: <NAME>, CERN 2005                                         //
//                                                                      //
// Utility functions prototypes for client-to-server                    //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifdef __APPLE__
#   ifndef __macos__
#      define __macos__
#   endif
#endif

#include <netinet/in.h>
#include "XrdSys/XrdSysPlatform.hh"
#include "XProofProtocol.h"
#include "XProofProtUtils.h"
#include "Bytes.h"


namespace XPD {

//___________________________________________________________________________
int clientMarshall(XPClientRequest* str)
{
   // This function applies the network byte order on those
   // parts of the 16-bytes buffer, only if it is composed
   // by some binary part
   // Return 0 if OK, -1 in case the ID is unknown

   switch(str->header.requestid) {

   case kXP_login:
      str->login.pid = htonl(str->login.pid);
      break;
   case kXP_auth:
      // no swap on ASCII fields
      break;
   case kXP_create:
      // no swap on ASCII fields
      str->proof.int1 = htonl(str->proof.int1);
      break;
   case kXP_destroy:<commit_msg>From Bertrand: Fix a compilation error under Windows<commit_after>// @(#)root/proofd:$Name:  $:$Id: XProofProtUtils.cxx,v 1.8 2006/12/03 23:34:04 rdm Exp $
// Author: <NAME>  12/12/2005

/*************************************************************************
 * Copyright (C) 1995-2005, <NAME> and <NAME>.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// XProofProtUtils.cxx                                                  //
//                                                                      //
// Authors: <NAME>, CERN 2005                                         //
//                                                                      //
// Utility functions prototypes for client-to-server                    //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifdef __APPLE__
#   ifndef __macos__
#      define __macos__
#   endif
#endif
#ifndef WIN32
#include <netinet/in.h>
#endif
#include "XrdSys/XrdSysPlatform.hh"
#include "XProofProtocol.h"
#include "XProofProtUtils.h"
#include "Bytes.h"


namespace XPD {

//___________________________________________________________________________
int clientMarshall(XPClientRequest* str)
{
   // This function applies the network byte order on those
   // parts of the 16-bytes buffer, only if it is composed
   // by some binary part
   // Return 0 if OK, -1 in case the ID is unknown

   switch(str->header.requestid) {

   case kXP_login:
      str->login.pid = htonl(str->login.pid);
      break;
   case kXP_auth:
      // no swap on ASCII fields
      break;
   case kXP_create:
      // no swap on ASCII fields
      str->proof.int1 = htonl(str->proof.int1);
      break;
   case kXP_destroy:
{'fraction_non_alphanumeric': 0.2126372395249832, 'fraction_numerical': 0.019269549630293526, 'mean_word_length': 1.1116367076631977, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 42, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6588497', 'n_tokens_mistral': 1067, 'n_tokens_neox': 938, 'n_words': 263}