Category : C Source Code
Archive   : WIND.ZIP
Filename : W_CENTER.C

Output of file : W_CENTER.C contained in archive : WIND.ZIP
/* w_center.c -- part of Windows package; contains only function w_center()

#define NDEBUG

#include "windows.h"

* w_center -- centers a string on a given row in a window
* passed: string address, window pointer, row number
* calls: w_puts(), strlen(), assert();
* sets: cursor members of window structure
* notes: checks to make sure length of string is not longer
* than the window's width

void w_center(s, w, r)
char *s;
Window *w;
int r;
assert(strlen(s) <= w->cols);
w->cursor.col = (w->cols - strlen (s)) / 2;
w->cursor.row = r;
w_puts(s, w);

  3 Responses to “Category : C Source Code
Archive   : WIND.ZIP
Filename : W_CENTER.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: