summaryrefslogtreecommitdiff
path: root/src/MSL_C.PPCEABI.bare.H/sscanf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/MSL_C.PPCEABI.bare.H/sscanf.c')
-rw-r--r--src/MSL_C.PPCEABI.bare.H/sscanf.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/MSL_C.PPCEABI.bare.H/sscanf.c b/src/MSL_C.PPCEABI.bare.H/sscanf.c
new file mode 100644
index 0000000..171ee58
--- /dev/null
+++ b/src/MSL_C.PPCEABI.bare.H/sscanf.c
@@ -0,0 +1,26 @@
+#include "stdio.h"
+
+int __StringRead(void* isc, int ch, int Action) {
+ char ret;
+ __InStrCtrl* iscp = (__InStrCtrl*)isc;
+ switch (Action) {
+ case __GetChar:
+ ret = *(iscp->NextChar);
+ if (ret == '\0') {
+ iscp->NullCharDetected = 1;
+ return (EOF);
+ } else {
+ iscp->NextChar++;
+ return ((unsigned char)ret);
+ }
+ case __UngetChar:
+ if (!iscp->NullCharDetected)
+ iscp->NextChar--;
+ else
+ iscp->NullCharDetected = 0;
+ return (ch);
+ case __CheckForError:
+ return (iscp->NullCharDetected);
+ }
+ return 0;
+}