diff options
| -rw-r--r-- | lib/libtinytac/lmemory.c | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/lib/libtinytac/lmemory.c b/lib/libtinytac/lmemory.c index ccbb3ec..8f35104 100644 --- a/lib/libtinytac/lmemory.c +++ b/lib/libtinytac/lmemory.c | |||
| @@ -79,16 +79,6 @@ | |||
| 79 | //--------------------// | 79 | //--------------------// |
| 80 | #pragma mark TinyTac prototypes | 80 | #pragma mark TinyTac prototypes |
| 81 | 81 | ||
| 82 | extern void | ||
| 83 | tinytac_tinytac_free( | ||
| 84 | TinyTac * tt ); | ||
| 85 | |||
| 86 | |||
| 87 | static void | ||
| 88 | tinytac_tinytac_free_budps( | ||
| 89 | BindleURLDesc ** budps ); | ||
| 90 | |||
| 91 | |||
| 92 | static int | 82 | static int |
| 93 | tinytac_set_option_flag( | 83 | tinytac_set_option_flag( |
| 94 | TinyTac * tt, | 84 | TinyTac * tt, |
| @@ -109,6 +99,16 @@ tinytac_set_option_keys( | |||
| 109 | char * const * invalues ); | 99 | char * const * invalues ); |
| 110 | 100 | ||
| 111 | 101 | ||
| 102 | extern void | ||
| 103 | tinytac_tinytac_free( | ||
| 104 | TinyTac * tt ); | ||
| 105 | |||
| 106 | |||
| 107 | static void | ||
| 108 | tinytac_tinytac_free_budps( | ||
| 109 | BindleURLDesc ** budps ); | ||
| 110 | |||
| 111 | |||
| 112 | //-------------------// | 112 | //-------------------// |
| 113 | // object prototypes // | 113 | // object prototypes // |
| 114 | //-------------------// | 114 | //-------------------// |
| @@ -154,42 +154,6 @@ const char * tinytac_dflt_hosts = TTAC_DFLT_HOSTS; | |||
| 154 | //-------------------// | 154 | //-------------------// |
| 155 | #pragma mark TinyTac functions | 155 | #pragma mark TinyTac functions |
| 156 | 156 | ||
| 157 | void | ||
| 158 | tinytac_tinytac_free( | ||
| 159 | TinyTac * tt ) | ||
| 160 | { | ||
| 161 | TinyTacDebugTrace(); | ||
| 162 | |||
| 163 | assert(tt != NULL); | ||
| 164 | |||
| 165 | if ((tt->hosts)) | ||
| 166 | free(tt->hosts); | ||
| 167 | if ((tt->keys)) | ||
| 168 | tinytacb_strsfree(tt->keys); | ||
| 169 | |||
| 170 | tinytac_tinytac_free_budps(tt->budps); | ||
| 171 | |||
| 172 | memset(tt, 0, sizeof(TinyTac)); | ||
| 173 | free(tt); | ||
| 174 | |||
| 175 | return; | ||
| 176 | } | ||
| 177 | |||
| 178 | |||
| 179 | void | ||
| 180 | tinytac_tinytac_free_budps( | ||
| 181 | BindleURLDesc ** budps ) | ||
| 182 | { | ||
| 183 | size_t pos; | ||
| 184 | if (!(budps)) | ||
| 185 | return; | ||
| 186 | for(pos = 0; ((budps[pos])); pos++) | ||
| 187 | tinytacb_urldesc_free(budps[pos]); | ||
| 188 | free(budps); | ||
| 189 | return; | ||
| 190 | } | ||
| 191 | |||
| 192 | |||
| 193 | int | 157 | int |
| 194 | tinytac_get_option( | 158 | tinytac_get_option( |
| 195 | TinyTac * tt, | 159 | TinyTac * tt, |
| @@ -653,6 +617,42 @@ tinytac_set_option_keys( | |||
| 653 | } | 617 | } |
| 654 | 618 | ||
| 655 | 619 | ||
| 620 | void | ||
| 621 | tinytac_tinytac_free( | ||
| 622 | TinyTac * tt ) | ||
| 623 | { | ||
| 624 | TinyTacDebugTrace(); | ||
| 625 | |||
| 626 | assert(tt != NULL); | ||
| 627 | |||
| 628 | if ((tt->hosts)) | ||
| 629 | free(tt->hosts); | ||
| 630 | if ((tt->keys)) | ||
| 631 | tinytacb_strsfree(tt->keys); | ||
| 632 | |||
| 633 | tinytac_tinytac_free_budps(tt->budps); | ||
| 634 | |||
| 635 | memset(tt, 0, sizeof(TinyTac)); | ||
| 636 | free(tt); | ||
| 637 | |||
| 638 | return; | ||
| 639 | } | ||
| 640 | |||
| 641 | |||
| 642 | void | ||
| 643 | tinytac_tinytac_free_budps( | ||
| 644 | BindleURLDesc ** budps ) | ||
| 645 | { | ||
| 646 | size_t pos; | ||
| 647 | if (!(budps)) | ||
| 648 | return; | ||
| 649 | for(pos = 0; ((budps[pos])); pos++) | ||
| 650 | tinytacb_urldesc_free(budps[pos]); | ||
| 651 | free(budps); | ||
| 652 | return; | ||
| 653 | } | ||
| 654 | |||
| 655 | |||
| 656 | //------------------// | 656 | //------------------// |
| 657 | // object functions // | 657 | // object functions // |
| 658 | //------------------// | 658 | //------------------// |
