Last change
on this file since 83 was
81,
checked in by rosiere, 16 years ago
|
- Finish Environment (and test)
- Continue predictor_unit
- Add external tools
- svn keyword "Id" set
|
-
Property svn:keywords set to
Id
|
File size:
735 bytes
|
Rev | Line | |
---|
[81] | 1 | #include "../include/Segment.h" |
---|
| 2 | |
---|
| 3 | namespace environment { |
---|
| 4 | namespace data { |
---|
| 5 | |
---|
| 6 | bool Segment::init (const char * filename,const char ** sections) |
---|
| 7 | { |
---|
| 8 | void * ptab; |
---|
| 9 | int size = this->size; |
---|
| 10 | int offset = 0; |
---|
| 11 | |
---|
| 12 | loadexec(&ptab,&size,&offset,filename,sections); |
---|
| 13 | |
---|
| 14 | // std::cout << " - size : " << size << std::endl; |
---|
| 15 | // std::cout << " - offset : " << offset << std::endl; |
---|
| 16 | |
---|
| 17 | if (size > (int)this->size) |
---|
| 18 | { |
---|
| 19 | std::cerr << "<segment.init> : segment \"" << name << "\" is to small : size is " << this->size << " and requiert is " << size << std::endl; |
---|
| 20 | return false; |
---|
| 21 | } |
---|
| 22 | |
---|
| 23 | memcpy(data, ptab, size); |
---|
| 24 | |
---|
| 25 | free (ptab); |
---|
| 26 | |
---|
| 27 | return true; |
---|
| 28 | } |
---|
| 29 | |
---|
| 30 | }; |
---|
| 31 | }; |
---|
Note: See
TracBrowser
for help on using the repository browser.