/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
* Intramodule declarations.
*/
#ifndef __xpidl_h
#define __xpidl_h
#include <errno.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
#ifndef XP_MAC
#else
#include <IDL.h>
#endif
#include <xpt_struct.h>
/*
* IDL_tree_warning bombs on libIDL version 6.5, and I don't want to not write
* warnings... so I define a versioned one here. Thanks to Mike Shaver for the
* this solution, which allows us to pass through varargs calls.
*/
/*
* This turns a varargs call to XPIDL_WARNING directly into a varargs
* call to IDL_tree_warning or xpidl_tree_warning as appropriate. The
* only tricky bit is that you must call XPIDL_WARNING with extra
* parens, e.g. XPIDL_WARNING((foo, bar, "sil"))
*
* Probably best removed when we leave 6.5. */
#else
#endif
/*
* Internal operation flags.
*/
extern gboolean enable_debug;
extern gboolean enable_warnings;
extern gboolean verbose_mode;
extern gboolean emit_typelib_annotations;
extern gboolean explicit_output_filename;
extern PRUint8 major_version;
extern PRUint8 minor_version;
/*
* A function to handle an IDL_tree type.
*/
/*
* Struct containing functions to define the behavior of a given output mode.
*/
typedef struct backend {
} backend;
/* Function that produces a struct of output-generation functions */
extern backend *xpidl_header_dispatch(void);
extern backend *xpidl_typelib_dispatch(void);
extern backend *xpidl_doc_dispatch(void);
extern backend *xpidl_java_dispatch(void);
typedef struct ModeData {
char *mode;
char *modeInfo;
char *suffix;
} ModeData;
typedef struct IncludePathEntry {
char *directory;
struct TreeState {
/* Maybe supplied by -o. Not related to (g_)basename from string.h or glib */
char *basename;
char *real_outname;
#endif
};
/*
* Process an IDL file, generating InterfaceInfo, documentation and headers as
* appropriate.
*/
int
/*
* Iterate over an IDLN_LIST -- why is this not part of libIDL?
*/
void
/*
* Wrapper whines to stderr then exits after null return from malloc or strdup.
*/
void *
char *
xpidl_strdup(const char *s);
/*
* Return a pointer to the start of the base filename of path
*/
const char *
xpidl_basename(const char * path);
/*
* Process an XPIDL node and its kids, if any.
*/
/*
* Write a newline folllowed by an indented, one-line comment containing IDL
* source decompiled from state->tree.
*/
void
/*
* Functions for parsing and printing UUIDs.
*/
/*
* How large should the buffer supplied to xpidl_sprint_IID be?
*/
/*
* Print an iid to into a supplied buffer; the buffer should be at least
* UUID_LENGTH bytes.
*/
/*
* Parse a uuid string into an nsID struct. We cannot link against libxpcom,
* so we re-implement nsID::Parse here.
*/
/* Try to common a little node-handling stuff. */
/* is this node from an aggregate type (interface)? */
(IDL_NODE_UP(node) && \
(IDL_NODE_UP(node) && \
/* is this type output in the form "<foo> *"? */
/*
* Find the underlying type of an identifier typedef. Returns NULL
* (and doesn't complain) on failure.
*/
IDL_tree /* IDL_TYPE_DCL */
/*
* Check that const declarations match their stated sign and are of the
* appropriate types.
*/
/*
* Check that scriptable attributes in scriptable interfaces actually are.
*/
/*
* Perform various validation checks on methods.
*/
/*
* Verifies the interface declaration
*/
/*
* Verify that a native declaration has an associated C++ expression, i.e. that
* it's of the form native <idl-name>(<c++-name>)
*/
void
#endif /* __xpidl_h */