⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 strmakenodes.c

📁 7号信令功能代码,为开源代码
💻 C
字号:
/******************************************************************* vim: ft=c Copyright (c) 2001-2003  OpenSS7 Corporation <http://www.openss7.com> Copyright (c) 1997-2000  Brian F. G. Bidulock <bidulock@openss7.org> All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ----------------------------------------------------------------------------- U.S. GOVERNMENT RESTRICTED RIGHTS.  If you are licensing this Software on behalf of the U.S. Government ("Government"), the following provisions apply to you.  If the Software is supplied by the Department of Defense ("DoD"), it is classified as "Commercial Computer Software" under paragraph 252.227-7014 of the DoD Supplement to the Federal Acquisition Regulations ("DFARS") (or any successor regulations) and the Government is acquiring only the license rights granted herein (the license rights customarily provided to non-Government users).  If the Software is supplied to any unit or agency of the Government other than DoD, it is classified as "Restricted Computer Software" and the Government's rights in the Software are defined in paragraph 52.227-19 of the Federal Acquisition Regulations ("FAR") (or any success regulations) or, in the cases of NASA, in paragraph 18.52.227-86 of the NASA Supplement to the FAR (or any successor regulations). ----------------------------------------------------------------------------- Commercial licensing and support of this software is available from OpenSS7 Corporation at a fee.  See http://www.openss7.com/ *****************************************************************************//* * GENERATED BY strconf-sh (Sat Feb 28 18:49:44 MST 2004) FROM ../LiSrelease/drivers/str/Config  * EDITS TO THIS FILE WILL BE LOST: EDIT strconf-sh INSTEAD. */static char const ident[] = "$RCSfile$ $Name$($Revision$) $Date$";#if defined(LINUX)#	include <sys/types.h>#	include <sys/stat.h>#	include <sys/sysmacros.h>#	define makedevice(maj,min) makedev(maj,min)#elif defined(QNX)#	include <sys/types.h>#	include <sys/stat.h>#	define makedevice(maj,min) makedev(1,maj,min)#elif defined(USER)#	include <sys/stropts.h>#	include <sys/LiS/usrio.h>#else#	include <sys/types.h>#	include <sys/stat.h>#	define makedevice(maj,min) makedev(maj,min)#endif#ifdef _GNU_SOURCE#       include <getopt.h>#endif#include <stdio.h>#include <unistd.h>#include <stdlib.h>#if !defined(LINUX)#	include <fcntl.h>#endif#if !defined(USER)void version(int argc, char *argv[]){	fprintf(stdout, "\%1$s %2$s:\n\    Copyright (c) 2003 OpenSS7 Corporation.  All Rights Reserved.\n\    Copyright (c) 1997 David Grothe, Gcom, Inc <dave@gcom.com>\n\\n\    Distributed by OpenSS7 Corporation under GPL Version 2,\n\    included here by reference.\n\", argv[0], ident);}void usage(int argc, char *argv[]){	fprintf(stderr, "\Usage:\n\    %1$s [options]\n\    %1$s {-h,--help}\n\    %1$s {-V,--version}\n\", argv[0]);}void help(int argc, char *argv[]){	fprintf(stdout, "\Usage:\n\    %1$s [options]\n\    %1$s {-h,--help}\n\    %1$s {-V,--version}\n\Options:\n\    -r, --remove\n\        remove devices before making them\n\    -h, --help, -?\n\        prints this usage information and exists\n\    -V, --version\n\        prints the version and exists\n\", argv[0]);}#endif				/* !defined(USER) */int main(int argc, char *argv[]){	int rslt;	int rmopt = 0;	char *strerror(int);#if !defined(USER)	(void) umask(0);	if (argc == 2 && argv[1][0] == '-' && argv[1][1] == 'r')		rmopt = 1;	while (1) {		int c;#ifdef _GNU_SOURCE		int option_index = 0;		static struct option long_options[] = {			{"help", 0, 0, 'h'},			{"version", 0, 0, 'V'},			{"remove", 0, 0, 'r'},			{"?", 0, 0, 'h'},		};		c = getopt_long_only(argc, argv, "rhV?", long_options, &option_index);#else				/* _GNU_SOURCE */		c = getopt(argc, argv, "rhV?");#endif				/* _GNU_SOURCE */		if (c == -1)			break;		switch (c) {		case 'r':	/* -r, --remove */			rmopt = 1;                        break;		case 'h':	/* -h, --help */			help(argc, argv);			exit(0);		case 'V':	/* -V, --version */			version(argc, argv);			exit(0);		case '?':			optind--;		      bad_nonoption:			if (optind < argc) {				fprintf(stderr, "%s: illegal syntax -- ", argv[0]);				for (; optind < argc; optind++)					fprintf(stderr, "%s ", argv[optind]);				fprintf(stderr, "\n");			}			usage(argc, argv);			exit(2);		}	}	if (optind < argc)		goto bad_nonoption;#endif	(void) ident;/* -------------------------------------------------- */#if !defined(USER)	(void)unlink("/dev/mux_clone");#endif	if (!rmopt) {		rslt = mknod("/dev/mux_clone", 020666, makedevice(230,234));		if (rslt < 0)			printf("/dev/mux_clone: %s\n", strerror(-rslt));	}#if !defined(USER)	(void)unlink("/dev/minimux.1");#endif	if (!rmopt) {		rslt = mknod("/dev/minimux.1", 020666, makedevice(234,1));		if (rslt < 0)			printf("/dev/minimux.1: %s\n", strerror(-rslt));	}#if !defined(USER)	(void)unlink("/dev/minimux.2");#endif	if (!rmopt) {		rslt = mknod("/dev/minimux.2", 020666, makedevice(234,2));		if (rslt < 0)			printf("/dev/minimux.2: %s\n", strerror(-rslt));	}#if !defined(USER)	(void)unlink("/dev/clone_drvr");#endif	if (!rmopt) {		rslt = mknod("/dev/clone_drvr", 020666, makedevice(230,0));		if (rslt < 0)			printf("/dev/clone_drvr: %s\n", strerror(-rslt));	}#if !defined(USER)	(void)unlink("/dev/ldl");#endif	if (!rmopt) {		rslt = mknod("/dev/ldl", 020666, makedevice(230,236));		if (rslt < 0)			printf("/dev/ldl: %s\n", strerror(-rslt));	}#if !defined(USER)	(void)unlink("/dev/printk");#endif	if (!rmopt) {		rslt = mknod("/dev/printk", 020666, makedevice(235,0));		if (rslt < 0)			printf("/dev/printk: %s\n", strerror(-rslt));	}#if !defined(USER)	(void)unlink("/dev/sad");#endif	if (!rmopt) {		rslt = mknod("/dev/sad", 020666, makedevice(230,237));		if (rslt < 0)			printf("/dev/sad: %s\n", strerror(-rslt));	}#if !defined(USER)	(void)unlink("/dev/fifo");#endif	if (!rmopt) {		rslt = mknod("/dev/fifo", 020666, makedevice(230,231));		if (rslt < 0)			printf("/dev/fifo: %s\n", strerror(-rslt));	}#if !defined(USER)	(void)unlink("/dev/fifo.0");#endif	if (!rmopt) {		rslt = mknod("/dev/fifo.0", 020666, makedevice(231,0));		if (rslt < 0)			printf("/dev/fifo.0: %s\n", strerror(-rslt));	}#if !defined(USER)	(void)unlink("/dev/ticots_ord");#endif	if (!rmopt) {		rslt = mknod("/dev/ticots_ord", 020666, makedevice(30,42));		if (rslt < 0)			printf("/dev/ticots_ord: %s\n", strerror(-rslt));	}#if !defined(USER)	(void)unlink("/dev/ticots");#endif	if (!rmopt) {		rslt = mknod("/dev/ticots", 020666, makedevice(30,43));		if (rslt < 0)			printf("/dev/ticots: %s\n", strerror(-rslt));	}#if !defined(USER)	(void)unlink("/dev/ticlts");#endif	if (!rmopt) {		rslt = mknod("/dev/ticlts", 020666, makedevice(30,44));		if (rslt < 0)			printf("/dev/ticlts: %s\n", strerror(-rslt));	}/* -------------------------------------------------- */#if !defined(USER)	exit(0);#else	return (0);#endif}/*  * vim: ft=c */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -