File: //lib/python3.9/site-packages/elftools/construct/__pycache__/macros.cpython-39.opt-1.pyc
a
�#�_�S � @ s� d dl mZ d dlmZmZmZmZ d dlmZm Z m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZmZmZmZmZ d dlmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$ dd� Z%d�d d
�Z&d�dd
�Z'd�dd�Z(dd� Z)dd� Z*dd� Z+dd� Z,dd� Z-dd� Z.dd� Z/dd � Z0d!d"� Z1d#d$� Z2d%d&� Z3d'd(� Z4d)d*� Z5d+d,� Z6d-d.� Z7d/d0� Z8d1d2� Z9d3d4� Z:d5d6� Z;d7d8� Z<d9d:� Z=d;d<� Z>d=d>� Z?d?d@� Z@dAdB� ZAdCdD� ZBdEdF� ZCdGdH� ZDdIdJ� ZEdKdL� ZFdMdN� ZGdOdP� ZHdQdR� ZIdSdT� ZJe,dU�fdVdW�ZKdXdY� ZLdZd[� ZMd\d]� ZNd^d_� ZOd`da� ZPd�dcdd�ZQdedf� ZRdgdh� ZSdidj� ZTdkdl� ZUeVfdmdn�ZWdodp� ZXdqdr� ZYdsdt� ZZdudv� Z[dwdx� Z\d�d{d|�Z]e,dU�dyfd}d~�Z^ddye%dyd �fdd��Z_d�d�� Z`d�d�d��Zad�d�d��Zbd�d�� ZcdyS )�� )�int2byte)�BitStreamReader�BitStreamWriter�
encode_bin�
decode_bin)�Struct� MetaField�StaticField�FormatField�OnDemand�Pointer�Switch�Value�RepeatUntil� MetaArray�Sequence�Range�Select�Pass�SizeofError�Buffered�Restream�Reconfig)
�BitIntegerAdapter�PaddingAdapter�ConstAdapter�CStringAdapter�LengthValueAdapter�IndexingAdapter�PaddedStringAdapter�FlagsAdapter�
StringAdapter�MappingAdapterc C s t |�rt| |�S t| |�S dS )a*
A field consisting of a specified number of bytes.
:param str name: the name of the field
:param length: the length of the field. the length can be either an integer
(StaticField), or a function that takes the context as an argument and
returns the length (MetaField)
N)�callabler r )�name�length� r&