aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-01-14 12:22:29 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-01-25 23:37:10 +0800
commitadc0e71ea6d243e815a7fed8fdd37b69bbf352db (patch)
tree85a2233ee3ad7cd64a5ec1d4e5e51ee9d62fa4f6
parentee8232d7ee82e39d0dee27c39622b927ab86da0e (diff)
downloadgsoc2013-evolution-adc0e71ea6d243e815a7fed8fdd37b69bbf352db.tar.gz
gsoc2013-evolution-adc0e71ea6d243e815a7fed8fdd37b69bbf352db.tar.zst
gsoc2013-evolution-adc0e71ea6d243e815a7fed8fdd37b69bbf352db.zip
Adapt to GtkComboBox class reorg.
-rw-r--r--addressbook/gui/contact-editor/contact-editor.ui4
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-fullname.c5
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c27
-rw-r--r--addressbook/gui/contact-editor/fullname.ui8
-rw-r--r--calendar/gui/dialogs/event-page.c2
-rw-r--r--calendar/gui/dialogs/event-page.ui4
-rw-r--r--calendar/gui/dialogs/memo-page.c2
-rw-r--r--calendar/gui/dialogs/memo-page.ui4
-rw-r--r--calendar/gui/dialogs/task-page.c2
-rw-r--r--calendar/gui/dialogs/task-page.ui3
-rw-r--r--mail/e-mail-tag-editor.c9
-rw-r--r--mail/mail-dialogs.ui4
-rw-r--r--modules/addressbook/addressbook-config.c1
-rw-r--r--modules/addressbook/ldap-config.ui4
-rw-r--r--modules/mail/em-mailer-prefs.c9
15 files changed, 59 insertions, 29 deletions
diff --git a/addressbook/gui/contact-editor/contact-editor.ui b/addressbook/gui/contact-editor/contact-editor.ui
index 668fa63ab6..428b17a600 100644
--- a/addressbook/gui/contact-editor/contact-editor.ui
+++ b/addressbook/gui/contact-editor/contact-editor.ui
@@ -255,8 +255,10 @@
</packing>
</child>
<child>
- <object class="GtkComboBoxEntry" id="combo-file-as">
+ <object class="GtkComboBox" id="combo-file-as">
<property name="visible">True</property>
+ <property name="has-entry">True</property>
+ <property name="entry-text-column">0</property>
<property name="model">model1</property>
</object>
<packing>
diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c
index ce9092c411..15eddbd53f 100644
--- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c
+++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c
@@ -227,11 +227,6 @@ e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullnam
gtk_window_set_icon_name (
GTK_WINDOW (e_contact_editor_fullname), "contact-new");
-
- widget = e_builder_get_widget (builder, "comboentry-title");
- gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX_ENTRY (widget), 0);
- widget = e_builder_get_widget (builder, "comboentry-suffix");
- gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX_ENTRY (widget), 0);
}
GtkWidget*
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 44a272f3a3..2ef0fd0ee9 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -537,8 +537,13 @@ file_as_set_style (EContactEditor *editor, gint style)
company = gtk_entry_get_text (GTK_ENTRY (company_w));
if (style == -1) {
- string = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (combo_file_as));
- strings = g_list_append (strings, string);
+ GtkWidget *entry;
+
+ entry = gtk_bin_get_child (GTK_BIN (combo_file_as));
+ if (entry) {
+ string = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
+ strings = g_list_append (strings, string);
+ }
}
for (i = 0; i < 6; i++) {
@@ -554,11 +559,16 @@ file_as_set_style (EContactEditor *editor, gint style)
if (combo_file_as) {
GList *l;
+ GtkListStore *list_store;
+ GtkTreeIter iter;
- gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (combo_file_as)));
+ list_store = GTK_LIST_STORE (gtk_combo_box_get_model (combo_file_as));
+
+ gtk_list_store_clear (list_store);
for (l = strings; l; l = l->next) {
- gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_file_as), l->data);
+ gtk_list_store_append (list_store, &iter);
+ gtk_list_store_set (list_store, &iter, 0, l->data, -1);
}
}
@@ -592,7 +602,12 @@ name_entry_changed (GtkWidget *widget, EContactEditor *editor)
static void
file_as_combo_changed (GtkWidget *widget, EContactEditor *editor)
{
- gchar *string = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (widget));
+ GtkWidget *entry;
+ gchar *string = NULL;
+
+ entry = gtk_bin_get_child (GTK_BIN (widget));
+ if (entry)
+ string = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
if (string && *string) {
gchar *title;
@@ -2550,7 +2565,7 @@ init_simple (EContactEditor *editor)
widget = e_builder_get_widget (editor->builder, "entry-fullname");
g_signal_connect (widget, "changed", G_CALLBACK (name_entry_changed), editor);
widget = e_builder_get_widget (editor->builder, "combo-file-as");
- gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX_ENTRY (widget), 0);
+ gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (widget), 0);
g_signal_connect (widget, "changed", G_CALLBACK (file_as_combo_changed), editor);
widget = e_builder_get_widget (editor->builder, "entry-company");
g_signal_connect (widget, "changed", G_CALLBACK (company_entry_changed), editor);
diff --git a/addressbook/gui/contact-editor/fullname.ui b/addressbook/gui/contact-editor/fullname.ui
index 47cfde5d2e..227bec9d31 100644
--- a/addressbook/gui/contact-editor/fullname.ui
+++ b/addressbook/gui/contact-editor/fullname.ui
@@ -312,8 +312,10 @@
</packing>
</child>
<child>
- <object class="GtkComboBoxEntry" id="comboentry-title">
+ <object class="GtkComboBox" id="comboentry-title">
<property name="visible">True</property>
+ <property name="has-entry">True</property>
+ <property name="entry-text-column">0</property>
<property name="add_tearoffs">False</property>
<property name="has_frame">True</property>
<property name="focus_on_click">True</property>
@@ -329,8 +331,10 @@
</packing>
</child>
<child>
- <object class="GtkComboBoxEntry" id="comboentry-suffix">
+ <object class="GtkComboBox" id="comboentry-suffix">
<property name="visible">True</property>
+ <property name="has-entry">True</property>
+ <property name="entry-text-column">0</property>
<property name="add_tearoffs">False</property>
<property name="has_frame">True</property>
<property name="focus_on_click">True</property>
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index 1798d09f90..7595f50915 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -2247,7 +2247,7 @@ get_widgets (EventPage *epage)
priv->organizer = GW ("organizer");
gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (priv->organizer))));
- gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX_ENTRY (priv->organizer), 0);
+ gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (priv->organizer), 0);
priv->summary = GW ("summary");
priv->summary_label = GW ("summary-label");
diff --git a/calendar/gui/dialogs/event-page.ui b/calendar/gui/dialogs/event-page.ui
index 0f5841ea08..0d3d73f5a8 100644
--- a/calendar/gui/dialogs/event-page.ui
+++ b/calendar/gui/dialogs/event-page.ui
@@ -741,10 +741,12 @@
<property name="homogeneous">True</property>
<property name="spacing">0</property>
<child>
- <object class="GtkComboBoxEntry" id="organizer">
+ <object class="GtkComboBox" id="organizer">
<property name="visible">True</property>
<property name="add_tearoffs">False</property>
<property name="has_frame">True</property>
+ <property name="has-entry">True</property>
+ <property name="entry-text-column">0</property>
<property name="focus_on_click">True</property>
<property name="model">model2</property>
</object>
diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c
index 60d6098a7e..996a4de8a5 100644
--- a/calendar/gui/dialogs/memo-page.c
+++ b/calendar/gui/dialogs/memo-page.c
@@ -826,7 +826,7 @@ get_widgets (MemoPage *mpage)
priv->org_label = GW ("org-label");
priv->org_combo = GW ("org-combo");
gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (priv->org_combo))));
- gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX_ENTRY (priv->org_combo), 0);
+ gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (priv->org_combo), 0);
priv->to_button = GW ("to-button");
priv->to_hbox = GW ("to-hbox");
diff --git a/calendar/gui/dialogs/memo-page.ui b/calendar/gui/dialogs/memo-page.ui
index 6e9be05058..f0dd0bb974 100644
--- a/calendar/gui/dialogs/memo-page.ui
+++ b/calendar/gui/dialogs/memo-page.ui
@@ -422,10 +422,12 @@
</packing>
</child>
<child>
- <object class="GtkComboBoxEntry" id="org-combo">
+ <object class="GtkComboBox" id="org-combo">
<property name="visible">False</property>
<property name="add_tearoffs">False</property>
<property name="has_frame">True</property>
+ <property name="has-entry">True</property>
+ <property name="entry-text-column">0</property>
<property name="focus_on_click">True</property>
<property name="model">model1</property>
</object>
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c
index 8fe16d007d..7956b1b5d7 100644
--- a/calendar/gui/dialogs/task-page.c
+++ b/calendar/gui/dialogs/task-page.c
@@ -1418,7 +1418,7 @@ get_widgets (TaskPage *tpage)
priv->organizer = e_builder_get_widget (priv->builder, "organizer");
gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (priv->organizer))));
- gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX_ENTRY (priv->organizer), 0);
+ gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (priv->organizer), 0);
priv->invite = e_builder_get_widget (priv->builder, "invite");
priv->add = e_builder_get_widget (priv->builder, "add-attendee");
diff --git a/calendar/gui/dialogs/task-page.ui b/calendar/gui/dialogs/task-page.ui
index 5d685a32f8..664caadf68 100644
--- a/calendar/gui/dialogs/task-page.ui
+++ b/calendar/gui/dialogs/task-page.ui
@@ -408,9 +408,10 @@
<property name="spacing">6</property>
<property name="homogeneous">True</property>
<child>
- <object class="GtkComboBoxEntry" id="organizer">
+ <object class="GtkComboBox" id="organizer">
<property name="visible">True</property>
<property name="model">model1</property>
+ <property name="has-entry">TRUE</property>
</object>
<packing>
<property name="position">0</property>
diff --git a/mail/e-mail-tag-editor.c b/mail/e-mail-tag-editor.c
index a116b3f5e2..0b1e20cef0 100644
--- a/mail/e-mail-tag-editor.c
+++ b/mail/e-mail-tag-editor.c
@@ -158,10 +158,12 @@ mail_tag_editor_get_tag_list (EMailTagEditor *editor)
{
CamelTag *tag_list = NULL;
time_t date;
- gchar *text;
+ gchar *text = NULL;
+ GtkWidget *entry;
- text = gtk_combo_box_text_get_active_text (
- GTK_COMBO_BOX_TEXT (editor->priv->combo_entry));
+ entry = gtk_bin_get_child (GTK_BIN (editor->priv->combo_entry));
+ if (entry)
+ text = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
camel_tag_set (&tag_list, "follow-up", text);
g_free (text);
@@ -332,7 +334,6 @@ mail_tag_editor_init (EMailTagEditor *editor)
renderer, "text", 1, NULL);
widget = e_builder_get_widget (builder, "combo");
- gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX_ENTRY (widget), 0);
editor->priv->combo_entry = GTK_COMBO_BOX (widget);
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), DEFAULT_FLAG);
diff --git a/mail/mail-dialogs.ui b/mail/mail-dialogs.ui
index 82e9928bef..3520a0d197 100644
--- a/mail/mail-dialogs.ui
+++ b/mail/mail-dialogs.ui
@@ -331,8 +331,10 @@ Please select a follow up action from the "Flag" menu.</property>
</packing>
</child>
<child>
- <object class="GtkComboBoxEntry" id="combo">
+ <object class="GtkComboBox" id="combo">
<property name="visible">True</property>
+ <property name="has-entry">True</property>
+ <property name="entry-text-column">0</property>
<property name="model">combo_model</property>
</object>
<packing>
diff --git a/modules/addressbook/addressbook-config.c b/modules/addressbook/addressbook-config.c
index 9c5a26ac5d..805cfe40b3 100644
--- a/modules/addressbook/addressbook-config.c
+++ b/modules/addressbook/addressbook-config.c
@@ -747,7 +747,6 @@ eabc_general_host (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget
g_signal_connect (sdialog->host, "changed", G_CALLBACK (host_changed_cb), sdialog);
sdialog->port_comboentry = e_builder_get_widget (builder, "port-comboentry");
- gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX_ENTRY (sdialog->port_comboentry), 0);
gtk_widget_set_has_tooltip (sdialog->port_comboentry, TRUE);
gtk_widget_set_tooltip_text (sdialog->port_comboentry, _("This is the port on the LDAP server that Evolution will try to connect to. A list of standard ports has been provided. Ask your system administrator what port you should specify."));
sprintf(port, "%u", lud && lud->lud_port? lud->lud_port : LDAP_PORT);
diff --git a/modules/addressbook/ldap-config.ui b/modules/addressbook/ldap-config.ui
index c26cb1e95e..4d045f51a1 100644
--- a/modules/addressbook/ldap-config.ui
+++ b/modules/addressbook/ldap-config.ui
@@ -308,9 +308,11 @@
</packing>
</child>
<child>
- <object class="GtkComboBoxEntry" id="port-comboentry">
+ <object class="GtkComboBox" id="port-comboentry">
<property name="visible">True</property>
<property name="model">model2</property>
+ <property name="has-entry">True</property>
+ <property name="entry-text-column">0</property>
</object>
<packing>
<property name="left_attach">1</property>
diff --git a/modules/mail/em-mailer-prefs.c b/modules/mail/em-mailer-prefs.c
index 8bec111b6e..870e5ec037 100644
--- a/modules/mail/em-mailer-prefs.c
+++ b/modules/mail/em-mailer-prefs.c
@@ -670,9 +670,12 @@ junk_plugin_changed (GtkWidget *combo, EMMailerPrefs *prefs)
{
gchar *def_plugin;
const GList *plugins = mail_session_get_junk_plugins (prefs->session);
+ GtkTreeIter iter;
+
+ g_return_if_fail (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter));
- def_plugin = gtk_combo_box_text_get_active_text (
- GTK_COMBO_BOX_TEXT (combo));
+ def_plugin = NULL;
+ gtk_tree_model_get (gtk_combo_box_get_model (GTK_COMBO_BOX (combo)), &iter, 0, &def_plugin, -1);
gconf_client_set_string (prefs->gconf, "/apps/evolution/mail/junk/default_plugin", def_plugin, NULL);
while (plugins) {
@@ -705,6 +708,8 @@ junk_plugin_changed (GtkWidget *combo, EMMailerPrefs *prefs)
}
plugins = plugins->next;
}
+
+ g_free (def_plugin);
}
static void
'>280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
  
                                      
 
                                                                        



                                                                            
                                                                   




                                                                         
                                                                         














                                   
                  









                                                               
                                                                     









                                                                              




                                                                            



                                                                         
                                                                  
                                                                           


                                                                  
 
                                                                    













                                                                                                                              

                                                                                      
                                                                                   





























































































                                                                                                                










                                                                                                        




                                                                                          
                                                                                                                                         
                                                                               
 
                                                                                        
                                                                                                               
                                                                                           

  

















                                                                           





                                                                        


                                                 
                                                                 




                                                
                                                                




                                                 
                                                                 

 


                                                
                                                            

 


                                                    
                                                                                                                                                        





                                                                       
                                                                                                                                                       





                                                                      
                                                                                                                                                        





                                                                       
                                                                                                                                      


                                                                  
                          
 






                                     

                                       

                                                          









                                                                                                                                                                        
                                                          


                                        
                                                   
 
                                      












                                                                                                            
/*
    This file is part of solidity.

    solidity is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    solidity is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with solidity.  If not, see <http://www.gnu.org/licenses/>.
*/
/** @file Instruction.h
 * @author Gav Wood <i@gavwood.com>
 * @date 2014
 */

#pragma once

#include <functional>
#include <libdevcore/Common.h>
#include <libdevcore/Assertions.h>
#include "Exceptions.h"

namespace dev
{
namespace solidity
{

DEV_SIMPLE_EXCEPTION(InvalidDeposit);
DEV_SIMPLE_EXCEPTION(InvalidOpcode);

/// Virtual machine bytecode instruction.
enum class Instruction: uint8_t
{
    STOP = 0x00,        ///< halts execution
    ADD,                ///< addition operation
    MUL,                ///< multiplication operation
    SUB,                ///< subtraction operation
    DIV,                ///< integer division operation
    SDIV,               ///< signed integer division operation
    MOD,                ///< modulo remainder operation
    SMOD,               ///< signed modulo remainder operation
    ADDMOD,             ///< unsigned modular addition
    MULMOD,             ///< unsigned modular multiplication
    EXP,                ///< exponential operation
    SIGNEXTEND,         ///< extend length of signed integer

    LT = 0x10,          ///< less-than comparison
    GT,                 ///< greater-than comparison
    SLT,                ///< signed less-than comparison
    SGT,                ///< signed greater-than comparison
    EQ,                 ///< equality comparison
    ISZERO,             ///< simple not operator
    AND,                ///< bitwise AND operation
    OR,                 ///< bitwise OR operation
    XOR,                ///< bitwise XOR operation
    NOT,                ///< bitwise NOT operation
    BYTE,               ///< retrieve single byte from word
    SHL,                ///< bitwise SHL operation
    SHR,                ///< bitwise SHR operation
    SAR,                ///< bitwise SAR operation

    KECCAK256 = 0x20,       ///< compute KECCAK-256 hash

    ADDRESS = 0x30,     ///< get address of currently executing account
    BALANCE,            ///< get balance of the given account
    ORIGIN,             ///< get execution origination address
    CALLER,             ///< get caller address
    CALLVALUE,          ///< get deposited value by the instruction/transaction responsible for this execution
    CALLDATALOAD,       ///< get input data of current environment
    CALLDATASIZE,       ///< get size of input data in current environment
    CALLDATACOPY,       ///< copy input data in current environment to memory
    CODESIZE,           ///< get size of code running in current environment
    CODECOPY,           ///< copy code running in current environment to memory
    GASPRICE,           ///< get price of gas in current environment
    EXTCODESIZE,        ///< get external code size (from another contract)
    EXTCODECOPY,        ///< copy external code (from another contract)
    RETURNDATASIZE = 0x3d,  ///< get size of return data buffer
    RETURNDATACOPY = 0x3e,  ///< copy return data in current environment to memory
    EXTCODEHASH = 0x3f, ///< get external code hash (from another contract)

    BLOCKHASH = 0x40,   ///< get hash of most recent complete block
    COINBASE,           ///< get the block's coinbase address
    TIMESTAMP,          ///< get the block's timestamp
    NUMBER,             ///< get the block's number
    DIFFICULTY,         ///< get the block's difficulty
    GASLIMIT,           ///< get the block's gas limit

    POP = 0x50,         ///< remove item from stack
    MLOAD,              ///< load word from memory
    MSTORE,             ///< save word to memory
    MSTORE8,            ///< save byte to memory
    SLOAD,              ///< load word from storage
    SSTORE,             ///< save word to storage
    JUMP,               ///< alter the program counter
    JUMPI,              ///< conditionally alter the program counter
    PC,                 ///< get the program counter
    MSIZE,              ///< get the size of active memory
    GAS,                ///< get the amount of available gas
    JUMPDEST,           ///< set a potential jump destination

    PUSH1 = 0x60,       ///< place 1 byte item on stack
    PUSH2,              ///< place 2 byte item on stack
    PUSH3,              ///< place 3 byte item on stack
    PUSH4,              ///< place 4 byte item on stack
    PUSH5,              ///< place 5 byte item on stack
    PUSH6,              ///< place 6 byte item on stack
    PUSH7,              ///< place 7 byte item on stack
    PUSH8,              ///< place 8 byte item on stack
    PUSH9,              ///< place 9 byte item on stack
    PUSH10,             ///< place 10 byte item on stack
    PUSH11,             ///< place 11 byte item on stack
    PUSH12,             ///< place 12 byte item on stack
    PUSH13,             ///< place 13 byte item on stack
    PUSH14,             ///< place 14 byte item on stack
    PUSH15,             ///< place 15 byte item on stack
    PUSH16,             ///< place 16 byte item on stack
    PUSH17,             ///< place 17 byte item on stack
    PUSH18,             ///< place 18 byte item on stack
    PUSH19,             ///< place 19 byte item on stack
    PUSH20,             ///< place 20 byte item on stack
    PUSH21,             ///< place 21 byte item on stack
    PUSH22,             ///< place 22 byte item on stack
    PUSH23,             ///< place 23 byte item on stack
    PUSH24,             ///< place 24 byte item on stack
    PUSH25,             ///< place 25 byte item on stack
    PUSH26,             ///< place 26 byte item on stack
    PUSH27,             ///< place 27 byte item on stack
    PUSH28,             ///< place 28 byte item on stack
    PUSH29,             ///< place 29 byte item on stack
    PUSH30,             ///< place 30 byte item on stack
    PUSH31,             ///< place 31 byte item on stack
    PUSH32,             ///< place 32 byte item on stack

    DUP1 = 0x80,        ///< copies the highest item in the stack to the top of the stack
    DUP2,               ///< copies the second highest item in the stack to the top of the stack
    DUP3,               ///< copies the third highest item in the stack to the top of the stack
    DUP4,               ///< copies the 4th highest item in the stack to the top of the stack
    DUP5,               ///< copies the 5th highest item in the stack to the top of the stack
    DUP6,               ///< copies the 6th highest item in the stack to the top of the stack
    DUP7,               ///< copies the 7th highest item in the stack to the top of the stack
    DUP8,               ///< copies the 8th highest item in the stack to the top of the stack
    DUP9,               ///< copies the 9th highest item in the stack to the top of the stack
    DUP10,              ///< copies the 10th highest item in the stack to the top of the stack
    DUP11,              ///< copies the 11th highest item in the stack to the top of the stack
    DUP12,              ///< copies the 12th highest item in the stack to the top of the stack
    DUP13,              ///< copies the 13th highest item in the stack to the top of the stack
    DUP14,              ///< copies the 14th highest item in the stack to the top of the stack
    DUP15,              ///< copies the 15th highest item in the stack to the top of the stack
    DUP16,              ///< copies the 16th highest item in the stack to the top of the stack

    SWAP1 = 0x90,       ///< swaps the highest and second highest value on the stack
    SWAP2,              ///< swaps the highest and third highest value on the stack
    SWAP3,              ///< swaps the highest and 4th highest value on the stack
    SWAP4,              ///< swaps the highest and 5th highest value on the stack
    SWAP5,              ///< swaps the highest and 6th highest value on the stack
    SWAP6,              ///< swaps the highest and 7th highest value on the stack
    SWAP7,              ///< swaps the highest and 8th highest value on the stack
    SWAP8,              ///< swaps the highest and 9th highest value on the stack
    SWAP9,              ///< swaps the highest and 10th highest value on the stack
    SWAP10,             ///< swaps the highest and 11th highest value on the stack
    SWAP11,             ///< swaps the highest and 12th highest value on the stack
    SWAP12,             ///< swaps the highest and 13th highest value on the stack
    SWAP13,             ///< swaps the highest and 14th highest value on the stack
    SWAP14,             ///< swaps the highest and 15th highest value on the stack
    SWAP15,             ///< swaps the highest and 16th highest value on the stack
    SWAP16,             ///< swaps the highest and 17th highest value on the stack

    LOG0 = 0xa0,        ///< Makes a log entry; no topics.
    LOG1,               ///< Makes a log entry; 1 topic.
    LOG2,               ///< Makes a log entry; 2 topics.
    LOG3,               ///< Makes a log entry; 3 topics.
    LOG4,               ///< Makes a log entry; 4 topics.

    JUMPTO = 0xb0,      ///< alter the program counter to a jumpdest -- not part of Instructions.cpp
    JUMPIF,             ///< conditionally alter the program counter -- not part of Instructions.cpp
    JUMPV,              ///< alter the program counter to a jumpdest -- not part of Instructions.cpp
    JUMPSUB,            ///< alter the program counter to a beginsub -- not part of Instructions.cpp
    JUMPSUBV,           ///< alter the program counter to a beginsub -- not part of Instructions.cpp
    BEGINSUB,           ///< set a potential jumpsub destination -- not part of Instructions.cpp
    BEGINDATA,          ///< begin the data section -- not part of Instructions.cpp
    RETURNSUB,          ///< return to subroutine jumped from -- not part of Instructions.cpp
    PUTLOCAL,           ///< pop top of stack to local variable -- not part of Instructions.cpp
    GETLOCAL,           ///< push local variable to top of stack -- not part of Instructions.cpp

    CREATE = 0xf0,      ///< create a new account with associated code
    CALL,               ///< message-call into an account
    CALLCODE,           ///< message-call with another account's code only
    RETURN,             ///< halt execution returning output data
    DELEGATECALL,       ///< like CALLCODE but keeps caller's value and sender
    CREATE2 = 0xf5,     ///< create new account with associated code at address `sha3(0xff + sender + salt + init code) % 2**160`
    STATICCALL = 0xfa,  ///< like CALL but disallow state modifications

    REVERT = 0xfd,      ///< halt execution, revert state and return output data
    INVALID = 0xfe,     ///< invalid instruction for expressing runtime errors (e.g., division-by-zero)
    SELFDESTRUCT = 0xff ///< halt execution and register account for later deletion
};

/// @returns true if the instruction is a PUSH
inline bool isPushInstruction(Instruction _inst)
{
    return Instruction::PUSH1 <= _inst && _inst <= Instruction::PUSH32;
}

/// @returns true if the instruction is a DUP
inline bool isDupInstruction(Instruction _inst)
{
    return Instruction::DUP1 <= _inst && _inst <= Instruction::DUP16;
}

/// @returns true if the instruction is a SWAP
inline bool isSwapInstruction(Instruction _inst)
{
    return Instruction::SWAP1 <= _inst && _inst <= Instruction::SWAP16;
}

/// @returns true if the instruction is a LOG
inline bool isLogInstruction(Instruction _inst)
{
    return Instruction::LOG0 <= _inst && _inst <= Instruction::LOG4;
}

/// @returns the number of PUSH Instruction _inst
inline unsigned getPushNumber(Instruction _inst)
{
    return (uint8_t)_inst - unsigned(Instruction::PUSH1) + 1;
}

/// @returns the number of DUP Instruction _inst
inline unsigned getDupNumber(Instruction _inst)
{
    return (uint8_t)_inst - unsigned(Instruction::DUP1) + 1;
}

/// @returns the number of SWAP Instruction _inst
inline unsigned getSwapNumber(Instruction _inst)
{
    return (uint8_t)_inst - unsigned(Instruction::SWAP1) + 1;
}

/// @returns the number of LOG Instruction _inst
inline unsigned getLogNumber(Instruction _inst)
{
    return (uint8_t)_inst - unsigned(Instruction::LOG0);
}

/// @returns the PUSH<_number> instruction
inline Instruction pushInstruction(unsigned _number)
{
    assertThrow(1 <= _number && _number <= 32, InvalidOpcode, std::string("Invalid PUSH instruction requested (") + std::to_string(_number) + ").");
    return Instruction(unsigned(Instruction::PUSH1) + _number - 1);
}

/// @returns the DUP<_number> instruction
inline Instruction dupInstruction(unsigned _number)
{
    assertThrow(1 <= _number && _number <= 16, InvalidOpcode, std::string("Invalid DUP instruction requested (") + std::to_string(_number) + ").");
    return Instruction(unsigned(Instruction::DUP1) + _number - 1);
}

/// @returns the SWAP<_number> instruction
inline Instruction swapInstruction(unsigned _number)
{
    assertThrow(1 <= _number && _number <= 16, InvalidOpcode, std::string("Invalid SWAP instruction requested (") + std::to_string(_number) + ").");
    return Instruction(unsigned(Instruction::SWAP1) + _number - 1);
}

/// @returns the LOG<_number> instruction
inline Instruction logInstruction(unsigned _number)
{
    assertThrow(_number <= 4, InvalidOpcode, std::string("Invalid LOG instruction requested (") + std::to_string(_number) + ").");
    return Instruction(unsigned(Instruction::LOG0) + _number);
}

enum class Tier : unsigned
{
    Zero = 0,   // 0, Zero
    Base,       // 2, Quick
    VeryLow,    // 3, Fastest
    Low,        // 5, Fast
    Mid,        // 8, Mid
    High,       // 10, Slow
    Ext,        // 20, Ext
    ExtCode,    // 700, Extcode
    Balance,    // 400, Balance
    Special,    // multiparam or otherwise special
    Invalid     // Invalid.
};

/// Information structure for a particular instruction.
struct InstructionInfo
{
    std::string name;   ///< The name of the instruction.
    int additional;     ///< Additional items required in memory for this instructions (only for PUSH).
    int args;           ///< Number of items required on the stack for this instruction (and, for the purposes of ret, the number taken from the stack).
    int ret;            ///< Number of items placed (back) on the stack by this instruction, assuming args items were removed.
    bool sideEffects;   ///< false if the only effect on the execution environment (apart from gas usage) is a change to a topmost segment of the stack
    Tier gasPriceTier;  ///< Tier for gas pricing.
};

/// Information on all the instructions.
InstructionInfo instructionInfo(Instruction _inst);

/// check whether instructions exists.
bool isValidInstruction(Instruction _inst);

/// Convert from string mnemonic to Instruction type.
extern const std::map<std::string, Instruction> c_instructions;

/// Iterate through EVM code and call a function on each instruction.
void eachInstruction(bytes const& _mem, std::function<void(Instruction,u256 const&)> const& _onInstruction);

/// Convert from EVM code to simple EVM assembly language.
std::string disassemble(bytes const& _mem);

}
}