My Project
util.h
Go to the documentation of this file.
1 #ifndef __UTIL_H__
2 #define __UTIL_H__
3 
4 /*
5  * "Copyright (c) 2012 by Fritz Sieker."
6  *
7  * Permission to use, copy, modify, and distribute this software and its
8  * documentation for any purpose, without fee, and without written
9  * agreement is hereby granted, provided that the above copyright notice
10  * and the following two paragraphs appear in all copies of this software,
11  * that the files COPYING and NO_WARRANTY are included verbatim with
12  * any distribution, and that the contents of the file README are included
13  * verbatim as part of a file named README with any distribution.
14  *
15  * IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT,
16  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
17  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHOR
18  * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19  *
20  * THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22  * A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
23  * BASIS, AND THE AUTHOR NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
24  * UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
25  */
26 
38 typedef struct name_val {
39  char* name;
40  int val;
41 } name_val_t;
42 
52 name_val_t* util_bin_search (name_val_t map[], int numNames, const char* name);
53 
59 int util_get_opcode (const char* name);
60 
67 int util_is_valid_label(const char* s);
68 
76 int util_get_reg (const char* regStr);
77 
87 int util_parse_cond (const char* condCodeStr);
88 
89 #endif
int util_get_reg(const char *regStr)
struct name_val name_val_t
int util_get_opcode(const char *name)
Definition: util.h:38
int util_is_valid_label(const char *s)
int util_parse_cond(const char *condCodeStr)
name_val_t * util_bin_search(name_val_t map[], int numNames, const char *name)
char * name
Definition: util.h:39
int val
Definition: util.h:40