Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #pragma ident "@(#) libf/fio/skipf.c 92.1 06/21/99 10:37:55"
00039
00040 #include <errno.h>
00041 #include <ffio.h>
00042 #include <liberrno.h>
00043 #include "fio.h"
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 #define ERET(x) { \
00056 if (narg > 3) { \
00057 *retstat = x; \
00058 goto ret; \
00059 } else \
00060 _ferr(&cfs, x); \
00061 }
00062
00063 void
00064 SKIPF(
00065 _f_int *unump,
00066 _f_int8 *nb,
00067 _f_int *istat,
00068 _f_int *retstat)
00069 {
00070 register int narg;
00071 register unum_t unum;
00072 unit *cup;
00073 struct fiostate cfs;
00074 struct ffp_skipf_s skip_arg;
00075
00076 #ifdef _UNICOS
00077 narg = _numargs();
00078 #else
00079 narg = 4;
00080 #endif
00081 if (narg > 2) {
00082 *(istat) = 0;
00083 *(istat + 1) = 0;
00084 }
00085
00086 unum = *unump;
00087
00088 STMT_BEGIN(unum, 0, T_MISC, NULL, &cfs, cup);
00089
00090
00091
00092 if (cup == NULL) {
00093 int ostat;
00094
00095 cup = _imp_open(&cfs, SEQ, UNF, unum, 1, &ostat);
00096
00097 if (cup == NULL) {
00098 ERET(ostat);
00099 }
00100 }
00101
00102 switch (cup->ufs) {
00103 case FS_FDC:
00104 skip_arg.ffp_nfil = *nb;
00105 skip_arg.ffp_nrec = 0;
00106 if(XRCALL(cup->ufp.fdc, posrtn) cup->ufp.fdc,
00107 FP_SKIPF, &skip_arg, 2, &cup->uffsw) < 0)
00108 ERET(errno);
00109 if (narg > 2) {
00110 *(istat+1) = skip_arg.ffp_nfil;
00111 *(istat) = skip_arg.ffp_nrec;
00112 }
00113 break;
00114 default:
00115 ERET(FENOSKPF);
00116 }
00117
00118 ret:
00119 cup->uwrt = 0;
00120 cup->uend = BEFORE_ENDFILE;
00121
00122 STMT_END(cup, T_MISC, NULL, &cfs);
00123
00124 return;
00125 }