示例#1
0
void lastDirSet(void)
{	char *dir;

	if((dir = cwd(0)) != 0) {
		ctxtSet(CTXT_TAG_LASTDIR, 1, dir);
		free(dir);
	} else
		error_out_of_memory();
}
示例#2
0
文件: ctxt_as.c 项目: FDOS/freecom
int ctxtAddStatus(const Context_Tag tag)
{
	char value[3];

	ctxtCheckInfoTag(tag);

	*(unsigned*)value = CTXT_INFO(tag, sizemax) | 0x8001;
	value[sizeof(unsigned)] = 0;


	return ctxtSet(tag, 0, value);
}
示例#3
0
int ctxtPush(const Context_Tag tag, const char * const buf)
{	ctxt_info_t *info;

	ctxtCheckInfoTag(tag);
	assert(buf);

	info = &CTXT_INFO_STRUCT(tag);
	if(info->c_nummax == (unsigned)-1) {
		/* numbers will wrap  -> recalculate them */
		ctxtRenumberItems(tag);
		if(info->c_nummax == (unsigned)-1)
			return E_NoItems;
	}

	if(ctxtSet(tag, info->c_nummax + 1, buf) == E_None)
		return E_None;

	return E_NoMem;
}
示例#4
0
void histSet(const int num, const char * const str)
{	if(ctxtIsValid())
		ctxtSet(CTXT_TAG_HISTORY, realNum(CTXT_TAG_HISTORY, num), str);
}