<commit_before>// This file is part of Poseidon.
// Copyleft 2020, LH_Mouse. All wrongs reserved.

#ifndef POSEIDON_NETWORK_ENUMS_HPP_
#define POSEIDON_NETWORK_ENUMS_HPP_

#include "../fwd.hpp"

namespace poseidon {

// This is the return type of I/O functions.
// `io_result_not_eof` may be returned to indicate success of a
// non-stream operation, such as `accept()` or `recvfrom()`.
// I/O functions shall throw exceptions for errors that are not
// listed here.
// Note that positive values denote number of bytes transferred.
enum IO_Result : ptrdiff_t
  {
    io_result_again    = -1,  // EAGAIN or EWOULDBLOCK
    io_result_eof      =  0,
    io_result_not_eof  =  1,  // EINTR
  };

// This describes the lifetime of a connection.
// It is mainly designed for stream-oriented protocols such as
// TCP and SCTP.
enum Connection_State : uint8_t
  {
    connection_state_initial      = 0,  // W allowed
    connection_state_connecting   = 1,  // W allowed
    connection_state_established  = 2,  // R/W allowed
    connection_state_closing      = 3,  // R/W forbidden
    connection_state_closed       = 4,  // R/W forbidden
  };

}  // namespace poseidon

#endif
<commit_msg>network/enums: Change the value of `io_result_not_eof`<commit_after>// This file is part of Poseidon.
// Copyleft 2020, LH_Mouse. All wrongs reserved.

#ifndef POSEIDON_NETWORK_ENUMS_HPP_
#define POSEIDON_NETWORK_ENUMS_HPP_

#include "../fwd.hpp"

namespace poseidon {

// This is the return type of I/O functions.
// `io_result_not_eof` may be returned to indicate success of a
// non-stream operation, such as `accept()` or `recvfrom()`.
// I/O functions shall throw exceptions for errors that are not
// listed here.
// Note that positive values denote number of bytes transferred.
enum IO_Result : ptrdiff_t
  {
    io_result_again    = -1,  // EAGAIN or EWOULDBLOCK
    io_result_eof      =  0,
    io_result_not_eof  =  PTRDIFF_MAX,  // EINTR
  };

// This describes the lifetime of a connection.
// It is mainly designed for stream-oriented protocols such as
// TCP and SCTP.
enum Connection_State : uint8_t
  {
    connection_state_initial      = 0,  // W allowed
    connection_state_connecting   = 1,  // W allowed
    connection_state_established  = 2,  // R/W allowed
    connection_state_closing      = 3,  // R/W forbidden
    connection_state_closed       = 4,  // R/W forbidden
  };

}  // namespace poseidon

#endif

{'fraction_non_alphanumeric': 0.08944099378881988, 'fraction_numerical': 0.010351966873706004, 'mean_word_length': 2.9541734860883797, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3688516', 'n_tokens_mistral': 834, 'n_tokens_neox': 786, 'n_words': 253}