your inline code is displaying in mailx with no newlines
its probably a quoted-printable parse problem on my side
could you repost with cut and paste
thanks

On Tue, 3 Aug 2010 18:12:06 -0400 Finnbarr Murphy wrote:
> --===============0599741294==
> Content-Type: multipart/alternative;
>       boundary="_c9bd5cb5-7af1-4e8c-887e-3d9f1a522520_"

> --_c9bd5cb5-7af1-4e8c-887e-3d9f1a522520_
> Content-Type: text/plain; charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable

> Would it be possible to add a new -v option to ksh93's builtin to return th=
> e version number of a plugin?
> Here is a quick prototype I put together to demonstrate the functionality:
> Modify ../src/cmd/ksh93/bltins/typeset.c
> 810c810<       register int n=2C r=3D0=2C flag=3D0=3B--->       register in=
> t n=2C r=3D0=2C flag=3D0=2C vflag=3D0=3B839a840=2C842>             case 'v'=
> :>                 vflag=3D1=3B>                 break=3B858a862=2C868>>   =
>       /* display plugin version number */>         if (vflag && *argv) {>  =
>            r =3D dllversion(*argv)=3B>             return (r)=3B>         }=
> >
> and ../src/cmd/ksh93/data/builtins.c
> 392d391> "[v?Display plugin version number.]"
> Add following function to any of the files in ../src/lib/libdll (or create =
> new source code file)I put it in dllcheck.c.
> extern intdllversion(const char* path){        unsigned long           v=3B=
>         void *                 dll=3B        Dll_plugin_version_f    pvf=3B
>         if (dll =3D dllopen(path=2C RTLD_LAZY|RTLD_GLOBAL|RTLD_PARENT))    =
>     {              if (!(pvf =3D (Dll_plugin_version_f)dlllook(dll=2C "plug=
> in_version")))              {                  dlclose(dll)=3B             =
>      sfprintf(sfstderr=2C "plugin_version() not found\n")=3B               =
>    return 0=3B              }              v =3D (*pvf)()=3B              s=
> fprintf(sfstdout=2C "%lu" =2C v)=3B              dlclose(dll)=3B           =
>    return 1=3B        }
>         return 0=3B}
> Here is the output for the example hash plugin I detailed in an earlier mes=
> sage.
> $ version=3D$(builtin -v ./libhash.so)$ echo $version20100601$ version=3D$(=
> builtin -v libhash.so)$ echo $version
> $
> - Finnbarr                                      =

> --_c9bd5cb5-7af1-4e8c-887e-3d9f1a522520_
> Content-Type: text/html; charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable

> <html>
> <head>
> <style><!--
> .hmmessage P
> {
> margin:0px=3B
> padding:0px
> }
> body.hmmessage
> {
> font-size: 10pt=3B
> font-family:Tahoma
> }
> --></style>
> </head>
> <body class=3D'hmmessage'>
> <br><div>Would it be possible to add a new -v option to ksh93's builtin to =
> return the version number of a plugin?</div><div><br></div><div>Here is a q=
> uick prototype I put together to demonstrate the functionality:</div><div><=
> br></div><div>Modify ../src/cmd/ksh93/bltins/typeset.c</div><div><br></div>=
> <div>810c810</div><div>&lt=3B &nbsp=3B &nbsp=3B &nbsp=3B register int n=2C =
> r=3D0=2C flag=3D0=3B</div><div>---</div><div>&gt=3B &nbsp=3B &nbsp=3B &nbsp=
> =3B register int n=2C r=3D0=2C flag=3D0=2C vflag=3D0=3B</div><div>839a840=
> =2C842</div><div>&gt=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=
> =3B case 'v':</div><div>&gt=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B=
>  &nbsp=3B &nbsp=3B &nbsp=3B vflag=3D1=3B</div><div>&gt=3B &nbsp=3B &nbsp=3B=
>  &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B break=3B</div><div>8=
> 58a862=2C868</div><div>&gt=3B</div><div>&gt=3B &nbsp=3B &nbsp=3B &nbsp=3B &=
> nbsp=3B /* display plugin version number */</div><div>&gt=3B &nbsp=3B &nbsp=
> =3B &nbsp=3B &nbsp=3B if (vflag &amp=3B&amp=3B *argv) {</div><div>&gt=3B &n=
> bsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B r =3D dllversion(*argv)=
> =3B</div><div>&gt=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B =
> return (r)=3B</div><div>&gt=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B }</div><=
> div>&gt=3B</div><div><br></div><div>and ../src/cmd/ksh93/data/builtins.c</d=
> iv><div><br></div><div>392d391</div><div>&gt=3B "[v?Display plugin version =
> number.]"</div><div><br></div><div>Add following function to any of the fil=
> es in ../src/lib/libdll (or create new source code file)</div><div><div>I p=
> ut it in dllcheck.c.</div><div><br></div><div>extern int</div><div>dllversi=
> on(const char* path)</div><div>{</div><div>&nbsp=3B&nbsp=3B &nbsp=3B &nbsp=
> =3B &nbsp=3Bunsigned long &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B v=3B=
> </div><div>&nbsp=3B&nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3Bvoid * &nbsp=3B &nbsp=
> =3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B dll=3B</div><div>=
> &nbsp=3B&nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3BDll_plugin_version_f &nbsp=3B &n=
> bsp=3Bpvf=3B</div><div><br></div><div>&nbsp=3B&nbsp=3B &nbsp=3B &nbsp=3B &n=
> bsp=3Bif (dll =3D dllopen(path=2C RTLD_LAZY|RTLD_GLOBAL|RTLD_PARENT))</div>=
> <div>&nbsp=3B&nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B{</div><div>&nbsp=3B&nbsp=
> =3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3Bif (!(pvf =3D (Dll=
> _plugin_version_f)dlllook(dll=2C "plugin_version")))</div><div>&nbsp=3B&nbs=
> p=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B{</div><div>&nbsp=
> =3B&nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B =
> &nbsp=3Bdlclose(dll)=3B</div><div>&nbsp=3B&nbsp=3B &nbsp=3B &nbsp=3B &nbsp=
> =3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3Bsfprintf(sfstderr=2C "plugi=
> n_version() not found\n")=3B</div><div>&nbsp=3B&nbsp=3B &nbsp=3B &nbsp=3B &=
> nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3Breturn 0=3B</div><div>&=
> nbsp=3B&nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B}</div=
> ><div>&nbsp=3B&nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=
> =3Bv =3D (*pvf)()=3B</div><div>&nbsp=3B&nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B =
> &nbsp=3B &nbsp=3B &nbsp=3Bsfprintf(sfstdout=2C "%lu" =2C v)=3B</div><div>&n=
> bsp=3B&nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3Bdlclose=
> (dll)=3B</div><div>&nbsp=3B&nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3B &nb=
> sp=3B &nbsp=3Breturn 1=3B</div><div>&nbsp=3B&nbsp=3B &nbsp=3B &nbsp=3B &nbs=
> p=3B}</div><div><br></div><div>&nbsp=3B&nbsp=3B &nbsp=3B &nbsp=3B &nbsp=3Br=
> eturn 0=3B</div><div>}</div><div><br></div><div>Here is the output for the =
> example hash plugin I detailed in an earlier message.</div><div><br></div><=
> div>$ version=3D$(builtin -v ./libhash.so)</div><div>$ echo $version</div><=
> div>20100601</div><div>$ version=3D$(builtin -v libhash.so)</div><div>$ ech=
> o $version</div><div><br></div><div>$</div></div><div><br></div><div>- Finn=
> barr</div>                                      </body>
> </html>=

> --_c9bd5cb5-7af1-4e8c-887e-3d9f1a522520_--

> --===============0599741294==
> Content-Type: text/plain; charset="us-ascii"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline

> _______________________________________________
> ast-developers mailing list
> [email protected]
> https://mailman.research.att.com/mailman/listinfo/ast-developers

> --===============0599741294==--

_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to