~ubuntu-branches/ubuntu/maverick/radare/maverick

« back to all changes in this revision

Viewing changes to src/environ.c

  • Committer: Bazaar Package Importer
  • Author(s): SevenMachines
  • Date: 2010-09-07 15:44:27 UTC
  • mfrom: (1.1.3 upstream) (2.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100907154427-37u92vu12tqabqqz
Tags: 1:1.5.2-3ubuntu1
* Merge from debian testing (LP: #621016)
* debian/control:
     + libvala-dev transition to libval-0.10-dev (LP: #618809) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *
19
19
 */
20
20
 
 
21
#include "config.h"
21
22
#include "main.h"
22
23
#include "utils.h"
23
24
#if DEBUGGER
27
28
/* spaghetti implementation */
28
29
static int env_var_required(const char *str, const char *var)
29
30
{
30
 
        char *a = str, *b;
31
 
 
 
31
        const char *a = str, *b;
32
32
        while(*a) {
33
33
                if (*a == '$') {
34
34
                        a = a + 1;
67
67
        setenv("ARCH",   config_get("asm.arch"), 1);
68
68
        setenv("NASM",   "1",      1);
69
69
 
70
 
        sprintf(offset,  OFF_FMTd, (u64)config.seek);
 
70
        sprintf(offset,  OFF_FMTd, (ut64)config.seek);
71
71
        setenv("OFFSET", offset,   1);
72
72
 
73
 
        sprintf(offset,  "0x"OFF_FMTx, (u64)config.seek);
 
73
        sprintf(offset,  "0x"OFF_FMTx, (ut64)config.seek);
74
74
        setenv("XOFFSET", offset,   1);
75
75
 
76
76
        if (config.cursor_mode)
77
 
                sprintf(offset,  OFF_FMTd, (u64)config.seek+config.cursor);
 
77
                sprintf(offset,  OFF_FMTd, (ut64)config.seek+config.cursor);
78
78
        setenv("CURSOR", offset,   1);
79
 
        sprintf(offset,  "%d", (int)config_get_i("io.vaddr")); //(u64)config.vaddr);
 
79
        sprintf(offset,  "%d", (int)config_get_i("io.vaddr")); //(ut64)config.vaddr);
80
80
        setenv("VADDR",  offset,   1);
81
81
        sprintf(offset,  "%d",     config.color);
82
82
        setenv("COLOR",  offset,   1);
90
90
        sprintf(offset,  "%d", config.block_size);
91
91
        setenv("BSIZE",  offset, 1);
92
92
 
 
93
        if (line)
93
94
        if (env_var_required(line, "BYTES")) {
94
95
                *offset = '\0';
95
96
                for(i=0;i<config.block_size;i++) {
100
101
                setenv("BYTES",  offset, 1);
101
102
        }
102
103
 
 
104
        if (line)
103
105
        if (env_var_required(line, "BLOCK")) {
104
106
                char file[TMPFILE_MAX];
105
107
                make_tmp_file(file);
138
140
 
139
141
        /* radis_update(); */
140
142
        config.verbose = config_get_i("cfg.verbose");
141
 
        config.color = (int)config_get("scr.color");
 
143
        config.color = PTRCAST (config_get("scr.color"));
142
144
 
143
145
#if 0
144
146
        ptr = getenv("COLUMNS");