diff options
author | midipix <writeonce@midipix.org> | 2018-08-04 05:02:19 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2018-08-04 05:21:03 -0400 |
commit | 2dfa014f328f366d1f78481d9f91c76df5b5007a (patch) | |
tree | ff12454b64c8cceb1966e548dee81bf6612abb74 /src/output | |
parent | d4f88d42725956c3aa6d9c6e83e70729c1a938e8 (diff) | |
download | sofort-2dfa014f328f366d1f78481d9f91c76df5b5007a.tar.bz2 sofort-2dfa014f328f366d1f78481d9f91c76df5b5007a.tar.xz |
output interfaces: revised API and implementation to use fdctx and pure fdio.
Diffstat (limited to 'src/output')
-rw-r--r-- | src/output/sfrt_output_address.c | 13 | ||||
-rw-r--r-- | src/output/sfrt_output_dummy.c | 12 | ||||
-rw-r--r-- | src/output/sfrt_output_name.c | 12 |
3 files changed, 28 insertions, 9 deletions
diff --git a/src/output/sfrt_output_address.c b/src/output/sfrt_output_address.c index 019a2dd..c9b16a1 100644 --- a/src/output/sfrt_output_address.c +++ b/src/output/sfrt_output_address.c @@ -5,9 +5,16 @@ #include <errno.h> #include <sofort/sofort.h> +#include "sofort_driver_impl.h" +#include "sofort_dprintf_impl.h" -sfrt_api -int sfrt_output_address(const struct sfrt_unit_ctx * uctx, FILE * f) +int sfrt_output_address( + const struct sfrt_driver_ctx * dctx, + const struct sfrt_unit_ctx * uctx) { - return fprintf(f,"%*p\n",(int)(2*sizeof(size_t)),uctx->map->addr); + return sfrt_dprintf( + sfrt_driver_fdout(dctx), + "%*p\n", + (int)(2*sizeof(size_t)), + uctx->map->addr); } diff --git a/src/output/sfrt_output_dummy.c b/src/output/sfrt_output_dummy.c index 4342737..c29f7e1 100644 --- a/src/output/sfrt_output_dummy.c +++ b/src/output/sfrt_output_dummy.c @@ -5,9 +5,15 @@ #include <errno.h> #include <sofort/sofort.h> +#include "sofort_driver_impl.h" +#include "sofort_dprintf_impl.h" -sfrt_api -int sfrt_output_dummy (const struct sfrt_common_ctx * cctx, FILE * f) +int sfrt_output_dummy (const struct sfrt_driver_ctx * dctx) { - return fprintf(f,"%s\n",cctx->anystring ? cctx->anystring : "(null)"); + return sfrt_dprintf( + sfrt_driver_fdout(dctx), + "%s\n", + dctx->cctx->anystring + ? dctx->cctx->anystring + : "(null)"); } diff --git a/src/output/sfrt_output_name.c b/src/output/sfrt_output_name.c index c0aff5e..7eb874e 100644 --- a/src/output/sfrt_output_name.c +++ b/src/output/sfrt_output_name.c @@ -5,9 +5,15 @@ #include <errno.h> #include <sofort/sofort.h> +#include "sofort_driver_impl.h" +#include "sofort_dprintf_impl.h" -sfrt_api -int sfrt_output_name(const struct sfrt_unit_ctx * uctx, FILE * f) +int sfrt_output_name( + const struct sfrt_driver_ctx * dctx, + const struct sfrt_unit_ctx * uctx) { - return fprintf(f,"%s\n",*uctx->path); + return sfrt_dprintf( + sfrt_driver_fdout(dctx), + "%s\n", + *uctx->path); } |