예제 #1
0
파일: xml.cpp 프로젝트: robacklin/lollipop
void xml::readattr() {
	int otherchars = 0;
	char *begin = NULL;
	readspace();
	begin = m_current;
	while(m_current != NULL) {
		switch(m_current[0]) {
		case '>':
			return;
			break;
		case '/':
			m_slash = m_current;
			m_current++;
			break;
		case '=':
		case ' ':
			if(begin)
				m_attr = strndup(begin, m_current-begin);
			m_current++;
			readvalue();
			readspace();
			begin = m_current;
			break;
		default:
			otherchars++;
			m_current++;
			break;
		}
	}
}
예제 #2
0
파일: xml.cpp 프로젝트: robacklin/lollipop
void xml::readvalue() {
	int otherchars = 0;
	char *begin = NULL;
	readspace();
	while(m_current != NULL) {
		switch(m_current[0]) {
		case '>':
			return;
			break;
		case '\'':
		case '"':
			if(begin) {
				m_value = strndup(begin, m_current-begin);
				m_current++;
				onattributes(m_node, m_attr, m_value);
				return;
			} else {
				m_current++;
				begin = m_current;
			}
			break;
		default:
			otherchars++;
			m_current++;
			break;
		}
	}
}
예제 #3
0
파일: xml.cpp 프로젝트: robacklin/lollipop
void xml::readnode() {
	int otherchars = 0;
	char *begin = NULL;
	readspace();
	begin = m_current;
	while(m_current != NULL) {
		switch(m_current[0]) {
		case '<':
			onnode(m_node);
			return;
			break;
		case '>':
		case '\t':
		case ' ':
			if((m_current-begin) > 0)
				m_node = strndup(begin, m_current-begin);
			readattr();
			return;
			break;
		default:
			otherchars++;
			break;
		}
		m_current++;
	}
}
H5::DataSpace GeneratedBuffer::createDataSpace()
  {
  // Create a dataspace representing a this object as a single "row" of data.
  hsize_t readdim[] = { BlockElementCount };
  H5::DataSpace readspace( 1, readdim );

  return readspace;
  }
예제 #5
0
int
dockspace(char *spacefile)
{
	struct fstable *fs_tab;
	int	i, error;

	error = 0;

	/*
	 * Also, vanilla SVr4 code used the output from popen()
	 * on the "/etc/mount" command.  However, we need to get more
	 * information about mounted filesystems, so we use the C
	 * interfaces to the mount table, which also happens to be
	 * much faster than running another process.  Since several
	 * of the pkg commands need access to the mount table, this
	 * code is now in libinst.  However, mount table info is needed
	 * at the time the base directory is determined, so the call
	 * to get the mount table information is in main.c
	 */

	if (readmap(&error) || readspace(spacefile, &error))
		return (-1);

	for (i = 0; fs_tab = get_fs_entry(i); ++i) {
		if ((!fs_tab->fused) && (!fs_tab->bused))
			continue; /* not used by us */

		if (fs_tab->bfree < (LIM_BFREE + fs_tab->bused)) {
			warn(TYPE_BLCK, fs_tab->name, fs_tab->bused,
				fs_tab->bfree, LIM_BFREE);
			error++;
		}

		/* bug id 1091292 */
		if ((long)fs_tab->ffree == -1L)
			continue;
		if (fs_tab->ffree < (LIM_FFREE + fs_tab->fused)) {
			warn(TYPE_NODE, fs_tab->name, fs_tab->fused,
				fs_tab->ffree, LIM_FFREE);
			error++;
		}
	}
	return (error);
}
예제 #6
0
파일: xml.cpp 프로젝트: robacklin/lollipop
void xml::readdata() {
	char *begin = NULL;
	int otherchars = 0;
	readspace();
	while(m_current != NULL) {
		switch(m_current[0]) {
		case '<':
			m_data = strndup(begin, m_current-begin);
			ondata(m_node, m_data);
			return;
			break;
		case '>':
			m_current++;
			begin = m_current;
			break;
		default:
			otherchars++;
			m_current++;
			break;
		}
	}
}
예제 #7
0
파일: xml.cpp 프로젝트: robacklin/lollipop
bool xml::parse() {
	int otherchars = 0;
	readspace();
	while(m_current != NULL) {
		switch(m_current[0]) {
		case '<':
			m_slash = NULL;
			m_current++;
			readnode();
			break;
		case '>':
			if(m_slash == NULL)
				readdata();
			else
				m_current++;
			break;
		default:
			otherchars++;
			m_current++;
			break;
		}
	}
	return true;
}