Help for this page

Select Code to Download


  1. or download this
    typedef struct
    {
       int count;
       char *str[];
    } Edje_Message_String_Set;
    
  2. or download this
    malloc( sizeof(Edje_Message_String_Set) + (count-1)*sizeof(char *) );
    
  3. or download this
    Newx(message,1,EdjeMessageStringSet);
    Renewc(message,count+2, char*,EdjeMessageStringSet);
    if (message == NULL) 
            croak("Failed to allocate memory in _new function\n");
    
  4. or download this
    void   Newx(void* ptr, int nitems, type)
    void*  safemalloc(size_t size)
    ...
    if (message == NULL) 
            croak("Failed to allocate memory in _new function\n");
    // Of course should have checked this after the Newx().
    
  5. or download this
    EdjeMessageStringSet* m = (EdjeMessageStringSet*) safemalloc( sizeof(E
    +dje_Message_String_Set) + (count-1)*sizeof(char *) );
    if (m == NULL) 
       croak("Failed to allocate memory in _new function\n");