view oldXMenu/insque.c @ 88954:363e137c2601

(archive-file-name-coding-system): New variable. Make it permanent-local. (byte-after, bref, insert-unibyte): New function. Change most of char-after, aref, insert to them respectively. (archive-mode): Set archive-file-name-coding-system. (archive-summarize): Don't change the buffer's multibyteness. (archive-extract): Inherit archive-file-name-coding-system from archive-superior-buffer. Bind coding-system-for-write to archive-file-name-coding-system. (archive-*-write-file-member): Encode ENAME by archive-file-name-coding-system. Bind coding-system-for-write to no-conversion. (archive-rename-entry): Encode the filename by archive-file-name-coding-system. (archive-mode-revert): Don't change the buffer's multibyteness. (archive-arc-summarize, archive-lzh-summarize, archive-zoo-summarize): Don't change the buffer's multibyteness. Decode filenames by archive-file-name-coding-system. (archive-arc-rename-entry, archive-zip-chmod-entry): Don't change the buffer's multibyteness.
author Kenichi Handa <handa@m17n.org>
date Wed, 31 Jul 2002 07:14:13 +0000
parents bbce331da1be
children 23a1cea22d13
line wrap: on
line source

/* This file implements the emacs_insque and emacs_remque functions,
   copies of the insque and remque functions of BSD.  They and all
   their callers have been renamed to emacs_mumble to allow us to
   include this file in the menu library on all systems.  */


struct qelem {
  struct    qelem *q_forw;
  struct    qelem *q_back;
  char q_data[1];
};

/* Insert ELEM into a doubly-linked list, after PREV.  */

void
emacs_insque (elem, prev) 
     struct qelem *elem, *prev;
{
  struct qelem *next = prev->q_forw;
  prev->q_forw = elem;
  if (next)
    next->q_back = elem;
  elem->q_forw = next;
  elem->q_back = prev;
}

/* Unlink ELEM from the doubly-linked list that it is in.  */

emacs_remque (elem)
     struct qelem *elem;
{
  struct qelem *next = elem->q_forw;
  struct qelem *prev = elem->q_back;
  if (next)
    next->q_back = prev;
  if (prev)
    prev->q_forw = next;
}