Exemplo n.º 1
0
Arquivo: buffer.c Projeto: 4ad/sam
void
Bterm(Buffer *b)
{
	Dclose(b->disc);
	Strclose(&b->cache);
	free(b);
}
Exemplo n.º 2
0
Arquivo: sam.c Projeto: deadpixi/sam
void
shutdown(void)
{
    freecmd();
    for (int i = 0; i < file.nused; i++)
        Fclose(file.filepptr[i]);

    if (!downloaded)
        Fclose(cmd);

    if (genc)
        free(genc);

    Strclose(&cmdstr);
    Strclose(&lastpat);
    Strclose(&lastregexp);
    Strclose(&genstr);
    Strclose(&rhs);
    Strclose(&wd);
    Strclose(&plan9cmd);

    if (file.listptr)
        free(file.listptr);

    if (tempfile.listptr)
        free(tempfile.listptr);

    freecmdlists();
    freebufs();
}
Exemplo n.º 3
0
Arquivo: file.c Projeto: aahud/harvey
void
fileclose(File *f)
{
	Strclose(&f->name);
	bufclose(&f->Buffer);
	bufclose(&f->delta);
	bufclose(&f->epsilon);
	if(f->rasp)
		listfree(f->rasp);
	free(f);
}
Exemplo n.º 4
0
Arquivo: cmd.c Projeto: CoryXie/nix-os
void
freecmd(void)
{
	int i;

	while(cmdlist.nused > 0)
		free(cmdlist.voidpptr[--cmdlist.nused]);
	while(addrlist.nused > 0)
		free(addrlist.voidpptr[--addrlist.nused]);
	while(relist.nused > 0){
		i = --relist.nused;
		Strclose(relist.stringpptr[i]);
		free(relist.stringpptr[i]);
	}
	while(stringlist.nused>0){
		i = --stringlist.nused;
		Strclose(stringlist.stringpptr[i]);
		free(stringlist.stringpptr[i]);
	}
}
Exemplo n.º 5
0
Arquivo: file.c Projeto: aahud/harvey
void
fileunsetname(File *f, Buffer *delta)
{
	String s;
	Undo u;

	/* undo a file name change by restoring old name */
	u.type = Filename;
	u.mod = f->mod;
	u.seq = f->seq;
	u.p0 = 0;	/* unused */
	Strinit(&s);
	Strduplstr(&s, &f->name);
	fullname(&s);
	u.n = s.n;
	if(s.n)
		bufinsert(delta, delta->nc, s.s, s.n);
	bufinsert(delta, delta->nc, (Rune*)&u, Undosize);
	Strclose(&s);
}