EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index

StdLib/LibC/Stdio/sscanf.c

Go to the documentation of this file.
00001 
00046 #include  <LibConfig.h>
00047 
00048 #include <assert.h>
00049 #include <errno.h>
00050 #include <stdarg.h>
00051 #include <stdio.h>
00052 #include <string.h>
00053 
00054 #include "reentrant.h"
00055 #include "local.h"
00056 
00057 static int eofread(void *, char *, int);
00058 
00059 /* ARGSUSED */
00060 static int
00061 eofread(void *cookie, char *buf, int len)
00062 {
00063 
00064   return (0);
00065 }
00066 
00067 int
00068 sscanf(const char *str, char const *fmt, ...)
00069 {
00070   int ret;
00071   va_list ap;
00072   FILE f;
00073   struct __sfileext fext;
00074 
00075   _DIAGASSERT(str != NULL);
00076   _DIAGASSERT(fmt != NULL);
00077 
00078   _FILEEXT_SETUP(&f, &fext);
00079   f._flags = __SRD;
00080   f._bf._base = f._p = __UNCONST(str);
00081   f._bf._size = f._r = (int)strlen(str);
00082   f._read = eofread;
00083   _UB(&f)._base = NULL;
00084   f._lb._base = NULL;
00085   va_start(ap, fmt);
00086   ret = __svfscanf_unlocked(&f, fmt, ap);
00087   va_end(ap);
00088   return (ret);
00089 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines