Lines Matching defs:new
420 char *new = NULL;
425 new = coap_malloc_type(COAP_STRING, ctx->observe_save_file->length + 5);
426 if (!new)
429 strcpy(new, (const char *)ctx->observe_save_file->s);
430 strcat(new, ".tmp");
431 fp_new = fopen(new, "w+");
465 /* Either old or new is in place */
466 (void)rename(new, (const char *)ctx->observe_save_file->s);
467 coap_free_type(COAP_STRING, new);
477 if (new) {
478 (void)remove(new);
480 coap_free_type(COAP_STRING, new);
485 * client has registered a new observe subscription request.
503 char *new = NULL;
507 new = coap_malloc_type(COAP_STRING,
509 if (!new)
512 strcpy(new, (const char *)session->context->observe_save_file->s);
513 strcat(new, ".tmp");
514 fp_new = fopen(new, "w+");
538 /* Add in new entry to the end */
548 /* Either old or new is in place */
549 (void)rename(new, (const char *)session->context->observe_save_file->s);
550 coap_free_type(COAP_STRING, new);
560 if (new) {
561 (void)remove(new);
563 coap_free_type(COAP_STRING, new);
583 char *new = NULL;
589 new = coap_malloc_type(COAP_STRING,
591 if (!new)
594 strcpy(new, (const char *)session->context->observe_save_file->s);
595 strcat(new, ".tmp");
596 fp_new = fopen(new, "w+");
625 /* Either old or new is in place */
626 (void)rename(new, (const char *)session->context->observe_save_file->s);
627 coap_free_type(COAP_STRING, new);
637 if (new) {
638 (void)remove(new);
640 coap_free_type(COAP_STRING, new);
701 char *new = NULL;
705 new = coap_malloc_type(COAP_STRING, context->obs_cnt_save_file->length + 5);
706 if (!new)
709 strcpy(new, (const char *)context->obs_cnt_save_file->s);
710 strcat(new, ".tmp");
711 fp_new = fopen(new, "w+");
741 /* Either old or new is in place */
742 (void)rename(new, (const char *)context->obs_cnt_save_file->s);
743 coap_free_type(COAP_STRING, new);
751 if (new) {
752 (void)remove(new);
754 coap_free_type(COAP_STRING, new);
767 char *new = NULL;
771 new = coap_malloc_type(COAP_STRING, context->obs_cnt_save_file->length + 5);
772 if (!new)
775 strcpy(new, (const char *)context->obs_cnt_save_file->s);
776 strcat(new, ".tmp");
777 fp_new = fopen(new, "w+");
804 /* Either old or new is in place */
805 (void)rename(new, (const char *)context->obs_cnt_save_file->s);
806 coap_free_type(COAP_STRING, new);
814 if (new) {
815 (void)remove(new);
817 coap_free_type(COAP_STRING, new);
919 /* Create the new resource using the application logic */
966 * Server has set up a new dynamic resource agains a request for an unknown
976 char *new = NULL;
988 new = coap_malloc_type(COAP_STRING,
990 if (!new)
993 strcpy(new, (const char *)context->dyn_resource_save_file->s);
994 strcat(new, ".tmp");
995 fp_new = fopen(new, "w+");
1016 /* Add new entry to the end */
1025 /* Either old or new is in place */
1026 (void)rename(new, (const char *)context->dyn_resource_save_file->s);
1027 coap_free_type(COAP_STRING, new);
1035 if (new) {
1036 (void)remove(new);
1038 coap_free_type(COAP_STRING, new);
1051 char *new = NULL;
1063 new = coap_malloc_type(COAP_STRING,
1065 if (!new)
1068 strcpy(new, (const char *)context->dyn_resource_save_file->s);
1069 strcat(new, ".tmp");
1070 fp_new = fopen(new, "w+");
1096 /* Either old or new is in place */
1097 (void)rename(new, (const char *)context->dyn_resource_save_file->s);
1098 coap_free_type(COAP_STRING, new);
1106 if (new) {
1107 (void)remove(new);
1109 coap_free_type(COAP_STRING, new);