Ejemplo n.º 1
0
/* SRHDEF: Define a SHORTREF map and return ptr to its header.
           All entries in map are mapped to NULL.
           Caller must determine whether it already exists.
*/
PSRH srhdef(UNCH *sname)      /* SHORTREF map name (with length and EOS). */
{
     PSRH srh;                /* Ptr to SHORTREF map hdr in srhtab. */

     (srh = (PSRH)hin((THASH)srhtab, sname, 0, SRHSZ))->srhsrm =
          (TECB)rmalloc((UNS)(lex.s.dtb[0].mapdata+1)*sizeof(PECB));
     return(srh);
}
Ejemplo n.º 2
0
  TEST_FIXTURE(CompileFixture, SourceImport)
  {
    std::istringstream hin(acc.get_str());
    std::set<std::string> lines;
    while (hin.good())
    {
      std::string line;
      std::getline(hin, line);
      if (line.size()) lines.insert(line);
    }

    CHECK_EQUAL(4u, lines.size());
    CHECK(lines.end() != lines.find("// Material implementation"));
    CHECK(lines.end() != lines.find("// SHADE glsl_version:110"));
    CHECK(lines.end() != lines.find("// LightSource implementation"));
    CHECK(lines.end() != lines.find("// PointLightSource implementation"));
  }
Ejemplo n.º 3
0
			void new_input_(){
				if (map_src){
					long_size_t rest_in_size = map_src->size() - zstream.total_in;
					if (rest_in_size > 0){
						typedef ext_heap::handle handle;
						handle hin(zstream.total_in,  zstream.total_in + std::min(K_UncompressedViewSize, rest_in_size));
						rview = map_src->view_rd(hin);
						auto bin = rview.get<io::read_view>().address();
						zstream.avail_in = uInt(bin.size());
						zstream.next_in = (Bytef*)bin.begin();
						crc = crc32(bin, crc);
					}
				}
				else if(stream_src->readable()){
					buf.resize(K_UncompressedViewSize);
					auto res = stream_src->read(to_range(buf));
					buf.resize(buf.size() - res.size());
					zstream.avail_in = uInt(buf.size());
					zstream.next_in = (Bytef*)buf.begin();
				}
			}
Ejemplo n.º 4
0
/* DCNDEF: Define a notation and return its DCNCB.
           If caller does not care if it already exists,
           he should specify NULL for the notation text
           so we don't clobber the existing text (if any).
*/
struct dcncb *dcndef(UNCH *nname)    /* Notation name (with length and EOS). */
{
     return((PDCB)hin((THASH)dcntab, nname, 0, DCBSZ));
}