Thread: Custom printf/scanf suggestions desired

  1. #1
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,593

    Custom printf/scanf suggestions desired

    So far this is how I'm declaring my custom versions:
    Code:
    typedef struct _PAWBUF PAWSTR;
    typedef struct _PAW_PUTF PAW_PUTF;
    typedef struct _PAW_GETF PAW_GETF;
    
    struct _PAW_PUTF
    {
    	pawzu	sizeof_ud;
    	pawd	(*test)( void *ud, va_list va );
    	pawd	(*take)( void *ud, PAWSTR *str );
    	pawzu	(*size)( void *ud );
    };
    
    struct _PAW_GETF
    {
    	pawzu	sizeof_ud;
    	pawd	(*test)( void *ud, va_list va );
    	pawd	(*take)( void *ud, PAWSTR const *str );
    };
    
    /* Defaults used if NULL is given */
    extern PAW_PUTF const *pawStdPutf;
    extern PAW_GETF const *pawStdGetf;
    
    PAW_API pawd	pawPutf( PAW_PUTF const *use, PAWSTR *str, paws format, ... );
    PAW_API pawd	pawPutv
    	( PAW_PUTF const *use, PAWSTR *str, paws format, va_list va );
    
    PAW_API pawd	pawGetf
    	( PAW_GETF const *use, PAWSTR const *str, paws format, ... );
    PAW_API pawd	pawGetv
    	( PAW_GETF const *use, PAWSTR const *str, paws format, va_list va );
    Besides declaring externs for %s etc what suggestions does anyone have for more flexibility?

  2. #2
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,593
    Judging by the lack of responses I'm guessing nobody has any suggestion for increasing flexibility so I'll just bulldoze ahead with this api

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Suggestions desired
    By awsdert in forum C Programming
    Replies: 1
    Last Post: 01-13-2022, 12:31 PM
  2. Help printf desired number of characters
    By Swoorup in forum C Programming
    Replies: 2
    Last Post: 05-22-2012, 07:58 AM
  3. Need help. printf() and scanf().
    By HBK in forum C Programming
    Replies: 19
    Last Post: 07-17-2011, 04:04 PM
  4. printf and scanf
    By silentintek in forum C Programming
    Replies: 1
    Last Post: 10-27-2008, 09:32 PM
  5. printf and scanf
    By studentc in forum C Programming
    Replies: 3
    Last Post: 06-11-2004, 03:07 PM

Tags for this Thread