1 extern void sockets_initialize (void)
2 /*@requires sockets_uninitialized@*/
3 /*@ensures sockets_initialized@*/ ;
5 extern void sockets_finalize (void)
6 /*@requires sockets_initialized@*/
7 /*@ensures sockets_uninitialized@*/ ;
9 extern void useSockets (void) /*@requires sockets_initialized@*/ ;
11 void test1 (void) /*@requires sockets_uninitialized@*/
13 useSockets (); /* error */
16 void test2 (void) /*@requires sockets_initialized@*/
18 useSockets (); /* okay */
21 void test3 (void) /*@requires sockets_uninitialized@*/
23 sockets_initialize ();
24 useSockets (); /* okay */
27 void test4 (void) /*@requires sockets_uninitialized@*/ /*@ensures sockets_uninitialized@*/
29 sockets_initialize ();
30 useSockets (); /* okay */
31 } /* error not finzalized */
33 void test5 (void) /*@requires sockets_uninitialized@*/ /*@ensures sockets_uninitialized@*/
35 sockets_initialize ();
37 useSockets (); /* error */
42 useSockets (); /* error (default is uninitialized) */
47 sockets_initialize (); /* okay (default is uninitialized) */