~ubuntu-branches/ubuntu/trusty/lifelines/trusty

« back to all changes in this revision

Viewing changes to src/btree/utils.c

  • Committer: Bazaar Package Importer
  • Author(s): Felipe Augusto van de Wiel (faw)
  • Date: 2007-05-23 23:49:53 UTC
  • mfrom: (3.1.3 edgy)
  • Revision ID: james.westby@ubuntu.com-20070523234953-ogno9rnbmth61i7p
Tags: 3.0.50-2etch1
* Changing docs/ll-reportmanual.xml and docs/ll-userguide.xml to fix
  documentation build problems (Closes: #418347).

* lifelines-reports
  - Adding a dependency to lifelines >= 3.0.50 to prevent file conflict.
    (Closes: #405500).

* Updating French translation. Thanks to Bernard Adrian. (Closes: #356671).

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
STRING
43
43
rkey2str (RKEY rkey)
44
44
{
45
 
        static char rbuf[9];
 
45
        static char rbuf[RKEYLEN+1];
46
46
        SHORT i;
47
 
        for (i = 0; i < 8; i++)
 
47
        for (i = 0; i < RKEYLEN; i++)
48
48
                rbuf[i] = rkey.r_rkey[i];
49
 
        rbuf[8] = 0;
 
49
        rbuf[RKEYLEN] = 0;
50
50
        for (i = 0; rbuf[i] == ' '; i++)
51
51
                ;
52
52
        return &rbuf[i];
60
60
        RKEY rkey;
61
61
        SHORT i = 0, n = strlen(str);
62
62
        ASSERT(n > 0);
63
 
        n = 8 - n;
 
63
        n = RKEYLEN - n;
64
64
        i = 0;
65
65
        if (n > 0)
66
66
                for (; i < n; i++)
67
67
                        rkey.r_rkey[i] = ' ';
68
 
        for (; i < 8; i++) 
 
68
        for (; i < RKEYLEN; i++) 
69
69
                rkey.r_rkey[i] = *str++;
70
70
        return rkey;
71
71
}
124
124
/*==========================================
125
125
 * newmaster -- Change master index of BTREE
126
126
 *========================================*/
127
 
BOOLEAN
128
 
newmaster (BTREE btree,  /*btree handle*/
129
 
           INDEX master)
 
127
void
 
128
newmaster (BTREE btree, INDEX master)
130
129
{
131
130
        /*
132
131
        Assumes our keyfile is valid
135
134
        btree->b_kfile.k_mkey = ixself(master);
136
135
        rewind(btree->b_kfp);
137
136
        if (fwrite(&btree->b_kfile, sizeof(btree->b_kfile), 1, btree->b_kfp) != 1) {
138
 
                /* Needs to be revisited with double-buffering */
139
 
                bterrno = BTERR_KFILE;
140
 
                return FALSE;
 
137
                char scratch[400];
 
138
                sprintf(scratch, "Error rewriting master block: %s", fkey2path(ixself(master)));
 
139
                FATAL2(scratch);
141
140
        }
142
141
        btree->b_master = master;
143
 
        return TRUE;
144
142
}