Blame src/arlib2.c

Packit Service 97d2fb
/* Functions to handle creation of Linux archives.
Packit Service 97d2fb
   Copyright (C) 2007 Red Hat, Inc.
Packit Service 97d2fb
   This file is part of elfutils.
Packit Service 97d2fb
   Written by Ulrich Drepper <drepper@redhat.com>, 2007.
Packit Service 97d2fb
Packit Service 97d2fb
   This file is free software; you can redistribute it and/or modify
Packit Service 97d2fb
   it under the terms of the GNU General Public License as published by
Packit Service 97d2fb
   the Free Software Foundation; either version 3 of the License, or
Packit Service 97d2fb
   (at your option) any later version.
Packit Service 97d2fb
Packit Service 97d2fb
   elfutils is distributed in the hope that it will be useful, but
Packit Service 97d2fb
   WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 97d2fb
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 97d2fb
   GNU General Public License for more details.
Packit Service 97d2fb
Packit Service 97d2fb
   You should have received a copy of the GNU General Public License
Packit Service 97d2fb
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
Packit Service 97d2fb
Packit Service 97d2fb
#ifdef HAVE_CONFIG_H
Packit Service 97d2fb
# include <config.h>
Packit Service 97d2fb
#endif
Packit Service 97d2fb
Packit Service 97d2fb
#include <libintl.h>
Packit Service 97d2fb
#include <limits.h>
Packit Service 97d2fb
#include <string.h>
Packit Service 97d2fb
Packit Service 97d2fb
#include "arlib.h"
Packit Service 97d2fb
Packit Service 97d2fb
Packit Service 97d2fb
/* Add long file name FILENAME of length FILENAMELEN to the symbol table
Packit Service 97d2fb
   SYMTAB.  Return the offset into the long file name table.  */
Packit Service 97d2fb
long int
Packit Service 97d2fb
arlib_add_long_name (const char *filename, size_t filenamelen)
Packit Service 97d2fb
{
Packit Service 97d2fb
  size_t size = obstack_object_size (&symtab.longnamesob);
Packit Service 97d2fb
Packit Service 97d2fb
  obstack_grow (&symtab.longnamesob, filename, filenamelen);
Packit Service 97d2fb
  obstack_grow (&symtab.longnamesob, "/\n", 2);
Packit Service 97d2fb
Packit Service 97d2fb
  return size - sizeof (struct ar_hdr);
Packit Service 97d2fb
}