Rizin
unix-like reverse engineering framework and cli tools
create_zip_err_str Namespace Reference

Functions

def getcomment (x)
 
def def2errstr (x)
 
def def2errdetail (x)
 

Variables

string TEMPLATE
 
 zip_err_str_c = sys.argv[1]
 
 zip_h = sys.argv[2]
 
 zipint_h = sys.argv[3]
 
list defines = [l for l in open(zip_h, 'r').read().split('\n') if l.startswith('#define ZIP_ER')]
 
string zip_err_strs = '\n'.join([def2errstr(x) + ',' for x in defines])
 
string zip_err_details = '\n'.join([def2errdetail(x) + ',' for x in defines])
 

Function Documentation

◆ def2errdetail()

def create_zip_err_str.def2errdetail (   x)

Definition at line 48 of file create_zip_err_str.py.

48 def def2errdetail(x):
49  comment = getcomment(x)
50  val = comment.split(' ')[0]
51  comment_str = comment.split(' ')[1]
52  return f'{{{val}, "{comment_str}"}}'
53 

References getcomment().

◆ def2errstr()

def create_zip_err_str.def2errstr (   x)

Definition at line 42 of file create_zip_err_str.py.

42 def def2errstr(x):
43  comment = getcomment(x)
44  val = comment.split(' ')[0]
45  comment_str = comment.split(' ')[1]
46  return f'{{{val}, "{comment_str}"}}'
47 

References getcomment().

◆ getcomment()

def create_zip_err_str.getcomment (   x)

Definition at line 39 of file create_zip_err_str.py.

39 def getcomment(x):
40  return x[x.index('/* ') + 3:x.index('*/')]
41 

Referenced by def2errdetail(), and def2errstr().

Variable Documentation

◆ defines

list create_zip_err_str.defines = [l for l in open(zip_h, 'r').read().split('\n') if l.startswith('#define ZIP_ER')]

Definition at line 54 of file create_zip_err_str.py.

◆ TEMPLATE

string create_zip_err_str.TEMPLATE
Initial value:
1 = '''/*
2  This file was auto-generated by Meson from zip.h and zipint.h
3 */
4 
5 #include "zipint.h"
6 
7 #define L ZIP_ET_LIBZIP
8 #define N ZIP_ET_NONE
9 #define S ZIP_ET_SYS
10 #define Z ZIP_ET_ZLIB
11 
12 #define E ZIP_DETAIL_ET_ENTRY
13 #define G ZIP_DETAIL_ET_GLOBAL
14 
15 const struct _zip_err_info _zip_err_str[] = {{
16 {zip_err_strs}
17 }};
18 
19 const int _zip_err_str_count = sizeof(_zip_err_str)/sizeof(_zip_err_str[0]);
20 
21 const struct _zip_err_info _zip_err_details[] = {{
22 {zip_err_details}
23 }};
24 
25 const int _zip_err_details_count = sizeof(_zip_err_details)/sizeof(_zip_err_details[0]);
26 '''

Definition at line 8 of file create_zip_err_str.py.

◆ zip_err_details

string create_zip_err_str.zip_err_details = '\n'.join([def2errdetail(x) + ',' for x in defines])

Definition at line 58 of file create_zip_err_str.py.

◆ zip_err_str_c

create_zip_err_str.zip_err_str_c = sys.argv[1]

Definition at line 35 of file create_zip_err_str.py.

◆ zip_err_strs

string create_zip_err_str.zip_err_strs = '\n'.join([def2errstr(x) + ',' for x in defines])

Definition at line 55 of file create_zip_err_str.py.

◆ zip_h

create_zip_err_str.zip_h = sys.argv[2]

Definition at line 36 of file create_zip_err_str.py.

◆ zipint_h

create_zip_err_str.zipint_h = sys.argv[3]

Definition at line 37 of file create_zip_err_str.py.