.title outbuf Change output buffer size .ident "V02.00" ;+ ; Index Change output buffer size ; ; Usage ; ; result = outbuf(size); ; int result; ; unsigned size; ; ; Description ; ; When a C program is started, the output buffer is allocated ; to a default size of 132 decimal characters. A program may ; call this routine to reset the output buffer size. This routine ; sets up the output buffer pointers and returns a 1 if all is ; successful and a 0 on error. ; ;- ; Edit history: ; V02.00 19-Oct-82 TTC Initial edit ; .psect c$code outbuf:: tst $$bbeg ; Buffer already been allocated? beq 10$ ; No call flush ; Yes, flush it mov $$bbeg,r0 ; r0 --> old buffer call $$free ; Free it 10$: mov 2(sp),r0 ; r0 = number of bytes to allocate call $$aloc ; Allocate the output buffer mov r0,$$bbeg ; Set buffer begin pointer beq 20$ ; Problems allocating? mov r0,$$bptr ; Initialize buffer pointer add 2(sp),r0 ; add size of output buffer mov r0,$$bend ; Set buffer end pointer mov #1,r0 ; Return success return 20$: clr r0 ; Error return .end