Uploaded image for project: 'Axis2-C'
  1. Axis2-C
  2. AXIS2C-1443

axutil_string_create_const() has a strange signature

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 1.6.0
    • None
    • util
    • None

    Description

      axutil_string_create_const() has a strange signature:

      /**

      • Creates a string struct.
      • @param str pointer to string. string struct would not create a duplicate
      • of this and assumes the str would have longer life than that of itself
      • @param env pointer to environment struct
      • @return a pointer to newly created string struct
        */
        AXIS2_EXTERN axutil_string_t *AXIS2_CALL
        axutil_string_create_const(
        const axutil_env_t * env,
        axis2_char_t ** str);

      Why "** str" and not "* str" ?

      I expected to be able to do:
      axutil_string_t *soap_action = axutil_string_create_const(env, "MySoapAction");

      Instead I have to do:
      const axis2_char_t * MySoapAction = "MySoapAction"
      axutil_string_t *soap_action = axutil_string_create_const(env, &MySoapAction);

      This is crazy !

      Same problem for axutil_string_create_assume_ownership().

      Attachments

        Activity

          People

            Unassigned Unassigned
            dolmen-oxymel Olivier Mengué
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: