third_party/android_crazy_linker/src/tests/pylib/source_utils.py
def CSourceForIntegerHexArray(values, num_bits, margin=4, width=80):
  """Turn an array of integers into a C source array data definition.

  Args:
    values: An array of integers.
    num_bits: The number of bits of said integers (i.e. 8, 16, 32 or 64).
    margin: Left-side margin / indentation level (must be > 0).
    width: Maximum line width.
  Returns:
    A string containing the data definition as a C source fragment.
  """
  chars_per_word = num_bits / 4
  format_str = ' 0x%%0%dx' % chars_per_word
  out = CSourceForArrayData(values, lambda x: format_str % x,
                            margin - 1, width)
  out += ',\n'
  return out
Turn an array of integers into a C source array data definition.

  Args:
    values: An array of integers.
    num_bits: The number of bits of said integers (i.e. 8, 16, 32 or 64).
    margin: Left-side margin / indentation level (must be > 0).
    width: Maximum line width.
  Returns:
    A string containing the data definition as a C source fragment.
  
Turn an array of integers into a C source array data definition.
Turn an array of integers into a C source array data definition .
def CSourceForIntegerHexArray(values, num_bits, margin=4, width=80):
  chars_per_word = num_bits / 4
  format_str = ' 0x%%0%dx' % chars_per_word
  out = CSourceForArrayData(values, lambda x: format_str % x,
                            margin - 1, width)
  out += ',\n'
  return out
def CSourceForIntegerHexArray ( values , num_bits , margin = 4 , width = 80 ) : chars_per_word = num_bits / 4 format_str = ' 0x%%0%dx' % chars_per_word out = CSourceForArrayData ( values , lambda x : format_str % x , margin - 1 , width ) out += ',\n' return out
Turn an array of integers into a C source array data definition.
Turn an array of integers into a C source array data definition .
"""Turn an array of integers into a C source array data definition.

  Args:
    values: An array of integers.
    num_bits: The number of bits of said integers (i.e. 8, 16, 32 or 64).
    margin: Left-side margin / indentation level (must be > 0).
    width: Maximum line width.
  Returns:
    A string containing the data definition as a C source fragment.
  """
A string containing the data definition as a C source fragment.
A string containing the data definition as a C source fragment .
values
An array of integers.
An array of integers .
num_bits
The number of bits of said integers .
The number of bits of said integers .
margin
Left-side margin / indentation level (must be > 0).
Left - side margin / indentation level ( must be > 0 ) .
width
Maximum line width.
Maximum line width .