diff options
Diffstat (limited to 'src/include/microhttpd_ws.h')
-rw-r--r-- | src/include/microhttpd_ws.h | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/src/include/microhttpd_ws.h b/src/include/microhttpd_ws.h index f19c140d..8708bd6f 100644 --- a/src/include/microhttpd_ws.h +++ b/src/include/microhttpd_ws.h | |||
@@ -547,7 +547,7 @@ enum MHD_WEBSOCKET_VALIDITY | |||
547 | * @return allocated memory | 547 | * @return allocated memory |
548 | * @ingroup websocket | 548 | * @ingroup websocket |
549 | */ | 549 | */ |
550 | typedef void* | 550 | typedef void * |
551 | (*MHD_WebSocketMallocCallback) (size_t buf_len); | 551 | (*MHD_WebSocketMallocCallback) (size_t buf_len); |
552 | /** | 552 | /** |
553 | * This callback function is used internally by many websocket | 553 | * This callback function is used internally by many websocket |
@@ -565,7 +565,7 @@ typedef void* | |||
565 | * @return reallocated memory | 565 | * @return reallocated memory |
566 | * @ingroup websocket | 566 | * @ingroup websocket |
567 | */ | 567 | */ |
568 | typedef void* | 568 | typedef void * |
569 | (*MHD_WebSocketReallocCallback) (void *buf, size_t new_buf_len); | 569 | (*MHD_WebSocketReallocCallback) (void *buf, size_t new_buf_len); |
570 | /** | 570 | /** |
571 | * This callback function is used internally by many websocket | 571 | * This callback function is used internally by many websocket |
@@ -600,7 +600,7 @@ typedef void | |||
600 | * @ingroup websocket | 600 | * @ingroup websocket |
601 | */ | 601 | */ |
602 | typedef size_t | 602 | typedef size_t |
603 | (*MHD_WebSocketRandomNumberGenerator) (void *cls, void* buf, size_t buf_len); | 603 | (*MHD_WebSocketRandomNumberGenerator) (void *cls, void *buf, size_t buf_len); |
604 | 604 | ||
605 | /** | 605 | /** |
606 | * Checks the HTTP version of the incoming request. | 606 | * Checks the HTTP version of the incoming request. |
@@ -615,7 +615,7 @@ typedef size_t | |||
615 | * @ingroup websocket | 615 | * @ingroup websocket |
616 | */ | 616 | */ |
617 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS | 617 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS |
618 | MHD_websocket_check_http_version (const char* http_version); | 618 | MHD_websocket_check_http_version (const char *http_version); |
619 | 619 | ||
620 | /** | 620 | /** |
621 | * Checks the value of the 'Connection' HTTP request header. | 621 | * Checks the value of the 'Connection' HTTP request header. |
@@ -634,7 +634,7 @@ MHD_websocket_check_http_version (const char* http_version); | |||
634 | * @ingroup websocket | 634 | * @ingroup websocket |
635 | */ | 635 | */ |
636 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS | 636 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS |
637 | MHD_websocket_check_connection_header (const char* connection_header); | 637 | MHD_websocket_check_connection_header (const char *connection_header); |
638 | 638 | ||
639 | /** | 639 | /** |
640 | * Checks the value of the 'Upgrade' HTTP request header. | 640 | * Checks the value of the 'Upgrade' HTTP request header. |
@@ -653,7 +653,7 @@ MHD_websocket_check_connection_header (const char* connection_header); | |||
653 | * @ingroup websocket | 653 | * @ingroup websocket |
654 | */ | 654 | */ |
655 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS | 655 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS |
656 | MHD_websocket_check_upgrade_header (const char* upgrade_header); | 656 | MHD_websocket_check_upgrade_header (const char *upgrade_header); |
657 | 657 | ||
658 | /** | 658 | /** |
659 | * Checks the value of the 'Sec-WebSocket-Version' HTTP request header. | 659 | * Checks the value of the 'Sec-WebSocket-Version' HTTP request header. |
@@ -673,7 +673,7 @@ MHD_websocket_check_upgrade_header (const char* upgrade_header); | |||
673 | * @ingroup websocket | 673 | * @ingroup websocket |
674 | */ | 674 | */ |
675 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS | 675 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS |
676 | MHD_websocket_check_version_header (const char* version_header); | 676 | MHD_websocket_check_version_header (const char *version_header); |
677 | 677 | ||
678 | /** | 678 | /** |
679 | * Creates the response value for the 'Sec-WebSocket-Key' HTTP request header. | 679 | * Creates the response value for the 'Sec-WebSocket-Key' HTTP request header. |
@@ -695,8 +695,8 @@ MHD_websocket_check_version_header (const char* version_header); | |||
695 | * @ingroup websocket | 695 | * @ingroup websocket |
696 | */ | 696 | */ |
697 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS | 697 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS |
698 | MHD_websocket_create_accept_header (const char* sec_websocket_key, | 698 | MHD_websocket_create_accept_header (const char *sec_websocket_key, |
699 | char* sec_websocket_accept); | 699 | char *sec_websocket_accept); |
700 | 700 | ||
701 | /** | 701 | /** |
702 | * Creates a new websocket stream, used for decoding/encoding. | 702 | * Creates a new websocket stream, used for decoding/encoding. |
@@ -711,7 +711,7 @@ MHD_websocket_create_accept_header (const char* sec_websocket_key, | |||
711 | * @ingroup websocket | 711 | * @ingroup websocket |
712 | */ | 712 | */ |
713 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS | 713 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS |
714 | MHD_websocket_stream_init (struct MHD_WebSocketStream**ws, | 714 | MHD_websocket_stream_init (struct MHD_WebSocketStream **ws, |
715 | int flags, | 715 | int flags, |
716 | size_t max_payload_size); | 716 | size_t max_payload_size); |
717 | 717 | ||
@@ -746,13 +746,13 @@ MHD_websocket_stream_init (struct MHD_WebSocketStream**ws, | |||
746 | * @ingroup websocket | 746 | * @ingroup websocket |
747 | */ | 747 | */ |
748 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS | 748 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS |
749 | MHD_websocket_stream_init2 (struct MHD_WebSocketStream**ws, | 749 | MHD_websocket_stream_init2 (struct MHD_WebSocketStream **ws, |
750 | int flags, | 750 | int flags, |
751 | size_t max_payload_size, | 751 | size_t max_payload_size, |
752 | MHD_WebSocketMallocCallback callback_malloc, | 752 | MHD_WebSocketMallocCallback callback_malloc, |
753 | MHD_WebSocketReallocCallback callback_realloc, | 753 | MHD_WebSocketReallocCallback callback_realloc, |
754 | MHD_WebSocketFreeCallback callback_free, | 754 | MHD_WebSocketFreeCallback callback_free, |
755 | void* cls_rng, | 755 | void *cls_rng, |
756 | MHD_WebSocketRandomNumberGenerator callback_rng); | 756 | MHD_WebSocketRandomNumberGenerator callback_rng); |
757 | 757 | ||
758 | /** | 758 | /** |
@@ -764,7 +764,7 @@ MHD_websocket_stream_init2 (struct MHD_WebSocketStream**ws, | |||
764 | * @ingroup websocket | 764 | * @ingroup websocket |
765 | */ | 765 | */ |
766 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS | 766 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS |
767 | MHD_websocket_stream_free (struct MHD_WebSocketStream*ws); | 767 | MHD_websocket_stream_free (struct MHD_WebSocketStream *ws); |
768 | 768 | ||
769 | /** | 769 | /** |
770 | * Invalidates a websocket stream. | 770 | * Invalidates a websocket stream. |
@@ -777,7 +777,7 @@ MHD_websocket_stream_free (struct MHD_WebSocketStream*ws); | |||
777 | * @ingroup websocket | 777 | * @ingroup websocket |
778 | */ | 778 | */ |
779 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS | 779 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS |
780 | MHD_websocket_stream_invalidate (struct MHD_WebSocketStream*ws); | 780 | MHD_websocket_stream_invalidate (struct MHD_WebSocketStream *ws); |
781 | 781 | ||
782 | /** | 782 | /** |
783 | * Queries whether a websocket stream is valid. | 783 | * Queries whether a websocket stream is valid. |
@@ -789,7 +789,7 @@ MHD_websocket_stream_invalidate (struct MHD_WebSocketStream*ws); | |||
789 | * @ingroup websocket | 789 | * @ingroup websocket |
790 | */ | 790 | */ |
791 | _MHD_EXTERN enum MHD_WEBSOCKET_VALIDITY | 791 | _MHD_EXTERN enum MHD_WEBSOCKET_VALIDITY |
792 | MHD_websocket_stream_is_valid (struct MHD_WebSocketStream*ws); | 792 | MHD_websocket_stream_is_valid (struct MHD_WebSocketStream *ws); |
793 | 793 | ||
794 | /** | 794 | /** |
795 | * Decodes a byte sequence for a websocket stream. | 795 | * Decodes a byte sequence for a websocket stream. |
@@ -836,12 +836,12 @@ MHD_websocket_stream_is_valid (struct MHD_WebSocketStream*ws); | |||
836 | * @ingroup websocket | 836 | * @ingroup websocket |
837 | */ | 837 | */ |
838 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS | 838 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS |
839 | MHD_websocket_decode (struct MHD_WebSocketStream* ws, | 839 | MHD_websocket_decode (struct MHD_WebSocketStream *ws, |
840 | const char* streambuf, | 840 | const char *streambuf, |
841 | size_t streambuf_len, | 841 | size_t streambuf_len, |
842 | size_t* streambuf_read_len, | 842 | size_t *streambuf_read_len, |
843 | char** payload, | 843 | char **payload, |
844 | size_t* payload_len); | 844 | size_t *payload_len); |
845 | 845 | ||
846 | /** | 846 | /** |
847 | * Splits the payload of a decoded close frame. | 847 | * Splits the payload of a decoded close frame. |
@@ -871,11 +871,11 @@ MHD_websocket_decode (struct MHD_WebSocketStream* ws, | |||
871 | * @ingroup websocket | 871 | * @ingroup websocket |
872 | */ | 872 | */ |
873 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS | 873 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS |
874 | MHD_websocket_split_close_reason (const char* payload, | 874 | MHD_websocket_split_close_reason (const char *payload, |
875 | size_t payload_len, | 875 | size_t payload_len, |
876 | unsigned short* reason_code, | 876 | unsigned short *reason_code, |
877 | const char** reason_utf8, | 877 | const char **reason_utf8, |
878 | size_t* reason_utf8_len); | 878 | size_t *reason_utf8_len); |
879 | 879 | ||
880 | /** | 880 | /** |
881 | * Encodes an UTF-8 encoded text into websocket text frame. | 881 | * Encodes an UTF-8 encoded text into websocket text frame. |
@@ -913,13 +913,13 @@ MHD_websocket_split_close_reason (const char* payload, | |||
913 | * @ingroup websocket | 913 | * @ingroup websocket |
914 | */ | 914 | */ |
915 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS | 915 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS |
916 | MHD_websocket_encode_text (struct MHD_WebSocketStream* ws, | 916 | MHD_websocket_encode_text (struct MHD_WebSocketStream *ws, |
917 | const char* payload_utf8, | 917 | const char *payload_utf8, |
918 | size_t payload_utf8_len, | 918 | size_t payload_utf8_len, |
919 | int fragmentation, | 919 | int fragmentation, |
920 | char** frame, | 920 | char **frame, |
921 | size_t* frame_len, | 921 | size_t *frame_len, |
922 | int* utf8_step); | 922 | int *utf8_step); |
923 | 923 | ||
924 | /** | 924 | /** |
925 | * Encodes binary data into websocket binary frame. | 925 | * Encodes binary data into websocket binary frame. |
@@ -948,12 +948,12 @@ MHD_websocket_encode_text (struct MHD_WebSocketStream* ws, | |||
948 | * @ingroup websocket | 948 | * @ingroup websocket |
949 | */ | 949 | */ |
950 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS | 950 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS |
951 | MHD_websocket_encode_binary (struct MHD_WebSocketStream* ws, | 951 | MHD_websocket_encode_binary (struct MHD_WebSocketStream *ws, |
952 | const char* payload, | 952 | const char *payload, |
953 | size_t payload_len, | 953 | size_t payload_len, |
954 | int fragmentation, | 954 | int fragmentation, |
955 | char** frame, | 955 | char **frame, |
956 | size_t* frame_len); | 956 | size_t *frame_len); |
957 | 957 | ||
958 | /** | 958 | /** |
959 | * Encodes a websocket ping frame | 959 | * Encodes a websocket ping frame |
@@ -977,11 +977,11 @@ MHD_websocket_encode_binary (struct MHD_WebSocketStream* ws, | |||
977 | * @ingroup websocket | 977 | * @ingroup websocket |
978 | */ | 978 | */ |
979 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS | 979 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS |
980 | MHD_websocket_encode_ping (struct MHD_WebSocketStream* ws, | 980 | MHD_websocket_encode_ping (struct MHD_WebSocketStream *ws, |
981 | const char* payload, | 981 | const char *payload, |
982 | size_t payload_len, | 982 | size_t payload_len, |
983 | char** frame, | 983 | char **frame, |
984 | size_t* frame_len); | 984 | size_t *frame_len); |
985 | 985 | ||
986 | /** | 986 | /** |
987 | * Encodes a websocket pong frame | 987 | * Encodes a websocket pong frame |
@@ -1010,11 +1010,11 @@ MHD_websocket_encode_ping (struct MHD_WebSocketStream* ws, | |||
1010 | * @ingroup websocket | 1010 | * @ingroup websocket |
1011 | */ | 1011 | */ |
1012 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS | 1012 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS |
1013 | MHD_websocket_encode_pong (struct MHD_WebSocketStream* ws, | 1013 | MHD_websocket_encode_pong (struct MHD_WebSocketStream *ws, |
1014 | const char* payload, | 1014 | const char *payload, |
1015 | size_t payload_len, | 1015 | size_t payload_len, |
1016 | char** frame, | 1016 | char **frame, |
1017 | size_t* frame_len); | 1017 | size_t *frame_len); |
1018 | 1018 | ||
1019 | /** | 1019 | /** |
1020 | * Encodes a websocket close frame | 1020 | * Encodes a websocket close frame |
@@ -1052,12 +1052,12 @@ MHD_websocket_encode_pong (struct MHD_WebSocketStream* ws, | |||
1052 | * @ingroup websocket | 1052 | * @ingroup websocket |
1053 | */ | 1053 | */ |
1054 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS | 1054 | _MHD_EXTERN enum MHD_WEBSOCKET_STATUS |
1055 | MHD_websocket_encode_close (struct MHD_WebSocketStream* ws, | 1055 | MHD_websocket_encode_close (struct MHD_WebSocketStream *ws, |
1056 | unsigned short reason_code, | 1056 | unsigned short reason_code, |
1057 | const char* reason_utf8, | 1057 | const char *reason_utf8, |
1058 | size_t reason_utf8_len, | 1058 | size_t reason_utf8_len, |
1059 | char** frame, | 1059 | char **frame, |
1060 | size_t* frame_len); | 1060 | size_t *frame_len); |
1061 | 1061 | ||
1062 | /** | 1062 | /** |
1063 | * Allocates memory with the associated 'malloc' function | 1063 | * Allocates memory with the associated 'malloc' function |
@@ -1069,8 +1069,8 @@ MHD_websocket_encode_close (struct MHD_WebSocketStream* ws, | |||
1069 | * @return The allocated memory on success or NULL on failure. | 1069 | * @return The allocated memory on success or NULL on failure. |
1070 | * @ingroup websocket | 1070 | * @ingroup websocket |
1071 | */ | 1071 | */ |
1072 | _MHD_EXTERN void* | 1072 | _MHD_EXTERN void * |
1073 | MHD_websocket_malloc (struct MHD_WebSocketStream* ws, | 1073 | MHD_websocket_malloc (struct MHD_WebSocketStream *ws, |
1074 | size_t buf_len); | 1074 | size_t buf_len); |
1075 | 1075 | ||
1076 | /** | 1076 | /** |
@@ -1086,9 +1086,9 @@ MHD_websocket_malloc (struct MHD_WebSocketStream* ws, | |||
1086 | * remains valid. | 1086 | * remains valid. |
1087 | * @ingroup websocket | 1087 | * @ingroup websocket |
1088 | */ | 1088 | */ |
1089 | _MHD_EXTERN void* | 1089 | _MHD_EXTERN void * |
1090 | MHD_websocket_realloc (struct MHD_WebSocketStream* ws, | 1090 | MHD_websocket_realloc (struct MHD_WebSocketStream *ws, |
1091 | void* buf, | 1091 | void *buf, |
1092 | size_t new_buf_len); | 1092 | size_t new_buf_len); |
1093 | 1093 | ||
1094 | /** | 1094 | /** |
@@ -1104,8 +1104,8 @@ MHD_websocket_realloc (struct MHD_WebSocketStream* ws, | |||
1104 | * @ingroup websocket | 1104 | * @ingroup websocket |
1105 | */ | 1105 | */ |
1106 | _MHD_EXTERN int | 1106 | _MHD_EXTERN int |
1107 | MHD_websocket_free (struct MHD_WebSocketStream* ws, | 1107 | MHD_websocket_free (struct MHD_WebSocketStream *ws, |
1108 | void* buf); | 1108 | void *buf); |
1109 | 1109 | ||
1110 | #if 0 /* keep Emacsens' auto-indent happy */ | 1110 | #if 0 /* keep Emacsens' auto-indent happy */ |
1111 | { | 1111 | { |