OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "courgette/encoded_program.h" | 5 #include "courgette/encoded_program.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 INCLUDE_BYTES = 0x0200, | 261 INCLUDE_BYTES = 0x0200, |
262 INCLUDE_COPY_COUNTS = 0x0400, | 262 INCLUDE_COPY_COUNTS = 0x0400, |
263 INCLUDE_MISC = 0x1000 | 263 INCLUDE_MISC = 0x1000 |
264 }; | 264 }; |
265 | 265 |
266 static FieldSelect GetFieldSelect() { | 266 static FieldSelect GetFieldSelect() { |
267 #if 1 | 267 #if 1 |
268 // TODO(sra): Use better configuration. | 268 // TODO(sra): Use better configuration. |
269 scoped_ptr<base::Environment> env(base::Environment::Create()); | 269 scoped_ptr<base::Environment> env(base::Environment::Create()); |
270 std::string s; | 270 std::string s; |
271 env->GetEnv("A_FIELDS", &s); | 271 env->GetVar("A_FIELDS", &s); |
272 if (!s.empty()) { | 272 if (!s.empty()) { |
273 return static_cast<FieldSelect>(wcstoul(ASCIIToWide(s).c_str(), 0, 0)); | 273 return static_cast<FieldSelect>(wcstoul(ASCIIToWide(s).c_str(), 0, 0)); |
274 } | 274 } |
275 #endif | 275 #endif |
276 return static_cast<FieldSelect>(~0); | 276 return static_cast<FieldSelect>(~0); |
277 } | 277 } |
278 | 278 |
279 void EncodedProgram::WriteTo(SinkStreamSet* streams) { | 279 void EncodedProgram::WriteTo(SinkStreamSet* streams) { |
280 FieldSelect select = GetFieldSelect(); | 280 FieldSelect select = GetFieldSelect(); |
281 | 281 |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 if (assembled) | 560 if (assembled) |
561 return C_OK; | 561 return C_OK; |
562 return C_ASSEMBLY_FAILED; | 562 return C_ASSEMBLY_FAILED; |
563 } | 563 } |
564 | 564 |
565 void DeleteEncodedProgram(EncodedProgram* encoded) { | 565 void DeleteEncodedProgram(EncodedProgram* encoded) { |
566 delete encoded; | 566 delete encoded; |
567 } | 567 } |
568 | 568 |
569 } // end namespace | 569 } // end namespace |
OLD | NEW |