Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/src/prelude/Binary/StdMem.gc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


module NHC.Binary
  ( stdmem
  ) where

import NHC.GreenCard
import BinHandle ({-type-}BinHandle(..))

%-#include "cLowBinary.h"
%-#include <stdlib.h>

%fun stdmem :: BinHandle
%code
%  NodePtr n;
%  bh = (BinHandle)malloc(sizeof(BinState));       /* assume unfailing */
%  bh->mode = RW; 
%  bh->file = 0;
%  n    = C_ALLOC(1+EXTRA);
%  n[0] = CONSTRW(0,EXTRA);
%  bh->loc.sp = stableInsert(n);
%  bh->attrib.size = 0;
%  bh->adjust.here = 0;
%  opencache(bh);
%result (binHandle bh)



Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].