You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

content_disposition.rl 1.5KB

123456789101112131415161718192021222324252627282930313233343536
  1. %%{
  2. machine content_disposition;
  3. # https://tools.ietf.org/html/rfc2045#section-5.1
  4. ccontent = ctext | FWS | '(' @{ fcall balanced_ccontent; };
  5. balanced_ccontent := ccontent* ')' @{ fret; };
  6. comment = "(" (FWS? ccontent)* FWS? ")";
  7. CFWS = ((FWS? comment)+ FWS?) | FWS;
  8. qcontent = qtextSMTP | quoted_pairSMTP | textUTF8;
  9. quoted_string = CFWS?
  10. (DQUOTE
  11. (((FWS? qcontent)* FWS?) >Quoted_Str_Start %Quoted_Str_End)
  12. DQUOTE) CFWS?;
  13. token = 0x21..0x27 | 0x2a..0x2b | 0x2c..0x2e | 0x30..0x39 | 0x41..0x5a | 0x5e..0x7e;
  14. value = (quoted_string | (token -- ('"' | 0x3d | utf8_2c | utf8_3c | utf8_4c))+) >Param_Value_Start %Param_Value_End;
  15. attribute = (quoted_string | (token -- ('"' | '='))+) >Param_Name_Start %Param_Name_End;
  16. parameter = CFWS? attribute FWS? "=" FWS? value CFWS?;
  17. ietf_token = token+;
  18. custom_x_token = /x/i "-" token+;
  19. extension_token = ietf_token | custom_x_token;
  20. disposition_type = /inline/i %Disposition_Inline | /attachment/i %Disposition_Attachment
  21. | extension_token >Disposition_Start %Disposition_End;
  22. disposition_parm = parameter;
  23. content_disposition = disposition_type (";" disposition_parm)*;
  24. prepush {
  25. if (top >= st_storage.size) {
  26. st_storage.size = (top + 1) * 2;
  27. st_storage.data = realloc (st_storage.data, st_storage.size * sizeof (int));
  28. g_assert (st_storage.data != NULL);
  29. stack = st_storage.data;
  30. }
  31. }
  32. }%%