# Path: stator/lib.py

# 
# Path: stator/util.py
# def convert_ip(host):
#     match = IP_ADDRESS_RE.match(host)
#     if not match:
#         raise ValueError(
#             "Ip address string required, got {!r}".format(host))
#     parts = list(map(int, match.groups()))
#     if any(p > 255 for p in parts):
#         raise ValueError(
#             "Ip address string required, got {!r}".format(host))
#     return (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8) | parts[3]


import os
from  ctypes import c_uint32, c_uint16, c_ssize_t, c_char_p
from  ctypes import c_size_t, c_uint64, c_int64, c_double
from .lib import dll
from .util import convert_ip


dll.stator_carbon_connect_ipv4.argtypes = [c_uint32, c_uint16]
dll.stator_carbon_connect_ipv4.restype = c_uint64

dll.stator_carbon_add_i64.argtypes = [c_ssize_t, c_char_p, c_size_t, c_int64]
dll.stator_carbon_add_i64.restype = None
dll.stator_carbon_add_i64_at.argtypes = [c_ssize_t, c_char_p, c_size_t,
                                  c_int64, c_uint64]
dll.stator_carbon_add_i64_at.restype = None

dll.stator_carbon_add_f64.argtypes = [c_ssize_t, c_char_p, c_size_t, c_double]
dll.stator_carbon_add_f64.restype = None
dll.stator_carbon_add_f64_at.argtypes = [c_ssize_t, c_char_p, c_size_t,
                                  c_double, c_uint64]
dll.stator_carbon_add_f64_at.restype = None


default_instance = None


class CantCreateConnection(Exception):
    pass



# Path: stator/lib.py

# 
# Path: stator/util.py
# def convert_ip(host):
#     match = IP_ADDRESS_RE.match(host)
#     if not match:
#         raise ValueError(
#             "Ip address string required, got {!r}".format(host))
#     parts = list(map(int, match.groups()))
#     if any(p > 255 for p in parts):
#         raise ValueError(
#             "Ip address string required, got {!r}".format(host))
#     return (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8) | parts[3]


# Path: stator/carbon.py
import os
from  ctypes import c_uint32, c_uint16, c_ssize_t, c_char_p
from  ctypes import c_size_t, c_uint64, c_int64, c_double
from .lib import dll
from .util import convert_ip



dll.stator_carbon_connect_ipv4.argtypes = [c_uint32, c_uint16]
dll.stator_carbon_connect_ipv4.restype = c_uint64

dll.stator_carbon_add_i64.argtypes = [c_ssize_t, c_char_p, c_size_t, c_int64]
dll.stator_carbon_add_i64.restype = None
dll.stator_carbon_add_i64_at.argtypes = [c_ssize_t, c_char_p, c_size_t,
                                  c_int64, c_uint64]
dll.stator_carbon_add_i64_at.restype = None

dll.stator_carbon_add_f64.argtypes = [c_ssize_t, c_char_p, c_size_t, c_double]
dll.stator_carbon_add_f64.restype = None
dll.stator_carbon_add_f64_at.argtypes = [c_ssize_t, c_char_p, c_size_t,
                                  c_double, c_uint64]
dll.stator_carbon_add_f64_at.restype = None


default_instance = None


class CantCreateConnection(Exception):
    pass



class Carbon(object):