From 4f6a4b55101f9b2c5356eda43b0f56fa61ce5775 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 15 Oct 2008 01:53:09 +0200 Subject: Share idl_types.h. --- librpc/idl/idl_types.h | 69 +++++++++++++++++++++++++++++++++++++ source3/Makefile.in | 18 +++++----- source3/librpc/idl/idl_types.h | 69 ------------------------------------- source3/script/build_idl.sh | 12 +++---- source4/librpc/idl/idl_types.h | 69 ------------------------------------- source4/librpc/scripts/build_idl.sh | 2 +- 6 files changed, 86 insertions(+), 153 deletions(-) create mode 100644 librpc/idl/idl_types.h delete mode 100644 source3/librpc/idl/idl_types.h delete mode 100644 source4/librpc/idl/idl_types.h diff --git a/librpc/idl/idl_types.h b/librpc/idl/idl_types.h new file mode 100644 index 0000000000..9885ca5bf6 --- /dev/null +++ b/librpc/idl/idl_types.h @@ -0,0 +1,69 @@ +#define STR_ASCII LIBNDR_FLAG_STR_ASCII +#define STR_LEN4 LIBNDR_FLAG_STR_LEN4 +#define STR_SIZE4 LIBNDR_FLAG_STR_SIZE4 +#define STR_SIZE2 LIBNDR_FLAG_STR_SIZE2 +#define STR_NOTERM LIBNDR_FLAG_STR_NOTERM +#define STR_NULLTERM LIBNDR_FLAG_STR_NULLTERM +#define STR_BYTESIZE LIBNDR_FLAG_STR_BYTESIZE +#define STR_CONFORMANT LIBNDR_FLAG_STR_CONFORMANT +#define STR_CHARLEN LIBNDR_FLAG_STR_CHARLEN +#define STR_UTF8 LIBNDR_FLAG_STR_UTF8 + +/* + a null terminated UCS2 string +*/ +#define nstring [flag(STR_NULLTERM)] string + +/* + an ascii string prefixed with [offset] [length], both 32 bits + null terminated +*/ +#define ascstr2 [flag(STR_ASCII|STR_LEN4)] string + +/* + an ascii string prefixed with [size], 32 bits +*/ +#define asclstr [flag(STR_ASCII|STR_SIZE4)] string + +/* + an ascii string prefixed with [size], 16 bits + null terminated +*/ +#define ascstr3 [flag(STR_ASCII|STR_SIZE2)] string + +/* + an ascii string prefixed with [size] [offset] [length], all 32 bits + not null terminated +*/ +#define ascstr_noterm [flag(STR_NOTERM|STR_ASCII|STR_SIZE4|STR_LEN4)] string + +/* + a null terminated ascii string +*/ +#define astring [flag(STR_ASCII|STR_NULLTERM)] string + +/* + a null terminated UTF8 string +*/ +#define utf8string [flag(STR_UTF8|STR_NULLTERM)] string + +/* + a null terminated UCS2 string +*/ +#define nstring_array [flag(STR_NULLTERM)] string_array + +#define NDR_NOALIGN LIBNDR_FLAG_NOALIGN +#define NDR_REMAINING LIBNDR_FLAG_REMAINING +#define NDR_ALIGN2 LIBNDR_FLAG_ALIGN2 +#define NDR_ALIGN4 LIBNDR_FLAG_ALIGN4 +#define NDR_ALIGN8 LIBNDR_FLAG_ALIGN8 + +/* this flag is used to force a section of IDL as little endian. It is + needed for the epmapper IDL, which is defined as always being LE */ +#define NDR_LITTLE_ENDIAN LIBNDR_FLAG_LITTLE_ENDIAN +#define NDR_BIG_ENDIAN LIBNDR_FLAG_BIGENDIAN + +/* + this is used to control formatting of uint8 arrays +*/ +#define NDR_PAHEX LIBNDR_PRINT_ARRAY_HEX diff --git a/source3/Makefile.in b/source3/Makefile.in index 234490e048..e99756752d 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -1198,14 +1198,16 @@ modules:: SHOWFLAGS $(MODULES) ##################################################################### ## Perl IDL Compiler samba3-idl:: - @IDL_FILES="lsa.idl dfs.idl echo.idl winreg.idl initshutdown.idl \ - srvsvc.idl svcctl.idl eventlog.idl wkssvc.idl netlogon.idl notify.idl \ - epmapper.idl messaging.idl xattr.idl misc.idl samr.idl security.idl \ - dssetup.idl krb5pac.idl ntsvcs.idl libnetapi.idl drsuapi.idl drsblobs.idl \ - nbt.idl" \ - IDL_PATH="librpc/idl" \ - CPP="$(CPP)" PIDL="../pidl/pidl" \ - srcdir="$(srcdir)" $(srcdir)/script/build_idl.sh $(PIDL_ARGS) + @PIDL_ARGS="$(PIDL_ARGS)" CPP="$(CPP)" PIDL="../pidl/pidl" \ + srcdir="$(srcdir)" $(srcdir)/script/build_idl.sh librpc/idl/lsa.idl \ + ../librpc/idl/dfs.idl ../librpc/idl/echo.idl librpc/idl/winreg.idl \ + librpc/idl/initshutdown.idl librpc/idl/srvsvc.idl librpc/idl/svcctl.idl \ + librpc/idl/eventlog.idl librpc/idl/wkssvc.idl librpc/idl/netlogon.idl \ + ../librpc/idl/notify.idl librpc/idl/epmapper.idl librpc/idl/messaging.idl \ + librpc/idl/xattr.idl librpc/idl/misc.idl librpc/idl/samr.idl \ + librpc/idl/security.idl ../librpc/idl/dssetup.idl librpc/idl/krb5pac.idl \ + librpc/idl/ntsvcs.idl librpc/idl/libnetapi.idl librpc/idl/drsuapi.idl \ + librpc/idl/drsblobs.idl librpc/idl/nbt.idl ##################################################################### diff --git a/source3/librpc/idl/idl_types.h b/source3/librpc/idl/idl_types.h deleted file mode 100644 index 9885ca5bf6..0000000000 --- a/source3/librpc/idl/idl_types.h +++ /dev/null @@ -1,69 +0,0 @@ -#define STR_ASCII LIBNDR_FLAG_STR_ASCII -#define STR_LEN4 LIBNDR_FLAG_STR_LEN4 -#define STR_SIZE4 LIBNDR_FLAG_STR_SIZE4 -#define STR_SIZE2 LIBNDR_FLAG_STR_SIZE2 -#define STR_NOTERM LIBNDR_FLAG_STR_NOTERM -#define STR_NULLTERM LIBNDR_FLAG_STR_NULLTERM -#define STR_BYTESIZE LIBNDR_FLAG_STR_BYTESIZE -#define STR_CONFORMANT LIBNDR_FLAG_STR_CONFORMANT -#define STR_CHARLEN LIBNDR_FLAG_STR_CHARLEN -#define STR_UTF8 LIBNDR_FLAG_STR_UTF8 - -/* - a null terminated UCS2 string -*/ -#define nstring [flag(STR_NULLTERM)] string - -/* - an ascii string prefixed with [offset] [length], both 32 bits - null terminated -*/ -#define ascstr2 [flag(STR_ASCII|STR_LEN4)] string - -/* - an ascii string prefixed with [size], 32 bits -*/ -#define asclstr [flag(STR_ASCII|STR_SIZE4)] string - -/* - an ascii string prefixed with [size], 16 bits - null terminated -*/ -#define ascstr3 [flag(STR_ASCII|STR_SIZE2)] string - -/* - an ascii string prefixed with [size] [offset] [length], all 32 bits - not null terminated -*/ -#define ascstr_noterm [flag(STR_NOTERM|STR_ASCII|STR_SIZE4|STR_LEN4)] string - -/* - a null terminated ascii string -*/ -#define astring [flag(STR_ASCII|STR_NULLTERM)] string - -/* - a null terminated UTF8 string -*/ -#define utf8string [flag(STR_UTF8|STR_NULLTERM)] string - -/* - a null terminated UCS2 string -*/ -#define nstring_array [flag(STR_NULLTERM)] string_array - -#define NDR_NOALIGN LIBNDR_FLAG_NOALIGN -#define NDR_REMAINING LIBNDR_FLAG_REMAINING -#define NDR_ALIGN2 LIBNDR_FLAG_ALIGN2 -#define NDR_ALIGN4 LIBNDR_FLAG_ALIGN4 -#define NDR_ALIGN8 LIBNDR_FLAG_ALIGN8 - -/* this flag is used to force a section of IDL as little endian. It is - needed for the epmapper IDL, which is defined as always being LE */ -#define NDR_LITTLE_ENDIAN LIBNDR_FLAG_LITTLE_ENDIAN -#define NDR_BIG_ENDIAN LIBNDR_FLAG_BIGENDIAN - -/* - this is used to control formatting of uint8 arrays -*/ -#define NDR_PAHEX LIBNDR_PRINT_ARRAY_HEX diff --git a/source3/script/build_idl.sh b/source3/script/build_idl.sh index 75f8612957..34f262ee00 100755 --- a/source3/script/build_idl.sh +++ b/source3/script/build_idl.sh @@ -1,14 +1,14 @@ #!/bin/sh -PIDL_ARGS="--outputdir librpc/gen_ndr --header --ndr-parser --samba3-ndr-server --samba3-ndr-client --" -PIDL_EXTRA_ARGS="$*" +ARGS="--includedir=../librpc/idl --outputdir librpc/gen_ndr --header --ndr-parser --samba3-ndr-server --samba3-ndr-client $PIDL_ARGS --" +IDL_FILES="$*" oldpwd=`pwd` cd ${srcdir} [ -d librpc/gen_ndr ] || mkdir -p librpc/gen_ndr || exit 1 -PIDL="$PIDL ${PIDL_ARGS} ${PIDL_EXTRA_ARGS}" +PIDL="$PIDL $ARGS" ## ## Find newer files rather than rebuild all of them @@ -20,11 +20,11 @@ for f in ${IDL_FILES}; do ndr="librpc/gen_ndr/ndr_$basename.c" if [ -f $ndr ]; then - if [ "x`find ${IDL_PATH}/$f -newer $ndr -print`" = "x${IDL_PATH}/$f" ]; then - list="$list ${IDL_PATH}/$f" + if [ "x`find $f -newer $ndr -print`" = "x$f" ]; then + list="$list $f" fi else - list="$list ${IDL_PATH}/$f" + list="$list $f" fi done diff --git a/source4/librpc/idl/idl_types.h b/source4/librpc/idl/idl_types.h deleted file mode 100644 index 9885ca5bf6..0000000000 --- a/source4/librpc/idl/idl_types.h +++ /dev/null @@ -1,69 +0,0 @@ -#define STR_ASCII LIBNDR_FLAG_STR_ASCII -#define STR_LEN4 LIBNDR_FLAG_STR_LEN4 -#define STR_SIZE4 LIBNDR_FLAG_STR_SIZE4 -#define STR_SIZE2 LIBNDR_FLAG_STR_SIZE2 -#define STR_NOTERM LIBNDR_FLAG_STR_NOTERM -#define STR_NULLTERM LIBNDR_FLAG_STR_NULLTERM -#define STR_BYTESIZE LIBNDR_FLAG_STR_BYTESIZE -#define STR_CONFORMANT LIBNDR_FLAG_STR_CONFORMANT -#define STR_CHARLEN LIBNDR_FLAG_STR_CHARLEN -#define STR_UTF8 LIBNDR_FLAG_STR_UTF8 - -/* - a null terminated UCS2 string -*/ -#define nstring [flag(STR_NULLTERM)] string - -/* - an ascii string prefixed with [offset] [length], both 32 bits - null terminated -*/ -#define ascstr2 [flag(STR_ASCII|STR_LEN4)] string - -/* - an ascii string prefixed with [size], 32 bits -*/ -#define asclstr [flag(STR_ASCII|STR_SIZE4)] string - -/* - an ascii string prefixed with [size], 16 bits - null terminated -*/ -#define ascstr3 [flag(STR_ASCII|STR_SIZE2)] string - -/* - an ascii string prefixed with [size] [offset] [length], all 32 bits - not null terminated -*/ -#define ascstr_noterm [flag(STR_NOTERM|STR_ASCII|STR_SIZE4|STR_LEN4)] string - -/* - a null terminated ascii string -*/ -#define astring [flag(STR_ASCII|STR_NULLTERM)] string - -/* - a null terminated UTF8 string -*/ -#define utf8string [flag(STR_UTF8|STR_NULLTERM)] string - -/* - a null terminated UCS2 string -*/ -#define nstring_array [flag(STR_NULLTERM)] string_array - -#define NDR_NOALIGN LIBNDR_FLAG_NOALIGN -#define NDR_REMAINING LIBNDR_FLAG_REMAINING -#define NDR_ALIGN2 LIBNDR_FLAG_ALIGN2 -#define NDR_ALIGN4 LIBNDR_FLAG_ALIGN4 -#define NDR_ALIGN8 LIBNDR_FLAG_ALIGN8 - -/* this flag is used to force a section of IDL as little endian. It is - needed for the epmapper IDL, which is defined as always being LE */ -#define NDR_LITTLE_ENDIAN LIBNDR_FLAG_LITTLE_ENDIAN -#define NDR_BIG_ENDIAN LIBNDR_FLAG_BIGENDIAN - -/* - this is used to control formatting of uint8 arrays -*/ -#define NDR_PAHEX LIBNDR_PRINT_ARRAY_HEX diff --git a/source4/librpc/scripts/build_idl.sh b/source4/librpc/scripts/build_idl.sh index a655931c02..59539638fa 100755 --- a/source4/librpc/scripts/build_idl.sh +++ b/source4/librpc/scripts/build_idl.sh @@ -7,7 +7,7 @@ IDL_FILES="$*" [ -d $OUTDIR ] || mkdir -p $OUTDIR || exit 1 -PIDL="$PIDL --outputdir $OUTDIR --header --ndr-parser --server --client --swig --python --dcom-proxy --com-header -- $IDL_FILES" +PIDL="$PIDL --outputdir $OUTDIR --header --ndr-parser --server --client --swig --python --dcom-proxy --com-header --includedir ../librpc/idl -- $IDL_FILES" if [ x$FULLBUILD = xFULL ]; then echo Rebuilding all idl files in $IDLDIR -- cgit