// Copyright 1999-2001 by Lowell Dennis (Cyberclops, LLC) // // $Workfile: alloc.vdm $ // // Buffer and text register allocation macros for VEDIT (5.00 or greater) // // $Log: X:/bios/lowell/tools/vedit/alloc.vdv $ // // Rev 1.0 04 Oct 2001 10:21:50 Lowell // Initial revision. // ///////////////////////////////////////////////////////////////////// // ALLOC_BUF Allocate a buffer // Call with: // None // Exits with: // RV = 0, if no error // #80 = Buffer number // RV = 1, if allocation failed // :ALLOC_BUF: #80 = Buf_Free(EXTRA) // Try to get an "EXTRA" buffer if (#80 <= 0) { // If failed ... #80 = Buf_Free() // Try to get a normal buffer if (#80 <= 0) { // If failed again ... Get_Key("No buffers available!!!",STATLINE) return(1) } } return(0) ///////////////////////////////////////////////////////////////////// // ALLOC_REG Allocate a text register // Call with: // None // Exits with: // RV = 0, if no error // #80 = Text register number // RV = 1, if allocation failed // :ALLOC_REG: #80 = Reg_Free() // Try to get a text register if (#80 <= 0) { // If failed Get_Key("No text registers available!!!",STATLINE) return(1) } Reg_Set(#80," ") // Set it so next Reg_Free works return(0)