Changeset 6048

Show
Ignore:
Timestamp:
04/26/12 12:10:22 (13 months ago)
Author:
khali
Message:

i2c-dev: Move SMBus helper functions to include/i2c/smbus.h

Location:
i2c-tools/trunk
Files:
15 modified

Legend:

Unmodified
Added
Removed
  • i2c-tools/trunk/CHANGES

    r6047 r6048  
    66                Decode bus width extension of DDR3 SDRAM 
    77  i2c-dev.h: Minimize differences with kernel flavor 
     8             Move SMBus helper functions to include/i2c/smbus.h 
    89  i2c-stub-from-dump: Be more tolerant on input dump format 
    910 
  • i2c-tools/trunk/eepromer/24cXX.c

    r4230 r6048  
    1919#include <stdlib.h> 
    2020#include <linux/fs.h> 
     21#include <linux/i2c.h> 
     22#include <linux/i2c-dev.h> 
    2123#include <sys/types.h> 
    2224#include <sys/ioctl.h> 
     
    2426#include <assert.h> 
    2527#include <string.h> 
     28#include <i2c/smbus.h> 
    2629#include "24cXX.h" 
    2730 
  • i2c-tools/trunk/eepromer/24cXX.h

    r4495 r6048  
    1616#ifndef _24CXX_H_ 
    1717#define _24CXX_H_ 
    18 #include <linux/i2c-dev.h> 
     18#include <linux/types.h> 
    1919 
    2020#define EEPROM_TYPE_UNKNOWN     0 
  • i2c-tools/trunk/eepromer/eeprom.c

    r5538 r6048  
    33Of course the program is provided without warranty of any kind. 
    44*/ 
     5#include <sys/ioctl.h> 
    56#include <errno.h> 
    67#include <stdio.h> 
     
    1011#include <string.h> 
    1112#include <time.h> 
     13#include <linux/i2c.h> 
    1214#include <linux/i2c-dev.h> 
    1315 
  • i2c-tools/trunk/eepromer/eepromer.c

    r5746 r6048  
     1#include <sys/ioctl.h> 
    12#include <errno.h>                                                               
    23#include <string.h>                                                              
     
    67#include <fcntl.h>                                                               
    78#include <time.h> 
     9#include <linux/i2c.h> 
    810#include <linux/i2c-dev.h> 
    911 
  • i2c-tools/trunk/include/Module.mk

    r5594 r6048  
    11# Linux I2C header files 
    22# 
    3 # Copyright (C) 2007  Jean Delvare <khali@linux-fr.org> 
     3# Copyright (C) 2007, 2012  Jean Delvare <khali@linux-fr.org> 
    44# 
    55# This program is free software; you can redistribute it and/or modify 
     
    1010INCLUDE_DIR     := include 
    1111 
    12 INCLUDE_TARGETS := linux/i2c-dev.h 
     12INCLUDE_TARGETS := i2c/smbus.h 
    1313 
    1414# 
     
    1717 
    1818install-include: $(addprefix $(INCLUDE_DIR)/,$(INCLUDE_TARGETS)) 
    19         $(INSTALL_DIR) $(DESTDIR)$(incdir)/linux 
     19        $(INSTALL_DIR) $(DESTDIR)$(incdir)/i2c 
    2020        for file in $(INCLUDE_TARGETS) ; do \ 
    2121        $(INSTALL_DATA) $(INCLUDE_DIR)/$$file $(DESTDIR)$(incdir)/$$file ; done 
  • i2c-tools/trunk/include/linux/i2c-dev.h

    r6047 r6048  
    2525 
    2626#include <linux/types.h> 
    27 #include <sys/ioctl.h> 
    28  
    29  
    30 /* -- i2c.h -- */ 
    31  
    32  
    33 /* 
    34  * I2C Message - used for pure i2c transaction, also from /dev interface 
    35  */ 
    36 struct i2c_msg { 
    37         __u16 addr;     /* slave address                        */ 
    38         unsigned short flags;            
    39 #define I2C_M_TEN       0x10    /* we have a ten bit chip address       */ 
    40 #define I2C_M_RD        0x01 
    41 #define I2C_M_NOSTART   0x4000 
    42 #define I2C_M_REV_DIR_ADDR      0x2000 
    43 #define I2C_M_IGNORE_NAK        0x1000 
    44 #define I2C_M_NO_RD_ACK         0x0800 
    45         short len;              /* msg length                           */ 
    46         char *buf;              /* pointer to msg data                  */ 
    47 }; 
    48  
    49 /* To determine what functionality is present */ 
    50  
    51 #define I2C_FUNC_I2C                    0x00000001 
    52 #define I2C_FUNC_10BIT_ADDR             0x00000002 
    53 #define I2C_FUNC_PROTOCOL_MANGLING      0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */ 
    54 #define I2C_FUNC_SMBUS_PEC              0x00000008 
    55 #define I2C_FUNC_SMBUS_BLOCK_PROC_CALL  0x00008000 /* SMBus 2.0 */ 
    56 #define I2C_FUNC_SMBUS_QUICK            0x00010000  
    57 #define I2C_FUNC_SMBUS_READ_BYTE        0x00020000  
    58 #define I2C_FUNC_SMBUS_WRITE_BYTE       0x00040000  
    59 #define I2C_FUNC_SMBUS_READ_BYTE_DATA   0x00080000  
    60 #define I2C_FUNC_SMBUS_WRITE_BYTE_DATA  0x00100000  
    61 #define I2C_FUNC_SMBUS_READ_WORD_DATA   0x00200000  
    62 #define I2C_FUNC_SMBUS_WRITE_WORD_DATA  0x00400000  
    63 #define I2C_FUNC_SMBUS_PROC_CALL        0x00800000  
    64 #define I2C_FUNC_SMBUS_READ_BLOCK_DATA  0x01000000  
    65 #define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000  
    66 #define I2C_FUNC_SMBUS_READ_I2C_BLOCK   0x04000000 /* I2C-like block xfer  */ 
    67 #define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK  0x08000000 /* w/ 1-byte reg. addr. */ 
    68  
    69 #define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \ 
    70                              I2C_FUNC_SMBUS_WRITE_BYTE) 
    71 #define I2C_FUNC_SMBUS_BYTE_DATA (I2C_FUNC_SMBUS_READ_BYTE_DATA | \ 
    72                                   I2C_FUNC_SMBUS_WRITE_BYTE_DATA) 
    73 #define I2C_FUNC_SMBUS_WORD_DATA (I2C_FUNC_SMBUS_READ_WORD_DATA | \ 
    74                                   I2C_FUNC_SMBUS_WRITE_WORD_DATA) 
    75 #define I2C_FUNC_SMBUS_BLOCK_DATA (I2C_FUNC_SMBUS_READ_BLOCK_DATA | \ 
    76                                    I2C_FUNC_SMBUS_WRITE_BLOCK_DATA) 
    77 #define I2C_FUNC_SMBUS_I2C_BLOCK (I2C_FUNC_SMBUS_READ_I2C_BLOCK | \ 
    78                                   I2C_FUNC_SMBUS_WRITE_I2C_BLOCK) 
    79  
    80 /* Old name, for compatibility */ 
    81 #define I2C_FUNC_SMBUS_HWPEC_CALC       I2C_FUNC_SMBUS_PEC 
    82  
    83 /*  
    84  * Data for SMBus Messages  
    85  */ 
    86 #define I2C_SMBUS_BLOCK_MAX     32      /* As specified in SMBus standard */     
    87 #define I2C_SMBUS_I2C_BLOCK_MAX 32      /* Not specified but we use same structure */ 
    88 union i2c_smbus_data { 
    89         __u8 byte; 
    90         __u16 word; 
    91         __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */ 
    92                                                     /* and one more for PEC */ 
    93 }; 
    94  
    95 /* smbus_access read or write markers */ 
    96 #define I2C_SMBUS_READ  1 
    97 #define I2C_SMBUS_WRITE 0 
    98  
    99 /* SMBus transaction types (size parameter in the above functions)  
    100    Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */ 
    101 #define I2C_SMBUS_QUICK             0 
    102 #define I2C_SMBUS_BYTE              1 
    103 #define I2C_SMBUS_BYTE_DATA         2  
    104 #define I2C_SMBUS_WORD_DATA         3 
    105 #define I2C_SMBUS_PROC_CALL         4 
    106 #define I2C_SMBUS_BLOCK_DATA        5 
    107 #define I2C_SMBUS_I2C_BLOCK_BROKEN  6 
    108 #define I2C_SMBUS_BLOCK_PROC_CALL   7           /* SMBus 2.0 */ 
    109 #define I2C_SMBUS_I2C_BLOCK_DATA    8 
    11027 
    11128 
     
    15370 
    15471 
    155 static inline __s32 i2c_smbus_access(int file, char read_write, __u8 command,  
    156                                      int size, union i2c_smbus_data *data) 
    157 { 
    158         struct i2c_smbus_ioctl_data args; 
    159  
    160         args.read_write = read_write; 
    161         args.command = command; 
    162         args.size = size; 
    163         args.data = data; 
    164         return ioctl(file,I2C_SMBUS,&args); 
    165 } 
    166  
    167  
    168 static inline __s32 i2c_smbus_write_quick(int file, __u8 value) 
    169 { 
    170         return i2c_smbus_access(file,value,0,I2C_SMBUS_QUICK,NULL); 
    171 } 
    172          
    173 static inline __s32 i2c_smbus_read_byte(int file) 
    174 { 
    175         union i2c_smbus_data data; 
    176         if (i2c_smbus_access(file,I2C_SMBUS_READ,0,I2C_SMBUS_BYTE,&data)) 
    177                 return -1; 
    178         else 
    179                 return 0x0FF & data.byte; 
    180 } 
    181  
    182 static inline __s32 i2c_smbus_write_byte(int file, __u8 value) 
    183 { 
    184         return i2c_smbus_access(file,I2C_SMBUS_WRITE,value, 
    185                                 I2C_SMBUS_BYTE,NULL); 
    186 } 
    187  
    188 static inline __s32 i2c_smbus_read_byte_data(int file, __u8 command) 
    189 { 
    190         union i2c_smbus_data data; 
    191         if (i2c_smbus_access(file,I2C_SMBUS_READ,command, 
    192                              I2C_SMBUS_BYTE_DATA,&data)) 
    193                 return -1; 
    194         else 
    195                 return 0x0FF & data.byte; 
    196 } 
    197  
    198 static inline __s32 i2c_smbus_write_byte_data(int file, __u8 command,  
    199                                               __u8 value) 
    200 { 
    201         union i2c_smbus_data data; 
    202         data.byte = value; 
    203         return i2c_smbus_access(file,I2C_SMBUS_WRITE,command, 
    204                                 I2C_SMBUS_BYTE_DATA, &data); 
    205 } 
    206  
    207 static inline __s32 i2c_smbus_read_word_data(int file, __u8 command) 
    208 { 
    209         union i2c_smbus_data data; 
    210         if (i2c_smbus_access(file,I2C_SMBUS_READ,command, 
    211                              I2C_SMBUS_WORD_DATA,&data)) 
    212                 return -1; 
    213         else 
    214                 return 0x0FFFF & data.word; 
    215 } 
    216  
    217 static inline __s32 i2c_smbus_write_word_data(int file, __u8 command,  
    218                                               __u16 value) 
    219 { 
    220         union i2c_smbus_data data; 
    221         data.word = value; 
    222         return i2c_smbus_access(file,I2C_SMBUS_WRITE,command, 
    223                                 I2C_SMBUS_WORD_DATA, &data); 
    224 } 
    225  
    226 static inline __s32 i2c_smbus_process_call(int file, __u8 command, __u16 value) 
    227 { 
    228         union i2c_smbus_data data; 
    229         data.word = value; 
    230         if (i2c_smbus_access(file,I2C_SMBUS_WRITE,command, 
    231                              I2C_SMBUS_PROC_CALL,&data)) 
    232                 return -1; 
    233         else 
    234                 return 0x0FFFF & data.word; 
    235 } 
    236  
    237  
    238 /* Returns the number of read bytes */ 
    239 static inline __s32 i2c_smbus_read_block_data(int file, __u8 command,  
    240                                               __u8 *values) 
    241 { 
    242         union i2c_smbus_data data; 
    243         int i; 
    244         if (i2c_smbus_access(file,I2C_SMBUS_READ,command, 
    245                              I2C_SMBUS_BLOCK_DATA,&data)) 
    246                 return -1; 
    247         else { 
    248                 for (i = 1; i <= data.block[0]; i++) 
    249                         values[i-1] = data.block[i]; 
    250                 return data.block[0]; 
    251         } 
    252 } 
    253  
    254 static inline __s32 i2c_smbus_write_block_data(int file, __u8 command,  
    255                                                __u8 length, const __u8 *values) 
    256 { 
    257         union i2c_smbus_data data; 
    258         int i; 
    259         if (length > 32) 
    260                 length = 32; 
    261         for (i = 1; i <= length; i++) 
    262                 data.block[i] = values[i-1]; 
    263         data.block[0] = length; 
    264         return i2c_smbus_access(file,I2C_SMBUS_WRITE,command, 
    265                                 I2C_SMBUS_BLOCK_DATA, &data); 
    266 } 
    267  
    268 /* Returns the number of read bytes */ 
    269 /* Until kernel 2.6.22, the length is hardcoded to 32 bytes. If you 
    270    ask for less than 32 bytes, your code will only work with kernels 
    271    2.6.23 and later. */ 
    272 static inline __s32 i2c_smbus_read_i2c_block_data(int file, __u8 command, 
    273                                                   __u8 length, __u8 *values) 
    274 { 
    275         union i2c_smbus_data data; 
    276         int i; 
    277  
    278         if (length > 32) 
    279                 length = 32; 
    280         data.block[0] = length; 
    281         if (i2c_smbus_access(file,I2C_SMBUS_READ,command, 
    282                              length == 32 ? I2C_SMBUS_I2C_BLOCK_BROKEN : 
    283                               I2C_SMBUS_I2C_BLOCK_DATA,&data)) 
    284                 return -1; 
    285         else { 
    286                 for (i = 1; i <= data.block[0]; i++) 
    287                         values[i-1] = data.block[i]; 
    288                 return data.block[0]; 
    289         } 
    290 } 
    291  
    292 static inline __s32 i2c_smbus_write_i2c_block_data(int file, __u8 command, 
    293                                                    __u8 length, 
    294                                                    const __u8 *values) 
    295 { 
    296         union i2c_smbus_data data; 
    297         int i; 
    298         if (length > 32) 
    299                 length = 32; 
    300         for (i = 1; i <= length; i++) 
    301                 data.block[i] = values[i-1]; 
    302         data.block[0] = length; 
    303         return i2c_smbus_access(file,I2C_SMBUS_WRITE,command, 
    304                                 I2C_SMBUS_I2C_BLOCK_BROKEN, &data); 
    305 } 
    306  
    307 /* Returns the number of read bytes */ 
    308 static inline __s32 i2c_smbus_block_process_call(int file, __u8 command, 
    309                                                  __u8 length, __u8 *values) 
    310 { 
    311         union i2c_smbus_data data; 
    312         int i; 
    313         if (length > 32) 
    314                 length = 32; 
    315         for (i = 1; i <= length; i++) 
    316                 data.block[i] = values[i-1]; 
    317         data.block[0] = length; 
    318         if (i2c_smbus_access(file,I2C_SMBUS_WRITE,command, 
    319                              I2C_SMBUS_BLOCK_PROC_CALL,&data)) 
    320                 return -1; 
    321         else { 
    322                 for (i = 1; i <= data.block[0]; i++) 
    323                         values[i-1] = data.block[i]; 
    324                 return data.block[0]; 
    325         } 
    326 } 
    327  
    328  
    32972#endif /* _LINUX_I2C_DEV_H */ 
  • i2c-tools/trunk/py-smbus/Module.mk

    r5611 r6048  
    1515        CPPFLAGS="$(CPPFLAGS) -I../include" $(PYTHON) setup.py 
    1616 
    17 all-python: $(INCLUDE_DIR)/linux/i2c-dev.h 
     17all-python: $(INCLUDE_DIR)/i2c/smbus.h 
    1818        $(DISTUTILS) build 
    1919 
  • i2c-tools/trunk/py-smbus/smbusmodule.c

    r5619 r6048  
    1919#include <Python.h> 
    2020#include "structmember.h" 
     21#include <sys/ioctl.h> 
    2122#include <stdlib.h> 
    2223#include <stdio.h> 
    2324#include <fcntl.h> 
     25#include <linux/i2c.h> 
    2426#include <linux/i2c-dev.h> 
     27#include <i2c/smbus.h> 
    2528 
    2629/* 
  • i2c-tools/trunk/tools/Module.mk

    r5610 r6048  
    11# I2C tools for Linux 
    22# 
    3 # Copyright (C) 2007  Jean Delvare <khali@linux-fr.org> 
     3# Copyright (C) 2007, 2012  Jean Delvare <khali@linux-fr.org> 
    44# 
    55# This program is free software; you can redistribute it and/or modify 
     
    3636# 
    3737 
    38 $(TOOLS_DIR)/i2cdetect.o: $(TOOLS_DIR)/i2cdetect.c $(TOOLS_DIR)/i2cbusses.h $(INCLUDE_DIR)/linux/i2c-dev.h 
     38$(TOOLS_DIR)/i2cdetect.o: $(TOOLS_DIR)/i2cdetect.c $(TOOLS_DIR)/i2cbusses.h $(INCLUDE_DIR)/i2c/smbus.h 
    3939        $(CC) $(CFLAGS) $(TOOLS_CFLAGS) -c $< -o $@ 
    4040 
    41 $(TOOLS_DIR)/i2cdump.o: $(TOOLS_DIR)/i2cdump.c $(TOOLS_DIR)/i2cbusses.h $(TOOLS_DIR)/util.h $(INCLUDE_DIR)/linux/i2c-dev.h 
     41$(TOOLS_DIR)/i2cdump.o: $(TOOLS_DIR)/i2cdump.c $(TOOLS_DIR)/i2cbusses.h $(TOOLS_DIR)/util.h $(INCLUDE_DIR)/i2c/smbus.h 
    4242        $(CC) $(CFLAGS) $(TOOLS_CFLAGS) -c $< -o $@ 
    4343 
    44 $(TOOLS_DIR)/i2cset.o: $(TOOLS_DIR)/i2cset.c $(TOOLS_DIR)/i2cbusses.h $(TOOLS_DIR)/util.h $(INCLUDE_DIR)/linux/i2c-dev.h 
     44$(TOOLS_DIR)/i2cset.o: $(TOOLS_DIR)/i2cset.c $(TOOLS_DIR)/i2cbusses.h $(TOOLS_DIR)/util.h $(INCLUDE_DIR)/i2c/smbus.h 
    4545        $(CC) $(CFLAGS) $(TOOLS_CFLAGS) -c $< -o $@ 
    4646 
    47 $(TOOLS_DIR)/i2cget.o: $(TOOLS_DIR)/i2cget.c $(TOOLS_DIR)/i2cbusses.h $(TOOLS_DIR)/util.h $(INCLUDE_DIR)/linux/i2c-dev.h 
     47$(TOOLS_DIR)/i2cget.o: $(TOOLS_DIR)/i2cget.c $(TOOLS_DIR)/i2cbusses.h $(TOOLS_DIR)/util.h $(INCLUDE_DIR)/i2c/smbus.h 
    4848        $(CC) $(CFLAGS) $(TOOLS_CFLAGS) -c $< -o $@ 
    4949 
    50 $(TOOLS_DIR)/i2cbusses.o: $(TOOLS_DIR)/i2cbusses.c $(TOOLS_DIR)/i2cbusses.h $(INCLUDE_DIR)/linux/i2c-dev.h 
     50$(TOOLS_DIR)/i2cbusses.o: $(TOOLS_DIR)/i2cbusses.c $(TOOLS_DIR)/i2cbusses.h 
    5151        $(CC) $(CFLAGS) $(TOOLS_CFLAGS) -c $< -o $@ 
    5252 
  • i2c-tools/trunk/tools/i2cbusses.c

    r5885 r6048  
    55    Copyright (c) 1999-2003  Frodo Looijaard <frodol@dds.nl> and 
    66                             Mark D. Studebaker <mdsxyz123@yahoo.com> 
    7     Copyright (C) 2008-2010  Jean Delvare <khali@linux-fr.org> 
     7    Copyright (C) 2008-2012  Jean Delvare <khali@linux-fr.org> 
    88 
    99    This program is free software; you can redistribute it and/or modify 
     
    2929#include <sys/stat.h> 
    3030#include <sys/param.h>  /* for NAME_MAX */ 
     31#include <sys/ioctl.h> 
    3132#include <string.h> 
    3233#include <strings.h>    /* for strcasecmp() */ 
     
    3940#include <errno.h> 
    4041#include "i2cbusses.h" 
     42#include <linux/i2c.h> 
    4143#include <linux/i2c-dev.h> 
    4244 
  • i2c-tools/trunk/tools/i2cdetect.c

    r5885 r6048  
    33    Copyright (C) 1999-2004  Frodo Looijaard <frodol@dds.nl>, and 
    44                             Mark D. Studebaker <mdsxyz123@yahoo.com> 
    5     Copyright (C) 2004-2010  Jean Delvare <khali@linux-fr.org> 
     5    Copyright (C) 2004-2012  Jean Delvare <khali@linux-fr.org> 
    66 
    77    This program is free software; you can redistribute it and/or modify 
     
    2121*/ 
    2222 
     23#include <sys/ioctl.h> 
    2324#include <errno.h> 
    2425#include <string.h> 
     
    2627#include <stdlib.h> 
    2728#include <unistd.h> 
     29#include <linux/i2c.h> 
    2830#include <linux/i2c-dev.h> 
     31#include <i2c/smbus.h> 
    2932#include "i2cbusses.h" 
    3033#include "../version.h" 
  • i2c-tools/trunk/tools/i2cdump.c

    r5885 r6048  
    33    Copyright (C) 2002-2003  Frodo Looijaard <frodol@dds.nl>, and 
    44                             Mark D. Studebaker <mdsxyz123@yahoo.com> 
    5     Copyright (C) 2004-2010  Jean Delvare <khali@linux-fr.org> 
     5    Copyright (C) 2004-2012  Jean Delvare <khali@linux-fr.org> 
    66 
    77    This program is free software; you can redistribute it and/or modify 
     
    2121*/ 
    2222 
     23#include <sys/ioctl.h> 
    2324#include <errno.h> 
    2425#include <string.h> 
     
    2627#include <stdlib.h> 
    2728#include <unistd.h> 
     29#include <linux/i2c.h> 
    2830#include <linux/i2c-dev.h> 
     31#include <i2c/smbus.h> 
    2932#include "i2cbusses.h" 
    3033#include "util.h" 
  • i2c-tools/trunk/tools/i2cget.c

    r5885 r6048  
    11/* 
    22    i2cget.c - A user-space program to read an I2C register. 
    3     Copyright (C) 2005-2010  Jean Delvare <khali@linux-fr.org> 
     3    Copyright (C) 2005-2012  Jean Delvare <khali@linux-fr.org> 
    44 
    55    Based on i2cset.c: 
     
    2424*/ 
    2525 
     26#include <sys/ioctl.h> 
    2627#include <errno.h> 
    2728#include <string.h> 
     
    2930#include <stdlib.h> 
    3031#include <unistd.h> 
     32#include <linux/i2c.h> 
    3133#include <linux/i2c-dev.h> 
     34#include <i2c/smbus.h> 
    3235#include "i2cbusses.h" 
    3336#include "util.h" 
  • i2c-tools/trunk/tools/i2cset.c

    r5927 r6048  
    33    Copyright (C) 2001-2003  Frodo Looijaard <frodol@dds.nl>, and 
    44                             Mark D. Studebaker <mdsxyz123@yahoo.com> 
    5     Copyright (C) 2004-2010  Jean Delvare <khali@linux-fr.org> 
     5    Copyright (C) 2004-2012  Jean Delvare <khali@linux-fr.org> 
    66 
    77    This program is free software; you can redistribute it and/or modify 
     
    2121*/ 
    2222 
     23#include <sys/ioctl.h> 
    2324#include <errno.h> 
    2425#include <string.h> 
     
    2627#include <stdlib.h> 
    2728#include <unistd.h> 
     29#include <linux/i2c.h> 
    2830#include <linux/i2c-dev.h> 
     31#include <i2c/smbus.h> 
    2932#include "i2cbusses.h" 
    3033#include "util.h"