Unix

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Moving `migcom' out of `/libexec/'

    7 answers - 836 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hello!
    In the GNU MIG package, I'd like to move the `migcom' program out of
    `[exec_prefix]/libexec/' (which is where is currently is being installed)
    and install it alongside the `mig' program into `[exec_prefix]/bin/' for
    being able to use it directly, avoiding constructs like ``$(MIG) -cc cat
    - /dev/null'' as a replacement for directly calling `migcom'.
    This means that `migcom' should support the basics of the GNU coding
    standards, i.e. some `' and `' output. Ben, are you
    interested in quickly implementig that? is someone else?
    Regards,
    Thomas
    Bug-hurd mailing list
    Bug-hurd (AT) gnu (DOT) org
    PGP SIGNATURE
    Version: GnuPG v1.4.1 (GNU/Linux)
    jw+683dTYTCK1sc1fK12w=
    =uP9t
    PGP SIGNATURE
  • No.1 | | 4411 bytes | |

    Thomas Schwinge wrote:
    Hello!

    In the GNU MIG package, I'd like to move the `migcom' program out of
    `[exec_prefix]/libexec/' (which is where is currently is being installed)
    and install it alongside the `mig' program into `[exec_prefix]/bin/' for
    being able to use it directly, avoiding constructs like ``$(MIG) -cc cat
    - /dev/null'' as a replacement for directly calling `migcom'.

    This means that `migcom' should support the basics of the GNU coding
    standards, i.e. some `' and `' output. Ben, are you
    interested in quickly implementig that? is someone else?

    Regards,
    Thomas

    If that's ok, i can add/modify whatever else is needed.

    diff -u mig/migcom.c migcom.c
    mig/migcom.c2006-07-29 02:55:25.000000000 +0300
    migcom.c2006-11-29 23:08:52.000000000 +0200
    @@ -26,6 +26,9 @@

    /*
    *Switches are;
    + * Print the below switches
    + * Print MIG version
    + *
    *-[v,Q] verbose or not quiet: prints out type
    *and routine information as mig runs.
    *-[V,q] not verbose or quiet : don't print
    @@ -91,6 +94,12 @@
    {
    switch (argv[0][1])
    {
    + case '-':
    +if (!strcmp(argv[0], ""))
    +HelpMsg = TRUE;
    +else if (!strcmp(argv[0], ""))
    +PrintVersion = TRUE;
    +break;
    case 'n':
    DefaultFiles = FALSE;
    break;
    @@ -212,6 +221,48 @@

    set_program_name("mig");
    parseArgs(argc, argv);
    +
    + if (HelpMsg)
    + {
    +printf("Mach Interface Generator (MIG) switches:\n");
    +printf("\t Print MIG version\n");
    +printf("\t-[v,Q] verbose or not quiet: prints out type\n");
    +printf("\t\tand routine information as mig runs.\n");
    +printf("\t-[V,q] not verbose or quiet : don't print\n");
    +printf("\t\tinformation during compilation\n");
    +printf("\t\t(this is the default)\n");
    +printf("\t-[r,R] do or don't use rpc calls instead of\n");
    +printf("\t\tsend/receive pairs. Default is -r.\n");
    +printf("\t-[s,S] generate symbol table or not: generate a\n");
    +printf("\t\ttable of rpc-name, number, routine triplets\n");
    +printf("\t\tas an external data structure -- main use is\n");
    +printf("\t\tfor protection system's specification of rights\n");
    +printf("\t\tand for protection dispatch code. Default is -s.\n");
    +printf("\t-i <prefix>\n");
    +printf("\t\tPut each user routine in its own file. The\n");
    +printf("\t\tfile is named <prefix><routine-name>.c.\n");
    +printf("\t-user <name>\n");
    +printf("\t\tName the user-side file <name>\n");
    +printf("\t-server <name>\n");
    +printf("\t\tName the server-side file <name>\n");
    +printf("\t-header <name>\n");
    +printf("\t\tName the user-side header file <name>\n");
    +printf("\t-iheader <name>");
    +printf("\t\tName the user-side internal header file <name>\n");
    +printf("\t-sheader <name>\n");
    +printf("\t\tNAme the server-side header file <name>\n");
    +printf("\nReport bugs to bug-hurd (AT) gnu (DOT) org\n");
    +exit(0);
    + }
    +
    + if (PrintVersion)
    + {
    +printf("GNU MiG 1.3\n");
    +printf("Copyright (C) 1989, 1991 Free Software Foundation, Inc.\n");
    +printf(" Everyone is permitted to copy and distribute verbatim
    copies of this license document, but changing it is not allowed.\n");
    +exit(0);
    + }
    +
    init_global();
    init_type();

    diff -u mig/global.h global.h
    mig/global.h2001-06-08 03:49:10.000000000 +0300
    global.h2006-11-30 00:37:25.000000000 +0200
    @@ -32,6 +32,8 @@
    #include "boolean.h"
    #include "mig_string.h"

    +extern boolean_t HelpMsg;
    +extern boolean_t PrintVersion;
    extern boolean_t DefaultFiles;/* default output file names if
    no arguments */
    extern boolean_t BeQuiet;/* no warning messages */
    extern boolean_t BeVerbose;/* summarize types, routines */

    diff -u mig/global.c global.c
    mig/global.c2001-06-08 03:49:10.000000000 +0300
    global.c2006-11-30 00:37:39.000000000 +0200
    @@ -27,6 +27,8 @@
    #include "error.h"
    #include "global.h"

    +boolean_t PrintVersion = FALSE;
    +boolean_t HelpMsg = FALSE;
    boolean_t DefaultFiles = TRUE;
    boolean_t BeQuiet = FALSE;
    boolean_t BeVerbose = FALSE;

    Bug-hurd mailing list
    Bug-hurd (AT) gnu (DOT) org
  • No.2 | | 21081 bytes | |

    Constantine Kousoulos wrote:
    Thomas Schwinge wrote:
    >Hello!
    >>

    >In the GNU MIG package, I'd like to move the `migcom' program out of
    >`[exec_prefix]/libexec/' (which is where is currently is being
    >installed)
    >and install it alongside the `mig' program into `[exec_prefix]/bin/' for
    >being able to use it directly, avoiding constructs like ``$(MIG) -cc cat
    >- /dev/null'' as a replacement for directly calling `migcom'.
    >>

    >This means that `migcom' should support the basics of the GNU coding
    >standards, i.e. some `' and `' output. Ben, are you
    >interested in quickly implementig that? is someone else?
    >>
    >>

    >Regards,
    >Thomas
    >>
    >>

    >

    If that's ok, i can add/modify whatever else is needed.

    diff -u mig/migcom.c migcom.c
    mig/migcom.c 2006-07-29 02:55:25.000000000 +0300
    migcom.c 2006-11-29 23:08:52.000000000 +0200
    @@ -26,6 +26,9 @@

    /*
    * Switches are;
    + * Print the below switches
    + * Print MIG version
    + *
    * -[v,Q] verbose or not quiet: prints out type
    * and routine information as mig runs.
    * -[V,q] not verbose or quiet : don't print
    @@ -91,6 +94,12 @@
    {
    switch (argv[0][1])
    {
    + case '-':
    + if (!strcmp(argv[0], ""))
    + HelpMsg = TRUE;
    + else if (!strcmp(argv[0], ""))
    + PrintVersion = TRUE;
    + break;
    case 'n':
    DefaultFiles = FALSE;
    break;
    @@ -212,6 +221,48 @@

    set_program_name("mig");
    parseArgs(argc, argv);
    +
    + if (HelpMsg)
    + {
    + printf("Mach Interface Generator (MIG) switches:\n");
    + printf("\t Print MIG version\n");
    + printf("\t-[v,Q] verbose or not quiet: prints out type\n");
    + printf("\t\tand routine information as mig runs.\n");
    + printf("\t-[V,q] not verbose or quiet : don't print\n");
    + printf("\t\tinformation during compilation\n");
    + printf("\t\t(this is the default)\n");
    + printf("\t-[r,R] do or don't use rpc calls instead of\n");
    + printf("\t\tsend/receive pairs. Default is -r.\n");
    + printf("\t-[s,S] generate symbol table or not: generate a\n");
    + printf("\t\ttable of rpc-name, number, routine triplets\n");
    + printf("\t\tas an external data structure -- main use is\n");
    + printf("\t\tfor protection system's specification of rights\n");
    + printf("\t\tand for protection dispatch code. Default is -s.\n");
    + printf("\t-i <prefix>\n");
    + printf("\t\tPut each user routine in its own file. The\n");
    + printf("\t\tfile is named <prefix><routine-name>.c.\n");
    + printf("\t-user <name>\n");
    + printf("\t\tName the user-side file <name>\n");
    + printf("\t-server <name>\n");
    + printf("\t\tName the server-side file <name>\n");
    + printf("\t-header <name>\n");
    + printf("\t\tName the user-side header file <name>\n");
    + printf("\t-iheader <name>");
    + printf("\t\tName the user-side internal header file <name>\n");
    + printf("\t-sheader <name>\n");
    + printf("\t\tNAme the server-side header file <name>\n");
    + printf("\nReport bugs to bug-hurd (AT) gnu (DOT) org\n");
    + exit(0);
    + }
    +
    + if (PrintVersion)
    + {
    + printf("GNU MiG 1.3\n");
    + printf("Copyright (C) 1989, 1991 Free Software Foundation, Inc.\n");
    + printf(" Everyone is permitted to copy and distribute verbatim
    copies of this license document, but changing it is not allowed.\n");
    + exit(0);
    + }
    +
    init_global();
    init_type();
    --
    diff -u mig/global.h global.h
    mig/global.h 2001-06-08 03:49:10.000000000 +0300
    global.h 2006-11-30 00:37:25.000000000 +0200
    @@ -32,6 +32,8 @@
    #include "boolean.h"
    #include "mig_string.h"

    +extern boolean_t HelpMsg;
    +extern boolean_t PrintVersion;
    extern boolean_t DefaultFiles; /* default output file names if no
    arguments */
    extern boolean_t BeQuiet; /* no warning messages */
    extern boolean_t BeVerbose; /* summarize types, routines */
    --
    diff -u mig/global.c global.c
    mig/global.c 2001-06-08 03:49:10.000000000 +0300
    global.c 2006-11-30 00:37:39.000000000 +0200
    @@ -27,6 +27,8 @@
    #include "error.h"
    #include "global.h"

    +boolean_t PrintVersion = FALSE;
    +boolean_t HelpMsg = FALSE;
    boolean_t DefaultFiles = TRUE;
    boolean_t BeQuiet = FALSE;
    boolean_t BeVerbose = FALSE;
    --

    /*
    * Mach System
    * Copyright (c) 1991,1990 Carnegie Mellon University
    * All Rights Reserved.
    *
    * Permission to use, copy, modify and distribute this software and its
    * documentation is hereby granted, provided that both the copyright
    * notice and this permission notice appear in all copies of the
    * software, derivative works or modified versions, and any portions
    * thereof, and that both notices appear in supporting documentation.
    *
    * CARNEGIE MELLN ALLWS FREE USE F THIS SFTWARE IN ITS
    * CNDITIN. CARNEGIE MELLN DISCLAIMS ANY LIABILITY F ANY KIND FR
    * ANY DAMAGES WHATSEVER RESULTING FRM THE USE F THIS SFTWARE.
    *
    * Carnegie Mellon requests users of this software to return to
    *
    * Software Distribution Coordinator or Software.Distribution (AT) CS (DOT) CMU.EDU
    * School of Computer Science
    * Carnegie Mellon University
    * Pittsburgh PA 15213-3890
    *
    * any improvements or extensions that they make and grant Carnegie the
    * rights to redistribute these changes.
    */

    #include "error.h"
    #include "global.h"

    boolean_t PrintVersion = FALSE;
    boolean_t HelpMsg = FALSE;
    boolean_t DefaultFiles = TRUE;
    boolean_t BeQuiet = FALSE;
    boolean_t BeVerbose = FALSE;
    boolean_t UseMsgRPC = TRUE;
    boolean_t GenSymTab = FALSE;

    boolean_t IsKernelUser = FALSE;
    boolean_t IsKernelServer = FALSE;

    const_string_t RCSId = strNULL;

    const_string_t SubsystemName = strNULL;
    u_int SubsystemBase = 0;

    const_string_t M = strNULL;
    const_string_t WaitTime = strNULL;
    const_string_t ErrorProc = "MsgError";
    const_string_t ServerPrefix = "";
    const_string_t UserPrefix = "";
    const_string_t ServerDemux = strNULL;
    const_string_t SubrPrefix = "";
    const_string_t RoutinePrefix = "";

    string_t yyinname;

    const char LintLib[] = "defined(LINTLIBRARY)";

    void
    init_global(void)
    {
    yyinname = strmake("<no name yet>");
    }

    string_t UserFilePrefix = strNULL;
    string_t UserHeaderFileName = strNULL;
    string_t ServerHeaderFileName = strNULL;
    string_t InternalHeaderFileName = strNULL;
    string_t UserFileName = strNULL;
    string_t ServerFileName = strNULL;

    void
    more_global(void)
    {
    if (SubsystemName == strNULL)
    fatal("no SubSystem declaration");

    if (DefaultFiles)
    {
    if (UserHeaderFileName == strNULL)
    UserHeaderFileName = strconcat(SubsystemName, ".h");
    else if (streql(UserHeaderFileName, "/dev/null"))
    UserHeaderFileName = strNULL;

    if (UserFileName == strNULL)
    UserFileName = strconcat(SubsystemName, "User.c");
    else if (streql(UserFileName, "/dev/null"))
    UserFileName = strNULL;

    if (ServerFileName == strNULL)
    ServerFileName = strconcat(SubsystemName, "Server.c");
    else if (streql(ServerFileName, "/dev/null"))
    ServerFileName = strNULL;
    }

    if (ServerDemux == strNULL)
    ServerDemux = strconcat(SubsystemName, "_server");
    if (RoutinePrefix != NULL)
    ServerDemux = strconcat (RoutinePrefix, ServerDemux);
    }

    /*
    * Mach System
    * Copyright (c) 1991,1990 Carnegie Mellon University
    * All Rights Reserved.
    *
    * Permission to use, copy, modify and distribute this software and its
    * documentation is hereby granted, provided that both the copyright
    * notice and this permission notice appear in all copies of the
    * software, derivative works or modified versions, and any portions
    * thereof, and that both notices appear in supporting documentation.
    *
    * CARNEGIE MELLN ALLWS FREE USE F THIS SFTWARE IN ITS
    * CNDITIN. CARNEGIE MELLN DISCLAIMS ANY LIABILITY F ANY KIND FR
    * ANY DAMAGES WHATSEVER RESULTING FRM THE USE F THIS SFTWARE.
    *
    * Carnegie Mellon requests users of this software to return to
    *
    * Software Distribution Coordinator or Software.Distribution (AT) CS (DOT) CMU.EDU
    * School of Computer Science
    * Carnegie Mellon University
    * Pittsburgh PA 15213-3890
    *
    * any improvements or extensions that they make and grant Carnegie the
    * rights to redistribute these changes.
    */

    #ifndef_GLBAL_H
    #define_GLBAL_H

    #include <sys/types.h>

    #include "boolean.h"
    #include "mig_string.h"

    extern boolean_t HelpMsg;
    extern boolean_t PrintVersion;
    extern boolean_t DefaultFiles;/* default output file names if no arguments */
    extern boolean_t BeQuiet;/* no warning messages */
    extern boolean_t BeVerbose;/* summarize types, routines */
    extern boolean_t UseMsgRPC;
    extern boolean_t GenSymTab;

    extern boolean_t IsKernelUser;
    extern boolean_t IsKernelServer;

    extern const_string_t RCSId;

    extern const_string_t SubsystemName;
    extern u_int SubsystemBase;

    extern const_string_t M;
    extern const_string_t WaitTime;
    extern const_string_t ErrorProc;
    extern const_string_t ServerPrefix;
    extern const_string_t UserPrefix;
    extern const_string_t ServerDemux;
    extern const_string_t SubrPrefix;
    extern const_string_t RoutinePrefix;

    extern int yylineno;
    extern string_t yyinname;

    extern void init_global(void);

    extern string_t UserFilePrefix;
    extern string_t UserHeaderFileName;
    extern string_t ServerHeaderFileName;
    extern string_t InternalHeaderFileName;
    extern string_t UserFileName;
    extern string_t ServerFileName;

    extern void more_global(void);

    extern const char LintLib[];

    #ifndef NULL
    #define NULL 0
    #endif

    #endif/* _GLBAL_H */

    /*
    * Mach System
    * Copyright (c) 1993,1991,1990 Carnegie Mellon University
    * All Rights Reserved.
    *
    * Permission to use, copy, modify and distribute this software and its
    * documentation is hereby granted, provided that both the copyright
    * notice and this permission notice appear in all copies of the
    * software, derivative works or modified versions, and any portions
    * thereof, and that both notices appear in supporting documentation.
    *
    * CARNEGIE MELLN ALLWS FREE USE F THIS SFTWARE IN ITS
    * CNDITIN. CARNEGIE MELLN DISCLAIMS ANY LIABILITY F ANY KIND FR
    * ANY DAMAGES WHATSEVER RESULTING FRM THE USE F THIS SFTWARE.
    *
    * Carnegie Mellon requests users of this software to return to
    *
    * Software Distribution Coordinator or Software.Distribution (AT) CS (DOT) CMU.EDU
    * School of Computer Science
    * Carnegie Mellon University
    * Pittsburgh PA 15213-3890
    *
    * any improvements or extensions that they make and grant Carnegie the
    * rights to redistribute these changes.
    */

    /*
    *Switches are;
    * Print the below switches
    * Print MIG version
    *
    *-[v,Q] verbose or not quiet: prints out type
    *and routine information as mig runs.
    *-[V,q] not verbose or quiet : don't print
    *information during compilation
    *(this is the default)
    *-[r,R] do or don't use rpc calls instead of
    *send/receive pairs. Default is -r.
    *-[s,S]generate symbol table or not: generate a
    *table of rpc-name, number, routine triplets
    *as an external data structure -- main use is
    *for protection system's specification of rights
    *and for protection dispatch code. Default is -s.
    *-i <prefix>
    *Put each user routine in its own file. The
    *file is named <prefix><routine-name>.c.
    *-user <name>
    *Name the user-side file <name>
    *-server <name>
    *Name the server-side file <name>
    *-header <name>
    *Name the user-side header file <name>
    *-iheader <name>
    *Name the user-side internal header file <name>
    *-sheader <name>
    *NAme the server-side header file <name>
    *
    * DESIGN:
    *Mig uses a lexxer module created by lex from lexxer.l and
    *a parser module created by yacc from parser.y to parse an
    *interface definitions module for a mach server.
    *The parser module calls routines in statement.c
    *and routines.c to build a list of statement structures.
    *The most interesting statements are the routine definitions
    *which contain information about the name, type, characteristics
    *of the routine, an argument list containing information for
    *each argument type, and a list of special arguments. The
    *argument type structures are build by routines in type.c
    * parsing is completed, the three code generation modules:
    *header.c user.c and server.c are called sequentially. These
    *do some code generation directly and also call the routines
    *in utils.c for common (parameterized) code generation.
    *
    */

    #include <stdio.h>

    #include "error.h"
    #include "lexxer.h"
    #include "global.h"
    #include "write.h"

    extern int yyparse();
    static FILE *myfopen(const char *name, const char *mode);
    static void myfclose(FILE *file, const char *name);

    static string_t RoutineListFileName;

    static void
    parseArgs(int argc, char **argv)
    {
    while ( 0)
    if ((++argv)[0][0] == '-')
    {
    switch (argv[0][1])
    {
    case '-':
    if (!strcmp(argv[0], ""))
    HelpMsg = TRUE;
    else if (!strcmp(argv[0], ""))
    PrintVersion = TRUE;
    break;
    case 'n':
    DefaultFiles = FALSE;
    break;
    case 'q':
    BeQuiet = TRUE;
    break;
    case 'Q':
    BeQuiet = FALSE;
    break;
    case 'v':
    BeVerbose = TRUE;
    break;
    case 'V':
    BeVerbose = FALSE;
    break;
    case 'r':
    UseMsgRPC = TRUE;
    break;
    case 'R':
    UseMsgRPC = FALSE;
    break;
    case 'l':
    if (streql(argv[0], "-list"))
    {
    ; ++argv;
    if (argc == 0)
    fatal("missing name for -list option");
    RoutineListFileName = strmake(argv[0]);
    }
    break;
    case 's':
    if (streql(argv[0], "-server"))
    {
    ; ++argv;
    if (argc == 0)
    fatal("missing name for -server option");
    ServerFileName = strmake(argv[0]);
    }
    else if (streql(argv[0], "-sheader"))
    {
    ; ++argv;
    if (argc == 0)
    fatal ("missing name for -sheader option");
    ServerHeaderFileName = strmake(argv[0]);
    }
    else if (streql(argv[0], "-subrprefix"))
    {
    ; ++argv;
    if (argc == 0)
    fatal ("missing string for -subrprefix option");
    SubrPrefix = strmake(argv[0]);
    }
    else
    GenSymTab = TRUE;
    break;
    case 'S':
    GenSymTab = FALSE;
    break;
    case 'i':
    if (streql(argv[0], "-iheader"))
    {
    ; ++argv;
    if (argc == 0)
    fatal("missing name for -iheader option");
    InternalHeaderFileName = strmake(argv[0]);
    }
    else
    {
    ; ++argv;
    if (argc == 0)
    fatal("missing prefix for -i option");
    UserFilePrefix = strmake(argv[0]);
    }
    break;
    case 'u':
    if (streql(argv[0], "-user"))
    {
    ; ++argv;
    if (argc == 0)
    fatal("missing name for -user option");
    UserFileName = strmake(argv[0]);
    }
    else
    fatal("unknown flag: '%s'", argv[0]);
    break;
    case 'h':
    if (streql(argv[0], "-header"))
    {
    ; ++argv;
    if (argc == 0)
    fatal("missing name for -header option");
    UserHeaderFileName = strmake(argv[0]);
    }
    else
    fatal("unknown flag: '%s'", argv[0]);
    break;
    case 'p':
    if (streql(argv[0], "-prefix"))
    {
    if ( == 0)
    fatal ("missing string for -prefix option");
    RoutinePrefix = strmake(argv);
    }
    break;
    default:
    fatal("unknown flag: '%s'", argv[0]);
    /*NTREACHED*/
    }
    }
    else
    fatal("bad argument: '%s'", *argv);
    }

    int
    main(int argc, char **argv)
    {
    FILE *uheader, *server, *user;
    FILE *iheader, *sheader;

    set_program_name("mig");
    parseArgs(argc, argv);

    if (HelpMsg)
    {
    printf("Mach Interface Generator (MIG) switches:\n");
    printf("\t Print MIG version\n");
    printf("\t-[v,Q] verbose or not quiet: prints out type\n");
    printf("\t\tand routine information as mig runs.\n");
    printf("\t-[V,q] not verbose or quiet : don't print\n");
    printf("\t\tinformation during compilation\n");
    printf("\t\t(this is the default)\n");
    printf("\t-[r,R] do or don't use rpc calls instead of\n");
    printf("\t\tsend/receive pairs. Default is -r.\n");
    printf("\t-[s,S] generate symbol table or not: generate a\n");
    printf("\t\ttable of rpc-name, number, routine triplets\n");
    printf("\t\tas an external data structure -- main use is\n");
    printf("\t\tfor protection system's specification of rights\n");
    printf("\t\tand for protection dispatch code. Default is -s.\n");
    printf("\t-i <prefix>\n");
    printf("\t\tPut each user routine in its own file. The\n");
    printf("\t\tfile is named <prefix><routine-name>.c.\n");
    printf("\t-user <name>\n");
    printf("\t\tName the user-side file <name>\n");
    printf("\t-server <name>\n");
    printf("\t\tName the server-side file <name>\n");
    printf("\t-header <name>\n");
    printf("\t\tName the user-side header file <name>\n");
    printf("\t-iheader <name>");
    printf("\t\tName the user-side internal header file <name>\n");
    printf("\t-sheader <name>\n");
    printf("\t\tNAme the server-side header file <name>\n");
    printf("\nReport bugs to bug-hurd (AT) gnu (DOT) org\n");
    exit(0);
    }

    if (PrintVersion)
    {
    printf("GNU MiG 1.3\n");
    printf("Copyright (C) 1989, 1991 Free Software Foundation, Inc.\n");
    printf(" Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\n");
    exit(0);
    }

    init_global();
    init_type();

    LookNormal();
    (void) yyparse();

    if (errors 0)
    exit(1);

    more_global();

    uheader = myfopen(UserHeaderFileName, "w");
    if (!UserFilePrefix)
    user = myfopen(UserFileName, "w");
    server = myfopen(ServerFileName, "w");
    if (ServerHeaderFileName)
    sheader = myfopen(ServerHeaderFileName, "w");
    if (IsKernelServer)
    {
    iheader = myfopen(InternalHeaderFileName, "w");
    }

    if (BeVerbose)
    {
    printf("Writing %s ", UserHeaderFileName);
    fflush(stdout);
    }
    WriteUserHeader(uheader, StatementList);
    myfclose(uheader, UserHeaderFileName);
    if (ServerHeaderFileName)
    {
    if (BeVerbose)
    {
    printf ("done.\nWriting %s ", ServerHeaderFileName);
    fflush (stdout);
    }
    WriteServerHeader(sheader, StatementList);
    myfclose(sheader, ServerHeaderFileName);
    }
    if (IsKernelServer)
    {
    if (BeVerbose)
    {
    printf("done.\nWriting %s ", InternalHeaderFileName);
    fflush(stdout);
    }
    WriteInternalHeader(iheader, StatementList);
    myfclose(iheader, InternalHeaderFileName);
    }
    if (UserFilePrefix)
    {
    if (BeVerbose)
    {
    printf("done.\nWriting individual user files ");
    fflush(stdout);
    }
    WriteUserIndividual(StatementList);
    }
    else
    {
    if (BeVerbose)
    {
    printf("done.\nWriting %s ", UserFileName);
    fflush(stdout);
    }
    WriteUser(user, StatementList);
    myfclose(user, UserFileName);
    }
    if (BeVerbose)
    {
    printf("done.\nWriting %s ", ServerFileName);
    fflush(stdout);
    }
    WriteServer(server, StatementList);
    myfclose(server, ServerFileName);

    if (RoutineListFileName != strNULL)
    {
    FILE *listfile = myfopen (RoutineListFileName, "w");
    WriteRoutineList (listfile, StatementList);
    myfclose (listfile, RoutineListFileName);
    }

    if (BeVerbose)
    printf("done.\n");

    return 0;
    }

    static FILE *
    myfopen(const char *name, const char *mode)
    {
    const char *realname;
    FILE *file;
    extern int errno;

    if (name == strNULL)
    realname = "/dev/null";
    else
    realname = name;

    file = fopen(realname, mode);
    if (file == NULL)
    fatal("fopen(%s): %s", realname, unix_error_string(errno));

    return file;
    }

    static void
    myfclose(FILE *file, const char *name)
    {
    if (ferror(file) || fclose(file))
    fatal("fclose(): ", name, unix_error_string(errno));
    }

    Constantine,

    I'm speaking out of my ass as usual but I assume he suggested Ben
    because we would prefer using argp and Ben is the argp master. But what
    you have looks reasonable.

    Thanks,

    Barry deFreese (aka bddebian)

    Bug-hurd mailing list
    Bug-hurd (AT) gnu (DOT) org
  • No.3 | | 671 bytes | |

    Barry deFreese wrote:
    Constantine,

    I'm speaking out of my ass as usual but I assume he suggested Ben
    because we would prefer using argp and Ben is the argp master. But what
    you have looks reasonable.

    Barry, this is the kind of sincerety i like in a man. Thank you
    for your explanation.

    However, the fact that i sent something doesn't mean that it will
    be admitted. Feel free to dump it to the garbage. It only took me
    a few minutes to write :). I'm sure that an argp implementation
    will be a better approach.

    Thanks,
    Constantine

    Bug-hurd mailing list
    Bug-hurd (AT) gnu (DOT) org
  • No.4 | | 695 bytes | |

    Hello!

    Wed, Nov 29, 2006 at 01:31:34PM -0800, Roland McGrath wrote:
    I am skeptical that's a good idea.

    Why?

    Why not just add switches as desired to the script to provide a simpler
    way to run it? e.g. mig or suchlike.

    Hm. That seems a bit like a workaround to me. There are a lot of places where
    the `mig' shell script is only used as a wrapper for `migcom', like with the
    given ``$(MIG) -cc cat - /dev/null'' example.

    Regards,
    Thomas

    Bug-hurd mailing list
    Bug-hurd (AT) gnu (DOT) org

    PGP SIGNATURE
    Version: GnuPG v1.4.1 (GNU/Linux)

    HSFXILc5kZUnYL1j+gQ=
    =fk1s
    PGP SIGNATURE
  • No.5 | | 836 bytes | |

    Wed, Nov 29, 2006 at 04:08:38PM -0800, Roland McGrath wrote:
    The idea that you want to run migcom is what's a workaround.

    Hm. Then I see two possibilities: a) implement handling for a number of
    GCC's command line arguments into the `mig' shell script or b) somehow
    make `migcom' work as a real backend (is that how they call it?) for GCC.

    b) seems interesting. And quite a bit of work. And a) is what I wanted
    to avoid when taking the route to first use the CPP directly on the
    `.defs' files and afterwards feed the pre-processed `.defs' files to
    `migcom'.

    Regards,
    Thomas

    Bug-hurd mailing list
    Bug-hurd (AT) gnu (DOT) org

    PGP SIGNATURE
    Version: GnuPG v1.4.1 (GNU/Linux)

    RDPWgtlVK0ajfdIlq9M=
    =QEzC
    PGP SIGNATURE
  • No.6 | | 886 bytes | |

    Hello!

    Wed, Nov 29, 2006 at 04:28:00PM -0800, Roland McGrath wrote:
    Using gcc driver with a custom specs file is probably not really hard.

    I had a look. After having read about that specs file language I first
    was under the same impression and was full of enthousiasm to do that.
    But it now seems to me that the specs file language is not powerful
    enough to properly handle that task and also that it might not be
    portable enough between different versions of GCC.

    So, did you alread have specific ideas about how to do that?

    the other hand I think that I've found a way to have the `mig' shell
    script do what we need.

    Regards,
    Thomas

    Bug-hurd mailing list
    Bug-hurd (AT) gnu (DOT) org

    PGP SIGNATURE
    Version: GnuPG v1.4.1 (GNU/Linux)

    HSMkYFiymeTeqZVk+=
    =DaX6
    PGP SIGNATURE
  • No.7 | | 2012 bytes | |

    Hello!

    Thu, Dec 07, 2006 at 12:14:53AM +0100, I wrote:
    Wed, Nov 29, 2006 at 04:28:00PM -0800, Roland McGrath wrote:
    Using gcc driver with a custom specs file is probably not really hard.

    I had a look. After having read about that specs file language I first
    was under the same impression and was full of enthousiasm to do that.
    But it now seems to me that the specs file language is not powerful
    enough to properly handle that task and also that

    To elaborate on that a bit further: from
    <>: ``It is built into
    GCC which switches take arguments and which do not. []''. This means
    we can't convince it to a syntax like ``gcc -user FILE'' or (avoiding to
    pollute general name spaces) ``gcc -Xmig-user FILE'', but would have to
    use a syntax like ``gcc -Xmig-user=FILE'', which seems to be a bit
    awkward to use. So far I had no succes to get a syntax like ``gcc
    -Wmig,-user,FILE'' to work. Given all that, we'd still want to use a
    (shell script) frontend that keeps up the current `mig' command line
    interface. But then I don't know if it's still worthwhile to do the
    specs file dance at all.

    it might not be portable enough between different versions of GCC.

    To complicate matters further this was confirmed by GCC's Andrew Pinski:
    ``specs are an internal format really. It is very subject to change each
    release. Also some time in the future we might decide to get rid of the
    specs.'', see <#c2>.

    So, did you alread have specific ideas about how to do that?

    Did you mean to do this task differently from what I've outlined above?

    My unfinished specs file is attached to this email.

    Regards,
    Thomas

    Bug-hurd mailing list
    Bug-hurd (AT) gnu (DOT) org

    PGP SIGNATURE
    Version: GnuPG v1.4.1 (GNU/Linux)

    /2g5mrZy9hULLvuiH4rf360=
    =Tqzu
    PGP SIGNATURE

Re: Moving `migcom' out of `/libexec/'


max 4000 letters.
Your nickname that display:
In order to stop the spam: 9 + 8 =
QUESTION ON "Unix"

EMSDN.COM