reformat to KNF, prototype the world, fix lint bugs
[unix-history] / usr / src / contrib / ed / add_line.c
/*-
* Copyright (c) 1992 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Rodney Ruddock of the University of Guelph.
*
* %sccs.include.redist.c%
*/
#ifndef lint
static char sccsid[] = "@(#)add_line.c 5.2 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#include <db.h>
#include <regex.h>
#include <setjmp.h>
#include <stdio.h>
#include "ed.h"
#include "extern.h"
/*
* This is where the lines actually are put into the buffer.
*/
recno_t
add_line(p, len)
char *p;
long len;
{
DBT db_key, db_data;
static recno_t l_key;
l_key++;
(db_key.data) = &l_key;
(db_key.size) = sizeof(recno_t);
(db_data.data) = p;
(db_data.size) = len;
(dbhtmp->put)(dbhtmp, &db_key, &db_data, (u_int)(R_NOOVERWRITE));
return(l_key);
}