head	1.4;
access;
symbols;
locks; strict;
comment	@ * @;


1.4
date	2026.08.23.07.21.54;	author macallan;	state Exp;
branches;
next	1.3;
commitid	PjtCn49qlYznsJSG;

1.3
date	2026.08.10.07.56.38;	author macallan;	state Exp;
branches;
next	1.2;
commitid	kV9ZTNneJOad44RG;

1.2
date	2026.08.09.11.14.11;	author macallan;	state Exp;
branches;
next	1.1;
commitid	qlraekBGcGxXbXQG;

1.1
date	2026.08.09.11.02.37;	author macallan;	state Exp;
branches;
next	;
commitid	np9HDtl1NuIo7XQG;


desc
@@


1.4
log
@make sure we have WS_KERNEL_*
@
text
@/*	$NetBSD: kernelstuff.h,v 1.3 2026/08/10 07:56:38 macallan Exp $	*/

/*
 * Copyright (c) 2026 Michael Lorenz
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/* a bunch of compat goo to get wsemul_vt100* built without modifications */

#ifndef KERNELSTUFF_H
#define KERNELSTUFF_H

#include <string.h>
#include <stdio.h>
#include <stdlib.h>

#define malloc(a, b, c)	malloc(a)
#define free(a, b) free(a)
#define uimin(a, b) (a < b ? a : b)
#define KASSERT(a)
#include <sys/systm.h>
#define panic printf

#include "config.h"

#define WS_DEFAULT_COLATTR 0
#define WS_DEFAULT_MONOATTR 0
#ifndef WS_KERNEL_FG
#define WS_KERNEL_FG WS_DEFAULT_FG
#endif
#ifndef WS_KERNEL_BG
#define WS_KERNEL_BG WS_DEFAULT_BG
#endif
#define WS_KERNEL_COLATTR WS_DEFAULT_COLATTR
#define WS_KERNEL_MONOATTR WS_DEFAULT_MONOATTR
#define WSDISPLAY_BORDER_COLOR WS_DEFAULT_BG

#endif
@


1.3
log
@make terminal colours configurable vie config.h
@
text
@d1 1
a1 1
/*	$NetBSD: kernelstuff.h,v 1.2 2026/08/09 11:14:11 macallan Exp $	*/
d48 1
d50 2
d53 1
@


1.2
log
@simplify, add license header
@
text
@d1 1
a1 1
/*	$NetBSD: config.h,v 1.1 2026/08/09 09:04:33 macallan Exp $	*/
d44 2
a45 2
#define WS_DEFAULT_FG WSCOL_BLACK
#define WS_DEFAULT_BG WSCOL_LIGHT_WHITE
@


1.1
log
@turn wsemul_vt100* into simple wrappers that pull in their respective kernel
sources while adding just enough compat goo to be usable
@
text
@d1 29
d46 7
d54 1
a54 35
#  if !defined(WS_DEFAULT_FG)
#    define WS_DEFAULT_FG WSCOL_WHITE
#  endif
#  if !defined(WS_DEFAULT_BG)
#    define WS_DEFAULT_BG WSCOL_BLACK
#  endif
#  if !defined(WS_DEFAULT_COLATTR)
#    define WS_DEFAULT_COLATTR 0
#  endif
#  if !defined(WS_DEFAULT_MONOATTR)
#    define WS_DEFAULT_MONOATTR 0
#  endif
#  if defined(WS_KERNEL_FG) || defined(WS_KERNEL_BG) || \
      defined(WS_KERNEL_COLATTR) || defined(WS_KERNEL_MONOATTR)
#    define WS_KERNEL_CUSTOMIZED
#  else
#    undef WS_KERNEL_CUSTOMIZED
#  endif
#  if !defined(WS_KERNEL_FG)
#    define WS_KERNEL_FG WS_DEFAULT_FG
#  endif
#  if !defined(WS_KERNEL_BG)
#    define WS_KERNEL_BG WS_DEFAULT_BG
#  endif
#  if !defined(WS_KERNEL_COLATTR)
#    define WS_KERNEL_COLATTR WS_DEFAULT_COLATTR
#  endif
#  if !defined(WS_KERNEL_MONOATTR)
#    define WS_KERNEL_MONOATTR WS_DEFAULT_MONOATTR
#  endif
#  if !defined(WSDISPLAY_BORDER_COLOR)
#    define WSDISPLAY_BORDER_COLOR WS_DEFAULT_BG
#  endif

#endif@

