pam_conv_l.c 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798
  1. #line 3 "pam_conv_l.c"
  2. #define YY_INT_ALIGNED short int
  3. /* A lexical scanner generated by flex */
  4. #define FLEX_SCANNER
  5. #define YY_FLEX_MAJOR_VERSION 2
  6. #define YY_FLEX_MINOR_VERSION 6
  7. #define YY_FLEX_SUBMINOR_VERSION 4
  8. #if YY_FLEX_SUBMINOR_VERSION > 0
  9. #define FLEX_BETA
  10. #endif
  11. /* First, we deal with platform-specific or compiler-specific issues. */
  12. /* begin standard C headers. */
  13. /* Feature test macros. Flex uses functions that require a minimum set of
  14. * macros defined. As defining some macros may hide function declarations that
  15. * user code might use, be conservative and respect user's definitions as much
  16. * as possible. In glibc, feature test macros may not be all set up until one
  17. * of the libc header (that includes <features.h>) is included. This creates
  18. * a circular dependency when we check the macros. <assert.h> is the safest
  19. * header we can include and does not declare too many functions we don't need.
  20. */
  21. #if !defined(__GNU_LIBRARY__) && defined(__STDC__)
  22. #include <assert.h>
  23. #endif
  24. #if !(defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
  25. defined(_POSIX_SOURCE))
  26. # define _POSIX_C_SOURCE 1 /* Required for fileno() */
  27. # define _POSIX_SOURCE 1
  28. #endif
  29. #include <stdio.h>
  30. #include <string.h>
  31. #include <errno.h>
  32. #include <stdlib.h>
  33. /* end standard C headers. */
  34. /* begin standard C++ headers. */
  35. /* flex integer type definitions */
  36. #ifndef YYFLEX_INTTYPES_DEFINED
  37. #define YYFLEX_INTTYPES_DEFINED
  38. /* Prefer C99 integer types if available. */
  39. # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  40. /* Include <inttypes.h> and not <stdint.h> because Solaris 2.6 has the former
  41. * and not the latter.
  42. */
  43. #include <inttypes.h>
  44. # define YYFLEX_USE_STDINT
  45. # else
  46. # if defined(_MSC_VER) && _MSC_VER >= 1600
  47. /* Visual C++ 2010 does not define __STDC_VERSION__ and has <stdint.h> but not
  48. * <inttypes.h>.
  49. */
  50. #include <stdint.h>
  51. # define YYFLEX_USE_STDINT
  52. # endif
  53. # endif
  54. # ifdef YYFLEX_USE_STDINT
  55. typedef int8_t flex_int8_t;
  56. typedef uint8_t flex_uint8_t;
  57. typedef int16_t flex_int16_t;
  58. typedef uint16_t flex_uint16_t;
  59. typedef int32_t flex_int32_t;
  60. typedef uint32_t flex_uint32_t;
  61. # else
  62. typedef unsigned char flex_uint8_t;
  63. typedef short int flex_int16_t;
  64. typedef unsigned short int flex_uint16_t;
  65. # ifdef __STDC__
  66. typedef signed char flex_int8_t;
  67. /* ISO C only requires at least 16 bits for int. */
  68. #include <limits.h>
  69. # if UINT_MAX >= 4294967295
  70. # define YYFLEX_INT32_DEFINED
  71. typedef int flex_int32_t;
  72. typedef unsigned int flex_uint32_t;
  73. # endif
  74. # else
  75. typedef char flex_int8_t;
  76. # endif
  77. # ifndef YYFLEX_INT32_DEFINED
  78. typedef long int flex_int32_t;
  79. typedef unsigned long int flex_uint32_t;
  80. # endif
  81. # endif
  82. #endif /* YYFLEX_INTTYPES_DEFINED */
  83. /* TODO: this is always defined, so inline it */
  84. #define yyconst const
  85. #if defined(__GNUC__) && __GNUC__ >= 3
  86. #define yynoreturn __attribute__((__noreturn__))
  87. #define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
  88. #else
  89. #define yynoreturn
  90. #define YY_ATTRIBUTE_UNUSED /* __attribute__ ((__unused__)) */
  91. #endif
  92. /* Returned upon end-of-file. */
  93. #define YY_NULL 0
  94. /* Promotes a possibly negative, possibly signed char to an
  95. * integer in range [0..255] for use as an array index.
  96. */
  97. #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
  98. /* Enter a start condition. This macro really ought to take a parameter,
  99. * but we do it the disgusting crufty way forced on us by the ()-less
  100. * definition of BEGIN.
  101. */
  102. #define BEGIN (yy_start) = 1 + 2 *
  103. /* Translate the current start state into a value that can be later handed
  104. * to BEGIN to return to the state. The YYSTATE alias is for lex
  105. * compatibility.
  106. */
  107. #define YY_START (((yy_start) - 1) / 2)
  108. #define YYSTATE YY_START
  109. /* Action number for EOF rule of a given start state. */
  110. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  111. /* Special action meaning "start processing a new file". */
  112. #define YY_NEW_FILE yyrestart( yyin )
  113. #define YY_END_OF_BUFFER_CHAR 0
  114. /* Size of default input buffer. */
  115. #ifndef YY_BUF_SIZE
  116. #ifdef __ia64__
  117. /* On IA-64, the buffer size is 16k, not 8k.
  118. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
  119. * Ditto for the __ia64__ case accordingly.
  120. */
  121. #define YY_BUF_SIZE 32768
  122. #else
  123. #define YY_BUF_SIZE 16384
  124. #endif /* __ia64__ */
  125. #endif
  126. /* The state buf must be large enough to hold one state per character in the main buffer.
  127. */
  128. #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
  129. #ifndef YY_TYPEDEF_YY_BUFFER_STATE
  130. #define YY_TYPEDEF_YY_BUFFER_STATE
  131. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  132. #endif
  133. #ifndef YY_TYPEDEF_YY_SIZE_T
  134. #define YY_TYPEDEF_YY_SIZE_T
  135. typedef size_t yy_size_t;
  136. #endif
  137. extern int yyleng;
  138. extern FILE *yyin, *yyout;
  139. #define EOB_ACT_CONTINUE_SCAN 0
  140. #define EOB_ACT_END_OF_FILE 1
  141. #define EOB_ACT_LAST_MATCH 2
  142. #define YY_LESS_LINENO(n)
  143. #define YY_LINENO_REWIND_TO(ptr)
  144. /* Return all but the first "n" matched characters back to the input stream. */
  145. #define yyless(n) \
  146. do \
  147. { \
  148. /* Undo effects of setting up yytext. */ \
  149. int yyless_macro_arg = (n); \
  150. YY_LESS_LINENO(yyless_macro_arg);\
  151. *yy_cp = (yy_hold_char); \
  152. YY_RESTORE_YY_MORE_OFFSET \
  153. (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
  154. YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  155. } \
  156. while ( 0 )
  157. #define unput(c) yyunput( c, (yytext_ptr) )
  158. #ifndef YY_STRUCT_YY_BUFFER_STATE
  159. #define YY_STRUCT_YY_BUFFER_STATE
  160. struct yy_buffer_state
  161. {
  162. FILE *yy_input_file;
  163. char *yy_ch_buf; /* input buffer */
  164. char *yy_buf_pos; /* current position in input buffer */
  165. /* Size of input buffer in bytes, not including room for EOB
  166. * characters.
  167. */
  168. int yy_buf_size;
  169. /* Number of characters read into yy_ch_buf, not including EOB
  170. * characters.
  171. */
  172. int yy_n_chars;
  173. /* Whether we "own" the buffer - i.e., we know we created it,
  174. * and can realloc() it to grow it, and should free() it to
  175. * delete it.
  176. */
  177. int yy_is_our_buffer;
  178. /* Whether this is an "interactive" input source; if so, and
  179. * if we're using stdio for input, then we want to use getc()
  180. * instead of fread(), to make sure we stop fetching input after
  181. * each newline.
  182. */
  183. int yy_is_interactive;
  184. /* Whether we're considered to be at the beginning of a line.
  185. * If so, '^' rules will be active on the next match, otherwise
  186. * not.
  187. */
  188. int yy_at_bol;
  189. int yy_bs_lineno; /**< The line count. */
  190. int yy_bs_column; /**< The column count. */
  191. /* Whether to try to fill the input buffer when we reach the
  192. * end of it.
  193. */
  194. int yy_fill_buffer;
  195. int yy_buffer_status;
  196. #define YY_BUFFER_NEW 0
  197. #define YY_BUFFER_NORMAL 1
  198. /* When an EOF's been seen but there's still some text to process
  199. * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  200. * shouldn't try reading from the input source any more. We might
  201. * still have a bunch of tokens to match, though, because of
  202. * possible backing-up.
  203. *
  204. * When we actually see the EOF, we change the status to "new"
  205. * (via yyrestart()), so that the user can continue scanning by
  206. * just pointing yyin at a new input file.
  207. */
  208. #define YY_BUFFER_EOF_PENDING 2
  209. };
  210. #endif /* !YY_STRUCT_YY_BUFFER_STATE */
  211. /* Stack of input buffers. */
  212. static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
  213. static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
  214. static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
  215. /* We provide macros for accessing buffer states in case in the
  216. * future we want to put the buffer states in a more general
  217. * "scanner state".
  218. *
  219. * Returns the top of the stack, or NULL.
  220. */
  221. #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
  222. ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
  223. : NULL)
  224. /* Same as previous macro, but useful when we know that the buffer stack is not
  225. * NULL or when we need an lvalue. For internal use only.
  226. */
  227. #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
  228. /* yy_hold_char holds the character lost when yytext is formed. */
  229. static char yy_hold_char;
  230. static int yy_n_chars; /* number of characters read into yy_ch_buf */
  231. int yyleng;
  232. /* Points to current character in buffer. */
  233. static char *yy_c_buf_p = NULL;
  234. static int yy_init = 0; /* whether we need to initialize */
  235. static int yy_start = 0; /* start state number */
  236. /* Flag which is used to allow yywrap()'s to do buffer switches
  237. * instead of setting up a fresh yyin. A bit of a hack ...
  238. */
  239. static int yy_did_buffer_switch_on_eof;
  240. void yyrestart ( FILE *input_file );
  241. void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
  242. YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
  243. void yy_delete_buffer ( YY_BUFFER_STATE b );
  244. void yy_flush_buffer ( YY_BUFFER_STATE b );
  245. void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
  246. void yypop_buffer_state ( void );
  247. static void yyensure_buffer_stack ( void );
  248. static void yy_load_buffer_state ( void );
  249. static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
  250. #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
  251. YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
  252. YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
  253. YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
  254. void *yyalloc ( yy_size_t );
  255. void *yyrealloc ( void *, yy_size_t );
  256. void yyfree ( void * );
  257. #define yy_new_buffer yy_create_buffer
  258. #define yy_set_interactive(is_interactive) \
  259. { \
  260. if ( ! YY_CURRENT_BUFFER ){ \
  261. yyensure_buffer_stack (); \
  262. YY_CURRENT_BUFFER_LVALUE = \
  263. yy_create_buffer( yyin, YY_BUF_SIZE ); \
  264. } \
  265. YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
  266. }
  267. #define yy_set_bol(at_bol) \
  268. { \
  269. if ( ! YY_CURRENT_BUFFER ){\
  270. yyensure_buffer_stack (); \
  271. YY_CURRENT_BUFFER_LVALUE = \
  272. yy_create_buffer( yyin, YY_BUF_SIZE ); \
  273. } \
  274. YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
  275. }
  276. #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
  277. /* Begin user sect3 */
  278. #define yywrap() (/*CONSTCOND*/1)
  279. #define YY_SKIP_YYWRAP
  280. typedef flex_uint8_t YY_CHAR;
  281. FILE *yyin = NULL, *yyout = NULL;
  282. typedef int yy_state_type;
  283. extern int yylineno;
  284. int yylineno = 1;
  285. extern char *yytext;
  286. #ifdef yytext_ptr
  287. #undef yytext_ptr
  288. #endif
  289. #define yytext_ptr yytext
  290. static yy_state_type yy_get_previous_state ( void );
  291. static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
  292. static int yy_get_next_buffer ( void );
  293. static void yynoreturn yy_fatal_error ( const char* msg );
  294. /* Done after the current pattern has been matched and before the
  295. * corresponding action - sets up yytext.
  296. */
  297. #define YY_DO_BEFORE_ACTION \
  298. (yytext_ptr) = yy_bp; \
  299. yyleng = (int) (yy_cp - yy_bp); \
  300. (yy_hold_char) = *yy_cp; \
  301. *yy_cp = '\0'; \
  302. (yy_c_buf_p) = yy_cp;
  303. #define YY_NUM_RULES 6
  304. #define YY_END_OF_BUFFER 7
  305. /* This struct is not used in this scanner,
  306. but its presence is necessary. */
  307. struct yy_trans_info
  308. {
  309. flex_int32_t yy_verify;
  310. flex_int32_t yy_nxt;
  311. };
  312. static const flex_int16_t yy_accept[21] =
  313. { 0,
  314. 0, 0, 7, 3, 4, 5, 1, 3, 3, 3,
  315. 4, 1, 1, 1, 3, 2, 3, 1, 1, 0
  316. } ;
  317. static const YY_CHAR yy_ec[256] =
  318. { 0,
  319. 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
  320. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  321. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  322. 1, 2, 1, 1, 4, 1, 1, 1, 1, 1,
  323. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  324. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  325. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  326. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  327. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  328. 1, 5, 1, 1, 1, 1, 1, 1, 1, 1,
  329. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  330. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  331. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  332. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  333. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  334. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  335. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  336. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  337. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  338. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  339. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  340. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  341. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  342. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  343. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  344. 1, 1, 1, 1, 1
  345. } ;
  346. static const YY_CHAR yy_meta[6] =
  347. { 0,
  348. 1, 2, 3, 1, 1
  349. } ;
  350. static const flex_int16_t yy_base[24] =
  351. { 0,
  352. 0, 0, 26, 20, 0, 27, 5, 10, 19, 20,
  353. 0, 0, 0, 15, 0, 27, 0, 0, 0, 27,
  354. 17, 6, 20
  355. } ;
  356. static const flex_int16_t yy_def[24] =
  357. { 0,
  358. 20, 1, 20, 21, 22, 20, 20, 20, 21, 8,
  359. 22, 7, 23, 20, 9, 20, 10, 7, 14, 0,
  360. 20, 20, 20
  361. } ;
  362. static const flex_int16_t yy_nxt[33] =
  363. { 0,
  364. 4, 5, 6, 7, 8, 12, 13, 11, 12, 14,
  365. 15, 9, 16, 15, 17, 18, 12, 9, 18, 19,
  366. 13, 13, 20, 10, 10, 20, 3, 20, 20, 20,
  367. 20, 20
  368. } ;
  369. static const flex_int16_t yy_chk[33] =
  370. { 0,
  371. 1, 1, 1, 1, 1, 7, 7, 22, 7, 7,
  372. 8, 8, 8, 8, 8, 14, 14, 21, 14, 14,
  373. 23, 23, 10, 9, 4, 3, 20, 20, 20, 20,
  374. 20, 20
  375. } ;
  376. static yy_state_type yy_last_accepting_state;
  377. static char *yy_last_accepting_cpos;
  378. extern int yy_flex_debug;
  379. int yy_flex_debug = 0;
  380. /* The intent behind this definition is that it'll catch
  381. * any uses of REJECT which flex missed.
  382. */
  383. #define REJECT reject_used_but_not_detected
  384. #define yymore() yymore_used_but_not_detected
  385. #define YY_MORE_ADJ 0
  386. #define YY_RESTORE_YY_MORE_OFFSET
  387. char *yytext;
  388. #line 1 "pam_conv_l.l"
  389. #line 3 "pam_conv_l.l"
  390. /*
  391. * $Id$
  392. *
  393. * Copyright (c) Andrew G. Morgan 1997 <morgan@parc.power.net>
  394. *
  395. * This file is covered by the Linux-PAM License (which should be
  396. * distributed with this file.)
  397. */
  398. #ifdef HAVE_CONFIG_H
  399. # include <config.h>
  400. #endif
  401. #include <stdio.h>
  402. #include "pam_conv_y.h"
  403. extern int current_line;
  404. #line 475 "pam_conv_l.c"
  405. #line 476 "pam_conv_l.c"
  406. #define INITIAL 0
  407. #ifndef YY_NO_UNISTD_H
  408. /* Special case for "unistd.h", since it is non-ANSI. We include it way
  409. * down here because we want the user's section 1 to have been scanned first.
  410. * The user has a chance to override it with an option.
  411. */
  412. #include <unistd.h>
  413. #endif
  414. #ifndef YY_EXTRA_TYPE
  415. #define YY_EXTRA_TYPE void *
  416. #endif
  417. static int yy_init_globals ( void );
  418. /* Accessor methods to globals.
  419. These are made visible to non-reentrant scanners for convenience. */
  420. int yylex_destroy ( void );
  421. int yyget_debug ( void );
  422. void yyset_debug ( int debug_flag );
  423. YY_EXTRA_TYPE yyget_extra ( void );
  424. void yyset_extra ( YY_EXTRA_TYPE user_defined );
  425. FILE *yyget_in ( void );
  426. void yyset_in ( FILE * _in_str );
  427. FILE *yyget_out ( void );
  428. void yyset_out ( FILE * _out_str );
  429. int yyget_leng ( void );
  430. char *yyget_text ( void );
  431. int yyget_lineno ( void );
  432. void yyset_lineno ( int _line_number );
  433. /* Macros after this point can all be overridden by user definitions in
  434. * section 1.
  435. */
  436. #ifndef YY_SKIP_YYWRAP
  437. #ifdef __cplusplus
  438. extern "C" int yywrap ( void );
  439. #else
  440. extern int yywrap ( void );
  441. #endif
  442. #endif
  443. #ifndef YY_NO_UNPUT
  444. static void yyunput ( int c, char *buf_ptr );
  445. #endif
  446. #ifndef yytext_ptr
  447. static void yy_flex_strncpy ( char *, const char *, int );
  448. #endif
  449. #ifdef YY_NEED_STRLEN
  450. static int yy_flex_strlen ( const char * );
  451. #endif
  452. #ifndef YY_NO_INPUT
  453. #ifdef __cplusplus
  454. static int yyinput ( void );
  455. #else
  456. static int input ( void );
  457. #endif
  458. #endif
  459. /* Amount of stuff to slurp up with each read. */
  460. #ifndef YY_READ_BUF_SIZE
  461. #ifdef __ia64__
  462. /* On IA-64, the buffer size is 16k, not 8k */
  463. #define YY_READ_BUF_SIZE 16384
  464. #else
  465. #define YY_READ_BUF_SIZE 8192
  466. #endif /* __ia64__ */
  467. #endif
  468. /* Copy whatever the last rule matched to the standard output. */
  469. #ifndef ECHO
  470. /* This used to be an fputs(), but since the string might contain NUL's,
  471. * we now use fwrite().
  472. */
  473. #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
  474. #endif
  475. /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
  476. * is returned in "result".
  477. */
  478. #ifndef YY_INPUT
  479. #define YY_INPUT(buf,result,max_size) \
  480. if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
  481. { \
  482. int c = '*'; \
  483. int n; \
  484. for ( n = 0; n < max_size && \
  485. (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
  486. buf[n] = (char) c; \
  487. if ( c == '\n' ) \
  488. buf[n++] = (char) c; \
  489. if ( c == EOF && ferror( yyin ) ) \
  490. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  491. result = n; \
  492. } \
  493. else \
  494. { \
  495. errno=0; \
  496. while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
  497. { \
  498. if( errno != EINTR) \
  499. { \
  500. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  501. break; \
  502. } \
  503. errno=0; \
  504. clearerr(yyin); \
  505. } \
  506. }\
  507. \
  508. #endif
  509. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  510. * we don't want an extra ';' after the "return" because that will cause
  511. * some compilers to complain about unreachable statements.
  512. */
  513. #ifndef yyterminate
  514. #define yyterminate() return YY_NULL
  515. #endif
  516. /* Number of entries by which start-condition stack grows. */
  517. #ifndef YY_START_STACK_INCR
  518. #define YY_START_STACK_INCR 25
  519. #endif
  520. /* Report a fatal error. */
  521. #ifndef YY_FATAL_ERROR
  522. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
  523. #endif
  524. /* end tables serialization structures and prototypes */
  525. /* Default declaration of generated scanner - a define so the user can
  526. * easily add parameters.
  527. */
  528. #ifndef YY_DECL
  529. #define YY_DECL_IS_OURS 1
  530. extern int yylex (void);
  531. #define YY_DECL int yylex (void)
  532. #endif /* !YY_DECL */
  533. /* Code executed at the beginning of each rule, after yytext and yyleng
  534. * have been set up.
  535. */
  536. #ifndef YY_USER_ACTION
  537. #define YY_USER_ACTION
  538. #endif
  539. /* Code executed at the end of each rule. */
  540. #ifndef YY_BREAK
  541. #define YY_BREAK /*LINTED*/break;
  542. #endif
  543. #define YY_RULE_SETUP \
  544. YY_USER_ACTION
  545. /** The main scanner function which does all the work.
  546. */
  547. YY_DECL
  548. {
  549. yy_state_type yy_current_state;
  550. char *yy_cp, *yy_bp;
  551. int yy_act;
  552. if ( !(yy_init) )
  553. {
  554. (yy_init) = 1;
  555. #ifdef YY_USER_INIT
  556. YY_USER_INIT;
  557. #endif
  558. if ( ! (yy_start) )
  559. (yy_start) = 1; /* first start state */
  560. if ( ! yyin )
  561. yyin = stdin;
  562. if ( ! yyout )
  563. yyout = stdout;
  564. if ( ! YY_CURRENT_BUFFER ) {
  565. yyensure_buffer_stack ();
  566. YY_CURRENT_BUFFER_LVALUE =
  567. yy_create_buffer( yyin, YY_BUF_SIZE );
  568. }
  569. yy_load_buffer_state( );
  570. }
  571. {
  572. #line 24 "pam_conv_l.l"
  573. #line 696 "pam_conv_l.c"
  574. while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
  575. {
  576. yy_cp = (yy_c_buf_p);
  577. /* Support of yytext. */
  578. *yy_cp = (yy_hold_char);
  579. /* yy_bp points to the position in yy_ch_buf of the start of
  580. * the current run.
  581. */
  582. yy_bp = yy_cp;
  583. yy_current_state = (yy_start);
  584. yy_match:
  585. do
  586. {
  587. YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
  588. if ( yy_accept[yy_current_state] )
  589. {
  590. (yy_last_accepting_state) = yy_current_state;
  591. (yy_last_accepting_cpos) = yy_cp;
  592. }
  593. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  594. {
  595. yy_current_state = (int) yy_def[yy_current_state];
  596. if ( yy_current_state >= 21 )
  597. yy_c = yy_meta[yy_c];
  598. }
  599. yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  600. ++yy_cp;
  601. }
  602. while ( yy_base[yy_current_state] != 27 );
  603. yy_find_action:
  604. yy_act = yy_accept[yy_current_state];
  605. if ( yy_act == 0 )
  606. { /* have to back up */
  607. yy_cp = (yy_last_accepting_cpos);
  608. yy_current_state = (yy_last_accepting_state);
  609. yy_act = yy_accept[yy_current_state];
  610. }
  611. YY_DO_BEFORE_ACTION;
  612. do_action: /* This label is used only to access EOF actions. */
  613. switch ( yy_act )
  614. { /* beginning of action switch */
  615. case 0: /* must back up */
  616. /* undo the effects of YY_DO_BEFORE_ACTION */
  617. *yy_cp = (yy_hold_char);
  618. yy_cp = (yy_last_accepting_cpos);
  619. yy_current_state = (yy_last_accepting_state);
  620. goto yy_find_action;
  621. case 1:
  622. YY_RULE_SETUP
  623. #line 26 "pam_conv_l.l"
  624. ; /* skip comments (sorry) */
  625. YY_BREAK
  626. case 2:
  627. /* rule 2 can match eol */
  628. YY_RULE_SETUP
  629. #line 28 "pam_conv_l.l"
  630. {
  631. ++current_line;
  632. }
  633. YY_BREAK
  634. case 3:
  635. YY_RULE_SETUP
  636. #line 32 "pam_conv_l.l"
  637. {
  638. return TOK;
  639. }
  640. YY_BREAK
  641. case 4:
  642. YY_RULE_SETUP
  643. #line 36 "pam_conv_l.l"
  644. ; /* Ignore */
  645. YY_BREAK
  646. case YY_STATE_EOF(INITIAL):
  647. #line 38 "pam_conv_l.l"
  648. {
  649. return EOFILE;
  650. }
  651. YY_BREAK
  652. case 5:
  653. /* rule 5 can match eol */
  654. YY_RULE_SETUP
  655. #line 42 "pam_conv_l.l"
  656. {
  657. ++current_line;
  658. return NL;
  659. }
  660. YY_BREAK
  661. case 6:
  662. YY_RULE_SETUP
  663. #line 47 "pam_conv_l.l"
  664. ECHO;
  665. YY_BREAK
  666. #line 798 "pam_conv_l.c"
  667. case YY_END_OF_BUFFER:
  668. {
  669. /* Amount of text matched not including the EOB char. */
  670. int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
  671. /* Undo the effects of YY_DO_BEFORE_ACTION. */
  672. *yy_cp = (yy_hold_char);
  673. YY_RESTORE_YY_MORE_OFFSET
  674. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
  675. {
  676. /* We're scanning a new file or input source. It's
  677. * possible that this happened because the user
  678. * just pointed yyin at a new source and called
  679. * yylex(). If so, then we have to assure
  680. * consistency between YY_CURRENT_BUFFER and our
  681. * globals. Here is the right place to do so, because
  682. * this is the first action (other than possibly a
  683. * back-up) that will match for the new input source.
  684. */
  685. (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  686. YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
  687. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
  688. }
  689. /* Note that here we test for yy_c_buf_p "<=" to the position
  690. * of the first EOB in the buffer, since yy_c_buf_p will
  691. * already have been incremented past the NUL character
  692. * (since all states make transitions on EOB to the
  693. * end-of-buffer state). Contrast this with the test
  694. * in input().
  695. */
  696. if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
  697. { /* This was really a NUL. */
  698. yy_state_type yy_next_state;
  699. (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
  700. yy_current_state = yy_get_previous_state( );
  701. /* Okay, we're now positioned to make the NUL
  702. * transition. We couldn't have
  703. * yy_get_previous_state() go ahead and do it
  704. * for us because it doesn't know how to deal
  705. * with the possibility of jamming (and we don't
  706. * want to build jamming into it because then it
  707. * will run more slowly).
  708. */
  709. yy_next_state = yy_try_NUL_trans( yy_current_state );
  710. yy_bp = (yytext_ptr) + YY_MORE_ADJ;
  711. if ( yy_next_state )
  712. {
  713. /* Consume the NUL. */
  714. yy_cp = ++(yy_c_buf_p);
  715. yy_current_state = yy_next_state;
  716. goto yy_match;
  717. }
  718. else
  719. {
  720. yy_cp = (yy_c_buf_p);
  721. goto yy_find_action;
  722. }
  723. }
  724. else switch ( yy_get_next_buffer( ) )
  725. {
  726. case EOB_ACT_END_OF_FILE:
  727. {
  728. (yy_did_buffer_switch_on_eof) = 0;
  729. if ( yywrap( ) )
  730. {
  731. /* Note: because we've taken care in
  732. * yy_get_next_buffer() to have set up
  733. * yytext, we can now set up
  734. * yy_c_buf_p so that if some total
  735. * hoser (like flex itself) wants to
  736. * call the scanner after we return the
  737. * YY_NULL, it'll still work - another
  738. * YY_NULL will get returned.
  739. */
  740. (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
  741. yy_act = YY_STATE_EOF(YY_START);
  742. goto do_action;
  743. }
  744. else
  745. {
  746. if ( ! (yy_did_buffer_switch_on_eof) )
  747. YY_NEW_FILE;
  748. }
  749. break;
  750. }
  751. case EOB_ACT_CONTINUE_SCAN:
  752. (yy_c_buf_p) =
  753. (yytext_ptr) + yy_amount_of_matched_text;
  754. yy_current_state = yy_get_previous_state( );
  755. yy_cp = (yy_c_buf_p);
  756. yy_bp = (yytext_ptr) + YY_MORE_ADJ;
  757. goto yy_match;
  758. case EOB_ACT_LAST_MATCH:
  759. (yy_c_buf_p) =
  760. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
  761. yy_current_state = yy_get_previous_state( );
  762. yy_cp = (yy_c_buf_p);
  763. yy_bp = (yytext_ptr) + YY_MORE_ADJ;
  764. goto yy_find_action;
  765. }
  766. break;
  767. }
  768. default:
  769. YY_FATAL_ERROR(
  770. "fatal flex scanner internal error--no action found" );
  771. } /* end of action switch */
  772. } /* end of scanning one token */
  773. } /* end of user's declarations */
  774. } /* end of yylex */
  775. /* yy_get_next_buffer - try to read in a new buffer
  776. *
  777. * Returns a code representing an action:
  778. * EOB_ACT_LAST_MATCH -
  779. * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  780. * EOB_ACT_END_OF_FILE - end of file
  781. */
  782. static int yy_get_next_buffer (void)
  783. {
  784. char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
  785. char *source = (yytext_ptr);
  786. int number_to_move, i;
  787. int ret_val;
  788. if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
  789. YY_FATAL_ERROR(
  790. "fatal flex scanner internal error--end of buffer missed" );
  791. if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
  792. { /* Don't try to fill the buffer, so this is an EOF. */
  793. if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
  794. {
  795. /* We matched a single character, the EOB, so
  796. * treat this as a final EOF.
  797. */
  798. return EOB_ACT_END_OF_FILE;
  799. }
  800. else
  801. {
  802. /* We matched some text prior to the EOB, first
  803. * process it.
  804. */
  805. return EOB_ACT_LAST_MATCH;
  806. }
  807. }
  808. /* Try to read more data. */
  809. /* First move last chars to start of buffer. */
  810. number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
  811. for ( i = 0; i < number_to_move; ++i )
  812. *(dest++) = *(source++);
  813. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  814. /* don't do the read, it's not guaranteed to return an EOF,
  815. * just force an EOF
  816. */
  817. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
  818. else
  819. {
  820. int num_to_read =
  821. YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
  822. while ( num_to_read <= 0 )
  823. { /* Not enough room in the buffer - grow it. */
  824. /* just a shorter name for the current buffer */
  825. YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
  826. int yy_c_buf_p_offset =
  827. (int) ((yy_c_buf_p) - b->yy_ch_buf);
  828. if ( b->yy_is_our_buffer )
  829. {
  830. int new_size = b->yy_buf_size * 2;
  831. if ( new_size <= 0 )
  832. b->yy_buf_size += b->yy_buf_size / 8;
  833. else
  834. b->yy_buf_size *= 2;
  835. b->yy_ch_buf = (char *)
  836. /* Include room in for 2 EOB chars. */
  837. yyrealloc( (void *) b->yy_ch_buf,
  838. (yy_size_t) (b->yy_buf_size + 2) );
  839. }
  840. else
  841. /* Can't grow it, we don't own it. */
  842. b->yy_ch_buf = NULL;
  843. if ( ! b->yy_ch_buf )
  844. YY_FATAL_ERROR(
  845. "fatal error - scanner input buffer overflow" );
  846. (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
  847. num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
  848. number_to_move - 1;
  849. }
  850. if ( num_to_read > YY_READ_BUF_SIZE )
  851. num_to_read = YY_READ_BUF_SIZE;
  852. /* Read in more data. */
  853. YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
  854. (yy_n_chars), num_to_read );
  855. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
  856. }
  857. if ( (yy_n_chars) == 0 )
  858. {
  859. if ( number_to_move == YY_MORE_ADJ )
  860. {
  861. ret_val = EOB_ACT_END_OF_FILE;
  862. yyrestart( yyin );
  863. }
  864. else
  865. {
  866. ret_val = EOB_ACT_LAST_MATCH;
  867. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
  868. YY_BUFFER_EOF_PENDING;
  869. }
  870. }
  871. else
  872. ret_val = EOB_ACT_CONTINUE_SCAN;
  873. if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
  874. /* Extend the array by 50%, plus the number we really need. */
  875. int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
  876. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
  877. (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
  878. if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  879. YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
  880. /* "- 2" to take care of EOB's */
  881. YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
  882. }
  883. (yy_n_chars) += number_to_move;
  884. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
  885. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
  886. (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
  887. return ret_val;
  888. }
  889. /* yy_get_previous_state - get the state just before the EOB char was reached */
  890. static yy_state_type yy_get_previous_state (void)
  891. {
  892. yy_state_type yy_current_state;
  893. char *yy_cp;
  894. yy_current_state = (yy_start);
  895. for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
  896. {
  897. YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
  898. if ( yy_accept[yy_current_state] )
  899. {
  900. (yy_last_accepting_state) = yy_current_state;
  901. (yy_last_accepting_cpos) = yy_cp;
  902. }
  903. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  904. {
  905. yy_current_state = (int) yy_def[yy_current_state];
  906. if ( yy_current_state >= 21 )
  907. yy_c = yy_meta[yy_c];
  908. }
  909. yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  910. }
  911. return yy_current_state;
  912. }
  913. /* yy_try_NUL_trans - try to make a transition on the NUL character
  914. *
  915. * synopsis
  916. * next_state = yy_try_NUL_trans( current_state );
  917. */
  918. static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
  919. {
  920. int yy_is_jam;
  921. char *yy_cp = (yy_c_buf_p);
  922. YY_CHAR yy_c = 1;
  923. if ( yy_accept[yy_current_state] )
  924. {
  925. (yy_last_accepting_state) = yy_current_state;
  926. (yy_last_accepting_cpos) = yy_cp;
  927. }
  928. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  929. {
  930. yy_current_state = (int) yy_def[yy_current_state];
  931. if ( yy_current_state >= 21 )
  932. yy_c = yy_meta[yy_c];
  933. }
  934. yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  935. yy_is_jam = (yy_current_state == 20);
  936. return yy_is_jam ? 0 : yy_current_state;
  937. }
  938. #ifndef YY_NO_UNPUT
  939. static void yyunput (int c, char * yy_bp )
  940. {
  941. char *yy_cp;
  942. yy_cp = (yy_c_buf_p);
  943. /* undo effects of setting up yytext */
  944. *yy_cp = (yy_hold_char);
  945. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  946. { /* need to shift things up to make room */
  947. /* +2 for EOB chars. */
  948. int number_to_move = (yy_n_chars) + 2;
  949. char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
  950. YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
  951. char *source =
  952. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
  953. while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  954. *--dest = *--source;
  955. yy_cp += (int) (dest - source);
  956. yy_bp += (int) (dest - source);
  957. YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
  958. (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
  959. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  960. YY_FATAL_ERROR( "flex scanner push-back overflow" );
  961. }
  962. *--yy_cp = (char) c;
  963. (yytext_ptr) = yy_bp;
  964. (yy_hold_char) = *yy_cp;
  965. (yy_c_buf_p) = yy_cp;
  966. }
  967. #endif
  968. #ifndef YY_NO_INPUT
  969. #ifdef __cplusplus
  970. static int yyinput (void)
  971. #else
  972. static int input (void)
  973. #endif
  974. {
  975. int c;
  976. *(yy_c_buf_p) = (yy_hold_char);
  977. if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
  978. {
  979. /* yy_c_buf_p now points to the character we want to return.
  980. * If this occurs *before* the EOB characters, then it's a
  981. * valid NUL; if not, then we've hit the end of the buffer.
  982. */
  983. if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
  984. /* This was really a NUL. */
  985. *(yy_c_buf_p) = '\0';
  986. else
  987. { /* need more input */
  988. int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
  989. ++(yy_c_buf_p);
  990. switch ( yy_get_next_buffer( ) )
  991. {
  992. case EOB_ACT_LAST_MATCH:
  993. /* This happens because yy_g_n_b()
  994. * sees that we've accumulated a
  995. * token and flags that we need to
  996. * try matching the token before
  997. * proceeding. But for input(),
  998. * there's no matching to consider.
  999. * So convert the EOB_ACT_LAST_MATCH
  1000. * to EOB_ACT_END_OF_FILE.
  1001. */
  1002. /* Reset buffer status. */
  1003. yyrestart( yyin );
  1004. /*FALLTHROUGH*/
  1005. case EOB_ACT_END_OF_FILE:
  1006. {
  1007. if ( yywrap( ) )
  1008. return 0;
  1009. if ( ! (yy_did_buffer_switch_on_eof) )
  1010. YY_NEW_FILE;
  1011. #ifdef __cplusplus
  1012. return yyinput();
  1013. #else
  1014. return input();
  1015. #endif
  1016. }
  1017. case EOB_ACT_CONTINUE_SCAN:
  1018. (yy_c_buf_p) = (yytext_ptr) + offset;
  1019. break;
  1020. }
  1021. }
  1022. }
  1023. c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
  1024. *(yy_c_buf_p) = '\0'; /* preserve yytext */
  1025. (yy_hold_char) = *++(yy_c_buf_p);
  1026. return c;
  1027. }
  1028. #endif /* ifndef YY_NO_INPUT */
  1029. /** Immediately switch to a different input stream.
  1030. * @param input_file A readable stream.
  1031. *
  1032. * @note This function does not reset the start condition to @c INITIAL .
  1033. */
  1034. void yyrestart (FILE * input_file )
  1035. {
  1036. if ( ! YY_CURRENT_BUFFER ){
  1037. yyensure_buffer_stack ();
  1038. YY_CURRENT_BUFFER_LVALUE =
  1039. yy_create_buffer( yyin, YY_BUF_SIZE );
  1040. }
  1041. yy_init_buffer( YY_CURRENT_BUFFER, input_file );
  1042. yy_load_buffer_state( );
  1043. }
  1044. /** Switch to a different input buffer.
  1045. * @param new_buffer The new input buffer.
  1046. *
  1047. */
  1048. void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
  1049. {
  1050. /* TODO. We should be able to replace this entire function body
  1051. * with
  1052. * yypop_buffer_state();
  1053. * yypush_buffer_state(new_buffer);
  1054. */
  1055. yyensure_buffer_stack ();
  1056. if ( YY_CURRENT_BUFFER == new_buffer )
  1057. return;
  1058. if ( YY_CURRENT_BUFFER )
  1059. {
  1060. /* Flush out information for old buffer. */
  1061. *(yy_c_buf_p) = (yy_hold_char);
  1062. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
  1063. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
  1064. }
  1065. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1066. yy_load_buffer_state( );
  1067. /* We don't actually know whether we did this switch during
  1068. * EOF (yywrap()) processing, but the only time this flag
  1069. * is looked at is after yywrap() is called, so it's safe
  1070. * to go ahead and always set it.
  1071. */
  1072. (yy_did_buffer_switch_on_eof) = 1;
  1073. }
  1074. static void yy_load_buffer_state (void)
  1075. {
  1076. (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  1077. (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
  1078. yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
  1079. (yy_hold_char) = *(yy_c_buf_p);
  1080. }
  1081. /** Allocate and initialize an input buffer state.
  1082. * @param file A readable stream.
  1083. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
  1084. *
  1085. * @return the allocated buffer state.
  1086. */
  1087. YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
  1088. {
  1089. YY_BUFFER_STATE b;
  1090. b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
  1091. if ( ! b )
  1092. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1093. b->yy_buf_size = size;
  1094. /* yy_ch_buf has to be 2 characters longer than the size given because
  1095. * we need to put in 2 end-of-buffer characters.
  1096. */
  1097. b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
  1098. if ( ! b->yy_ch_buf )
  1099. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1100. b->yy_is_our_buffer = 1;
  1101. yy_init_buffer( b, file );
  1102. return b;
  1103. }
  1104. /** Destroy the buffer.
  1105. * @param b a buffer created with yy_create_buffer()
  1106. *
  1107. */
  1108. void yy_delete_buffer (YY_BUFFER_STATE b )
  1109. {
  1110. if ( ! b )
  1111. return;
  1112. if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
  1113. YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
  1114. if ( b->yy_is_our_buffer )
  1115. yyfree( (void *) b->yy_ch_buf );
  1116. yyfree( (void *) b );
  1117. }
  1118. /* Initializes or reinitializes a buffer.
  1119. * This function is sometimes called more than once on the same buffer,
  1120. * such as during a yyrestart() or at EOF.
  1121. */
  1122. static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
  1123. {
  1124. int oerrno = errno;
  1125. yy_flush_buffer( b );
  1126. b->yy_input_file = file;
  1127. b->yy_fill_buffer = 1;
  1128. /* If b is the current buffer, then yy_init_buffer was _probably_
  1129. * called from yyrestart() or through yy_get_next_buffer.
  1130. * In that case, we don't want to reset the lineno or column.
  1131. */
  1132. if (b != YY_CURRENT_BUFFER){
  1133. b->yy_bs_lineno = 1;
  1134. b->yy_bs_column = 0;
  1135. }
  1136. b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
  1137. errno = oerrno;
  1138. }
  1139. /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  1140. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
  1141. *
  1142. */
  1143. void yy_flush_buffer (YY_BUFFER_STATE b )
  1144. {
  1145. if ( ! b )
  1146. return;
  1147. b->yy_n_chars = 0;
  1148. /* We always need two end-of-buffer characters. The first causes
  1149. * a transition to the end-of-buffer state. The second causes
  1150. * a jam in that state.
  1151. */
  1152. b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  1153. b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1154. b->yy_buf_pos = &b->yy_ch_buf[0];
  1155. b->yy_at_bol = 1;
  1156. b->yy_buffer_status = YY_BUFFER_NEW;
  1157. if ( b == YY_CURRENT_BUFFER )
  1158. yy_load_buffer_state( );
  1159. }
  1160. /** Pushes the new state onto the stack. The new state becomes
  1161. * the current state. This function will allocate the stack
  1162. * if necessary.
  1163. * @param new_buffer The new state.
  1164. *
  1165. */
  1166. void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
  1167. {
  1168. if (new_buffer == NULL)
  1169. return;
  1170. yyensure_buffer_stack();
  1171. /* This block is copied from yy_switch_to_buffer. */
  1172. if ( YY_CURRENT_BUFFER )
  1173. {
  1174. /* Flush out information for old buffer. */
  1175. *(yy_c_buf_p) = (yy_hold_char);
  1176. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
  1177. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
  1178. }
  1179. /* Only push if top exists. Otherwise, replace top. */
  1180. if (YY_CURRENT_BUFFER)
  1181. (yy_buffer_stack_top)++;
  1182. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1183. /* copied from yy_switch_to_buffer. */
  1184. yy_load_buffer_state( );
  1185. (yy_did_buffer_switch_on_eof) = 1;
  1186. }
  1187. /** Removes and deletes the top of the stack, if present.
  1188. * The next element becomes the new top.
  1189. *
  1190. */
  1191. void yypop_buffer_state (void)
  1192. {
  1193. if (!YY_CURRENT_BUFFER)
  1194. return;
  1195. yy_delete_buffer(YY_CURRENT_BUFFER );
  1196. YY_CURRENT_BUFFER_LVALUE = NULL;
  1197. if ((yy_buffer_stack_top) > 0)
  1198. --(yy_buffer_stack_top);
  1199. if (YY_CURRENT_BUFFER) {
  1200. yy_load_buffer_state( );
  1201. (yy_did_buffer_switch_on_eof) = 1;
  1202. }
  1203. }
  1204. /* Allocates the stack if it does not exist.
  1205. * Guarantees space for at least one push.
  1206. */
  1207. static void yyensure_buffer_stack (void)
  1208. {
  1209. yy_size_t num_to_alloc;
  1210. if (!(yy_buffer_stack)) {
  1211. /* First allocation is just for 2 elements, since we don't know if this
  1212. * scanner will even need a stack. We use 2 instead of 1 to avoid an
  1213. * immediate realloc on the next call.
  1214. */
  1215. num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
  1216. (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
  1217. (num_to_alloc * sizeof(struct yy_buffer_state*)
  1218. );
  1219. if ( ! (yy_buffer_stack) )
  1220. YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  1221. memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
  1222. (yy_buffer_stack_max) = num_to_alloc;
  1223. (yy_buffer_stack_top) = 0;
  1224. return;
  1225. }
  1226. if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
  1227. /* Increase the buffer to prepare for a possible push. */
  1228. yy_size_t grow_size = 8 /* arbitrary grow size */;
  1229. num_to_alloc = (yy_buffer_stack_max) + grow_size;
  1230. (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
  1231. ((yy_buffer_stack),
  1232. num_to_alloc * sizeof(struct yy_buffer_state*)
  1233. );
  1234. if ( ! (yy_buffer_stack) )
  1235. YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  1236. /* zero only the new slots.*/
  1237. memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
  1238. (yy_buffer_stack_max) = num_to_alloc;
  1239. }
  1240. }
  1241. /** Setup the input buffer state to scan directly from a user-specified character buffer.
  1242. * @param base the character buffer
  1243. * @param size the size in bytes of the character buffer
  1244. *
  1245. * @return the newly allocated buffer state object.
  1246. */
  1247. YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
  1248. {
  1249. YY_BUFFER_STATE b;
  1250. if ( size < 2 ||
  1251. base[size-2] != YY_END_OF_BUFFER_CHAR ||
  1252. base[size-1] != YY_END_OF_BUFFER_CHAR )
  1253. /* They forgot to leave room for the EOB's. */
  1254. return NULL;
  1255. b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
  1256. if ( ! b )
  1257. YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
  1258. b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
  1259. b->yy_buf_pos = b->yy_ch_buf = base;
  1260. b->yy_is_our_buffer = 0;
  1261. b->yy_input_file = NULL;
  1262. b->yy_n_chars = b->yy_buf_size;
  1263. b->yy_is_interactive = 0;
  1264. b->yy_at_bol = 1;
  1265. b->yy_fill_buffer = 0;
  1266. b->yy_buffer_status = YY_BUFFER_NEW;
  1267. yy_switch_to_buffer( b );
  1268. return b;
  1269. }
  1270. /** Setup the input buffer state to scan a string. The next call to yylex() will
  1271. * scan from a @e copy of @a str.
  1272. * @param yystr a NUL-terminated string to scan
  1273. *
  1274. * @return the newly allocated buffer state object.
  1275. * @note If you want to scan bytes that may contain NUL values, then use
  1276. * yy_scan_bytes() instead.
  1277. */
  1278. YY_BUFFER_STATE yy_scan_string (const char * yystr )
  1279. {
  1280. return yy_scan_bytes( yystr, (int) strlen(yystr) );
  1281. }
  1282. /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
  1283. * scan from a @e copy of @a bytes.
  1284. * @param yybytes the byte buffer to scan
  1285. * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  1286. *
  1287. * @return the newly allocated buffer state object.
  1288. */
  1289. YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
  1290. {
  1291. YY_BUFFER_STATE b;
  1292. char *buf;
  1293. yy_size_t n;
  1294. int i;
  1295. /* Get memory for full buffer, including space for trailing EOB's. */
  1296. n = (yy_size_t) (_yybytes_len + 2);
  1297. buf = (char *) yyalloc( n );
  1298. if ( ! buf )
  1299. YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
  1300. for ( i = 0; i < _yybytes_len; ++i )
  1301. buf[i] = yybytes[i];
  1302. buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
  1303. b = yy_scan_buffer( buf, n );
  1304. if ( ! b )
  1305. YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
  1306. /* It's okay to grow etc. this buffer, and we should throw it
  1307. * away when we're done.
  1308. */
  1309. b->yy_is_our_buffer = 1;
  1310. return b;
  1311. }
  1312. #ifndef YY_EXIT_FAILURE
  1313. #define YY_EXIT_FAILURE 2
  1314. #endif
  1315. static void yynoreturn yy_fatal_error (const char* msg YY_ATTRIBUTE_UNUSED)
  1316. {
  1317. fprintf( stderr, "%s\n", msg );
  1318. exit( YY_EXIT_FAILURE );
  1319. }
  1320. /* Redefine yyless() so it works in section 3 code. */
  1321. #undef yyless
  1322. #define yyless(n) \
  1323. do \
  1324. { \
  1325. /* Undo effects of setting up yytext. */ \
  1326. int yyless_macro_arg = (n); \
  1327. YY_LESS_LINENO(yyless_macro_arg);\
  1328. yytext[yyleng] = (yy_hold_char); \
  1329. (yy_c_buf_p) = yytext + yyless_macro_arg; \
  1330. (yy_hold_char) = *(yy_c_buf_p); \
  1331. *(yy_c_buf_p) = '\0'; \
  1332. yyleng = yyless_macro_arg; \
  1333. } \
  1334. while ( 0 )
  1335. /* Accessor methods (get/set functions) to struct members. */
  1336. /** Get the current line number.
  1337. *
  1338. */
  1339. int yyget_lineno (void)
  1340. {
  1341. return yylineno;
  1342. }
  1343. /** Get the input stream.
  1344. *
  1345. */
  1346. FILE *yyget_in (void)
  1347. {
  1348. return yyin;
  1349. }
  1350. /** Get the output stream.
  1351. *
  1352. */
  1353. FILE *yyget_out (void)
  1354. {
  1355. return yyout;
  1356. }
  1357. /** Get the length of the current token.
  1358. *
  1359. */
  1360. int yyget_leng (void)
  1361. {
  1362. return yyleng;
  1363. }
  1364. /** Get the current token.
  1365. *
  1366. */
  1367. char *yyget_text (void)
  1368. {
  1369. return yytext;
  1370. }
  1371. /** Set the current line number.
  1372. * @param _line_number line number
  1373. *
  1374. */
  1375. void yyset_lineno (int _line_number )
  1376. {
  1377. yylineno = _line_number;
  1378. }
  1379. /** Set the input stream. This does not discard the current
  1380. * input buffer.
  1381. * @param _in_str A readable stream.
  1382. *
  1383. * @see yy_switch_to_buffer
  1384. */
  1385. void yyset_in (FILE * _in_str )
  1386. {
  1387. yyin = _in_str ;
  1388. }
  1389. void yyset_out (FILE * _out_str )
  1390. {
  1391. yyout = _out_str ;
  1392. }
  1393. int yyget_debug (void)
  1394. {
  1395. return yy_flex_debug;
  1396. }
  1397. void yyset_debug (int _bdebug )
  1398. {
  1399. yy_flex_debug = _bdebug ;
  1400. }
  1401. static int yy_init_globals (void)
  1402. {
  1403. /* Initialization is the same as for the non-reentrant scanner.
  1404. * This function is called from yylex_destroy(), so don't allocate here.
  1405. */
  1406. (yy_buffer_stack) = NULL;
  1407. (yy_buffer_stack_top) = 0;
  1408. (yy_buffer_stack_max) = 0;
  1409. (yy_c_buf_p) = NULL;
  1410. (yy_init) = 0;
  1411. (yy_start) = 0;
  1412. /* Defined in main.c */
  1413. #ifdef YY_STDINIT
  1414. yyin = stdin;
  1415. yyout = stdout;
  1416. #else
  1417. yyin = NULL;
  1418. yyout = NULL;
  1419. #endif
  1420. /* For future reference: Set errno on error, since we are called by
  1421. * yylex_init()
  1422. */
  1423. return 0;
  1424. }
  1425. /* yylex_destroy is for both reentrant and non-reentrant scanners. */
  1426. int yylex_destroy (void)
  1427. {
  1428. /* Pop the buffer stack, destroying each element. */
  1429. while(YY_CURRENT_BUFFER){
  1430. yy_delete_buffer( YY_CURRENT_BUFFER );
  1431. YY_CURRENT_BUFFER_LVALUE = NULL;
  1432. yypop_buffer_state();
  1433. }
  1434. /* Destroy the stack itself. */
  1435. yyfree((yy_buffer_stack) );
  1436. (yy_buffer_stack) = NULL;
  1437. /* Reset the globals. This is important in a non-reentrant scanner so the next time
  1438. * yylex() is called, initialization will occur. */
  1439. yy_init_globals( );
  1440. return 0;
  1441. }
  1442. /*
  1443. * Internal utility routines.
  1444. */
  1445. #ifndef yytext_ptr
  1446. static void yy_flex_strncpy (char* s1, const char * s2, int n YY_ATTRIBUTE_UNUSED)
  1447. {
  1448. int i;
  1449. for ( i = 0; i < n; ++i )
  1450. s1[i] = s2[i];
  1451. }
  1452. #endif
  1453. #ifdef YY_NEED_STRLEN
  1454. static int yy_flex_strlen (const char * s YY_ATTRIBUTE_UNUSED)
  1455. {
  1456. int n;
  1457. for ( n = 0; s[n]; ++n )
  1458. ;
  1459. return n;
  1460. }
  1461. #endif
  1462. void *yyalloc (yy_size_t size YY_ATTRIBUTE_UNUSED)
  1463. {
  1464. return malloc(size);
  1465. }
  1466. void *yyrealloc (void * ptr, yy_size_t size YY_ATTRIBUTE_UNUSED)
  1467. {
  1468. /* The cast to (char *) in the following accommodates both
  1469. * implementations that use char* generic pointers, and those
  1470. * that use void* generic pointers. It works with the latter
  1471. * because both ANSI C and C++ allow castless assignment from
  1472. * any pointer type to void*, and deal with argument conversions
  1473. * as though doing an assignment.
  1474. */
  1475. return realloc(ptr, size);
  1476. }
  1477. void yyfree (void * ptr YY_ATTRIBUTE_UNUSED)
  1478. {
  1479. free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
  1480. }
  1481. #line 47 "pam_conv_l.l"