#! /usr/bin/awk -f
# $NetBSD: modelines2c.awk,v 1.5 2011/03/21 19:32:26 jdc Exp $
#
# Copyright (c) 2006 Itronix Inc.
# All rights reserved.
#
# Written by Garrett D'Amore for Itronix Inc.
#
# 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.
# 3. The name of Itronix Inc. may not be used to endorse
# or promote products derived from this software without specific
# prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY ITRONIX INC. ``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 ITRONIX INC. 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.
#
BEGIN {
nmodes = 0;
}
NR == 1 {
split($0,v,"$");
VERSION=v[2];
printf("/*\t$NetBSD" "$\t*/\n\n");
printf("/*\n") ;
printf(" * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.\n");
printf(" *\n");
printf(" * generated from:\n");
printf(" *\t%s\n", VERSION);
printf(" */\n\n");
printf("/*\n");
printf(" * These macros help the modelines below fit on one line.\n");
printf(" */\n");
printf("#define HP VID_PHSYNC\n");
printf("#define HN VID_NHSYNC\n");
printf("#define VP VID_PVSYNC\n");
printf("#define VN VID_NVSYNC\n");
printf("#define I VID_INTERLACE\n");
printf("#define DS VID_DBLSCAN\n");
printf("\n");
# We truncate the vrefresh figure, but some mode descriptions rely
# on rounding, so we can't win here. Adding an additional .1
# compensates to some extent.